lintian imager-0.7
authorHeiko Schlittermann (JUMPER) <hs@schlittermann.de>
Fri, 16 Sep 2011 11:23:46 +0200
changeset 95 006cedfc3ce2
parent 94 cffc45cd7e69
child 96 b056f228e1c9
lintian * fixed lintian bugs * fixed lintian warnings
debian/README.Debian
debian/changelog
debian/control
debian/copyright
debian/po/POTFILES.in
debian/po/templates.pot
debian/source/options
examples/backup
--- a/debian/README.Debian	Mon Sep 12 12:47:21 2011 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-imager for Debian
------------------
-
-<possible notes regarding this package - if none, delete this file>
-
- -- Heiko Schlittermann <hs@schlittermann.de>  Mon, 12 Sep 2011 12:24:13 +0200
--- a/debian/changelog	Mon Sep 12 12:47:21 2011 +0200
+++ b/debian/changelog	Fri Sep 16 11:23:46 2011 +0200
@@ -1,3 +1,10 @@
+imager (0.7) stable; urgency=low
+
+  * fixed lintian bugs 
+  * fixed lintian warnings 
+
+ -- Heiko Schlittermann <hs@schlittermann.de>  Fri, 16 Sep 2011 11:23:26 +0200
+
 imager (0.6) stable; urgency=low
 
   * added chance to remove the local install 
--- a/debian/control	Mon Sep 12 12:47:21 2011 +0200
+++ b/debian/control	Fri Sep 16 11:23:46 2011 +0200
@@ -3,7 +3,7 @@
 Priority: extra
 Maintainer: Heiko Schlittermann <hs@schlittermann.de>
 Build-Depends: debhelper (>= 7.0.50~)
-Standards-Version: 3.8.4
+Standards-Version: 3.9.1
 Homepage: https://ssl.schlittermann.de/hg/imager
 #Vcs-Git: git://git.debian.org/collab-maint/imager.git
 #Vcs-Browser: http://git.debian.org/?p=collab-maint/imager.git;a=summary
--- a/debian/copyright	Mon Sep 12 12:47:21 2011 +0200
+++ b/debian/copyright	Fri Sep 16 11:23:46 2011 +0200
@@ -4,17 +4,15 @@
 
 It was downloaded from:
 
-    <url://example.com>
+    https://ssl.schlittermann.de/hg/imager
 
 Upstream Author(s):
 
-    <put author's name and email here>
-    <likewise for another author>
+    Heiko Schlittermann <hs@schlittermann.de>
 
 Copyright:
 
-    <Copyright (C) YYYY Firstname Lastname>
-    <likewise for another author>
+    Copyright (C) 2011 Heiko Schlittermann
 
 License:
 
@@ -38,13 +36,4 @@
 
     Copyright (C) 2011 Heiko Schlittermann <hs@schlittermann.de>
 
-# Please chose a license for your packaging work. If the program you package
-# uses a mainstream license, using the same license is the safest choice.
-# Please avoid to pick license terms that are more restrictive than the
-# packaged work, as it may make Debian's contributions unacceptable upstream.
-# If you just want it to be GPL version 3, leave the following line in.
-
 and is licensed under the GPL version 3, see above.
-
-# Please also look if there are files or directories which have a
-# different copyright/license attached and list them here.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/po/POTFILES.in	Fri Sep 16 11:23:46 2011 +0200
@@ -0,0 +1,1 @@
+[type: gettext/rfc822deb] imager.templates
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/po/templates.pot	Fri Sep 16 11:23:46 2011 +0200
@@ -0,0 +1,32 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: imager@packages.debian.org\n"
+"POT-Creation-Date: 2011-09-16 11:20+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Type: boolean
+#. Description
+#: ../imager.templates:1001
+msgid "local imager found - remove?"
+msgstr ""
+
+#. Type: boolean
+#. Description
+#: ../imager.templates:1001
+msgid ""
+"There seems to exist an old version of the imager in /usr/local/imager. This "
+"may interfere with the version we're installing."
+msgstr ""
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/debian/source/options	Fri Sep 16 11:23:46 2011 +0200
@@ -0,0 +1,3 @@
+tar-ignore
+tar-ignore *.ex
+tar-ignore *.EX
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/examples/backup	Fri Sep 16 11:23:46 2011 +0200
@@ -0,0 +1,91 @@
+#! /bin/bash -e
+
+export TMPDIR=/var/tmp
+export LC_ALL=C
+
+SNAPSIZE=1G
+DST=${1?need destination folder}
+VG=`hostname`
+DEV=/dev/sda1
+NICE=
+
+now=`date +%s`
+tmp=`mktemp`
+snaps=`mktemp`
+
+_lvremove() {
+	local dev=$1
+	local vg=${dev%/*}
+	local lv=${dev#*/}
+
+	udevadm settle || true
+	lvremove -f "$dev" || {
+		dmsetup remove /dev/$vg/$lv \
+		&& udevadm settle \
+		&& dmsetup remove /dev/$vg/$lv-cow \
+		&& udevadm settle \
+		&& lvremove -f "$dev" || true
+	}
+}
+
+cleanup() {
+
+	while read lvm dev orig cleanup; do
+		udevadm settle
+		test -e "$dev" && test "$cleanup" || continue
+		eval $cleanup || true
+	done < $snaps
+
+	rm -f $tmp $snaps
+}
+
+trap cleanup EXIT INT
+
+for dev in $DEV; do
+	if mount -o remount,ro $dev; then
+		echo "- $tmp - rm -fv $tmp" >>$snaps
+		cp -v $dev $tmp
+		mount -o remount,rw $dev
+		file -s $tmp | egrep -q "ext[234] filesystem" && e2fsck -C0 -f -y $tmp || true
+		imager save --now=$now -z $tmp:$dev $DST
+		rm -f $tmp
+	fi
+done
+
+
+lvs -o vg_name,lv_name,origin --noheadings $VG | while read vg lv origin; do
+	# LVM-name DEV-name ORIG-name (cleanup)
+
+	orig="$vg/$lv"
+	if test "$origin"; then
+		dev="/dev/$vg/$lv"
+		echo "$vg/$lv $dev $dev" >>$snaps
+		continue
+	fi
+	snap="$vg/$lv.snap.$now"
+	dev="/dev/$vg/$lv.snap.$now"
+	lvcreate -s -L $SNAPSIZE -n "$snap" "$orig"
+	echo "$snap $dev /dev/$vg/$lv _lvremove $snap" >>$snaps
+done
+
+udevadm settle
+
+while read snap dev name cleanup; do
+	test "$snap" = "-" && continue
+	for a in 1 2 3; do
+		file -s `readlink -f $dev` | egrep -q "ext[234] filesystem" && $NICE fsck -y "$dev" && break
+		case $? in
+			32)	exit;;
+			*)	true;;
+		esac
+	done
+	if test $? = 0; then
+		$NICE imager save --now=$now -z $dev:$name $DST 
+		case `lvs -o snap_percent --noheadings "$snap"` in
+			100*)	echo "****************** $snap is full!";;
+		esac
+	fi
+	test "$cleanup" && eval $cleanup || true
+done <$snaps
+date
+date  >/var/log/backup.done