[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.52-36-g13757f0

Andreas Beckmann anbe at debian.org
Thu May 30 13:37:16 UTC 2013


The following commit has been merged in the develop branch:
commit bcca7f6ec53e5397dc3441ff3c37e4ee2f06c612
Author: Andreas Beckmann <anbe at debian.org>
Date:   Tue Feb 5 15:53:06 2013 +0100

    new known problem: missing md5sums
    
    report packages with missing or incomplete .md5sums files
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>

diff --git a/custom-scripts/scripts/pre_remove_40_find_missing_md5sums b/custom-scripts/scripts/pre_remove_40_find_missing_md5sums
new file mode 100755
index 0000000..a1b77fd
--- /dev/null
+++ b/custom-scripts/scripts/pre_remove_40_find_missing_md5sums
@@ -0,0 +1,43 @@
+#!/bin/sh
+set -e
+
+for pkg in ${PIUPARTS_OBJECTS%%=*}
+do
+	# skip check if the package is not installed
+	dpkg-query -s "$pkg" >/dev/null 2>&1 || continue
+	status="$(dpkg-query -W -f '${Status}' $pkg)"
+	test "$status" != "unknown ok not-installed" || continue
+	test "$status" != "deinstall ok config-files" || continue
+
+	md5file="/var/lib/dpkg/info/$pkg.md5sums"
+	test -f "$md5file" || md5file="/var/lib/dpkg/info/$pkg:$(dpkg --print-architecture).md5sums"
+	if [ ! -f "$md5file" ]; then
+		echo "MD5SUM FILE NOT FOUND FOR $pkg"
+		continue
+	fi
+
+	f1=/var/run/f1.$$
+	sed -r 's%^[0-9a-f]{32}  %/%' "$md5file" | sort >$f1
+
+	f2=/var/run/f2.$$
+	>$f2
+	dpkg -L "$pkg" | sort | \
+	while read f ; do
+		if [ -d "$f" ]; then
+			: # ignore directories
+		elif [ -L "$f" ]; then
+			: # ignore links
+		elif [ -z "${f%%/etc/*}" ]; then
+			: # ignore files in /etc - probably conffiles
+		elif [ ! -e "$f" ]; then
+			echo "${pkg}: MISSING OBJECT $f"
+		else
+			echo "$f" >> $f2
+		fi
+	done
+
+	comm -13 $f1 $f2 | sed "s/^/${pkg}: FILE WITHOUT MD5SUM /"
+	comm -23 $f1 $f2 | sed "s/^/${pkg}: MD5SUM WITHOUT FILE /"
+
+	rm -f $f1 $f2
+done
diff --git a/debian/changelog b/debian/changelog
index e670cae..bf003b8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,7 @@ piuparts (0.53) UNRELEASED; urgency=low
   * debian/control:
     - Bump Build-Depends: python (>= 2.7).
     - piuparts-slave: Add Depends: sudo.  (Closes: #710350)
+  * New known problem: Packages with missing or incomplete .md5sums files.
 
   [ David Steele ]
   * Update python Requires to 2.7 (for argparse)
diff --git a/known_problems/missing_md5sums_error.conf b/known_problems/missing_md5sums_error.conf
new file mode 100644
index 0000000..22174d4
--- /dev/null
+++ b/known_problems/missing_md5sums_error.conf
@@ -0,0 +1,12 @@
+#
+# detect packages that ship files without md5sums
+#
+PATTERN='(FILE WITHOUT MD5SUM|MD5SUM FILE NOT FOUND)'
+WHERE='fail bugged affected'
+ISSUE=0
+HEADER='Packages containing files without md5sum'
+HELPTEXT='
+<p>
+Packages that ship files that have no md5sum.
+</p>
+'
diff --git a/known_problems/missing_md5sums_issue.conf b/known_problems/missing_md5sums_issue.conf
new file mode 100644
index 0000000..8bb1ebb
--- /dev/null
+++ b/known_problems/missing_md5sums_issue.conf
@@ -0,0 +1,12 @@
+#
+# detect packages that ship files without md5sums
+#
+PATTERN='(FILE WITHOUT MD5SUM|MD5SUM FILE NOT FOUND)'
+WHERE='pass'
+ISSUE=1
+HEADER='Packages containing files without md5sum'
+HELPTEXT='
+<p>
+Packages that ship files that have no md5sum.
+</p>
+'
diff --git a/piuparts-report.py b/piuparts-report.py
index 591366d..b397b3f 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -380,6 +380,7 @@ linktarget_by_template = [
     ("packages_have_been_kept_back_issue.tpl", "but logfile contains 'packages have been kept back'"),
     ("needs_rebuild_issue.tpl", "but logfile recommends to rebuild some packages"),
     ("obsolete_conffiles_issue.tpl", "but logfile reports obsolete conffiles"),
+    ("missing_md5sums_issue.tpl", "but logfile reports missing md5sums"),
 
     ("dependency_error.tpl", "due to unsatisfied dependencies"),
     ("packages_have_been_kept_back_error.tpl", "...and logfile also contains 'packages have been kept back'"),
@@ -412,6 +413,7 @@ linktarget_by_template = [
     ("broken_symlinks_error.tpl", "...and logfile also contains 'broken symlinks'"),
     ("inadequate_error.tpl", "due to logfile containing inadequate errors"),
     ("obsolete_conffiles_error.tpl", "...and logfile reports obsolete conffiles"),
+    ("missing_md5sums_error.tpl", "...and logfile reports missing md5sums"),
     ("unknown_failures.tpl", "due to unclassified failures"),
 ]
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list