[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.49-30-gbd8fd0e

Andreas Beckmann debian at abeckmann.de
Mon Jan 21 17:39:04 UTC 2013


The following commit has been merged in the piatti branch:
commit b926d9ffcd8fb2cdab61e43f49855034bb96b23f
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sun Jan 20 14:11:50 2013 +0100

    p-a: add support for magic "$DISTRO/None" versions
    
    for distupgrades of disappearing packages
    
    pass the target distribution of distupgrade tests as a command
    line argument to piuparts-analyze
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 7d7707e..2d8ff5d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -10,6 +10,7 @@ piuparts (0.50) UNRELEASED; urgency=low
   * piuparts-master.py:
   * piuparts-slave.py:
   * piuparts-analyze.py:
+    - Add support for magic "$DISTRO/None" versions.
   * piuparts-report.py:
   * pre_install_exceptions: Handle bootcd-ia64 installation in squeeze.
   * post_distupgrade_exceptions: Handle libdb4.8 removal in wheezy.
diff --git a/master-bin/report_newly_bugged_packages b/master-bin/report_newly_bugged_packages
index 57c76b9..ca60399 100755
--- a/master-bin/report_newly_bugged_packages
+++ b/master-bin/report_newly_bugged_packages
@@ -49,7 +49,8 @@ OUTPUT=$(mktemp)
 for SECTION in $SECTIONS ; do
 	test -d $MASTER/$SECTION || continue
 		cd $MASTER/$SECTION
-		$PIUPARTS_PREFIX/share/piuparts/piuparts-analyze 2>&1 > $OUTPUT
+		get_config_value DISTROS $SECTION upgrade-test-distros " "
+		$PIUPARTS_PREFIX/share/piuparts/piuparts-analyze ${DISTROS##* } 2>&1 > $OUTPUT
 		if [ -s $OUTPUT ]; then
 			echo $SECTION
 			cat $OUTPUT
diff --git a/piuparts-analyze.py b/piuparts-analyze.py
index 45970f4..3b13c5a 100644
--- a/piuparts-analyze.py
+++ b/piuparts-analyze.py
@@ -32,6 +32,7 @@ move the failed log to ./bugged as well.
 
 
 import os
+import sys
 import re
 import shutil
 import subprocess
@@ -43,6 +44,7 @@ apt_pkg.init_system()
 
 error_pattern = re.compile(r"(?<=\n).*error.*\n?", flags=re.IGNORECASE)
 chroot_pattern = re.compile(r"tmp/tmp.*?'")
+distro = "?"
 
 
 def find_logs(directory):
@@ -127,7 +129,16 @@ def get_bug_versions(bug):
     """Gets a list of only the version numbers for which the bug is found.
     Newest versions are returned first."""
     # debianbts returns it in the format package/1.2.3 or 1.2.3 which will become 1.2.3
-    return list(reversed(sorted([x.rsplit('/', 1)[-1] for x in debianbts.get_status((bug,))[0].found_versions], cmp=apt_pkg.version_compare))) or ['~']
+    versions = []
+    for found_version in debianbts.get_status((bug,))[0].found_versions:
+        v = found_version.rsplit('/', 1)[-1]
+        if v == "None":
+            # only allow the distro-qualified "$distro/None" version
+            if found_version == distro + "/" + v:
+                versions.append(v)
+        else:
+            versions.append(v)
+    return list(reversed(sorted(versions, cmp=apt_pkg.version_compare))) or ['~']
 
 
 def write_bug_file(failed_log, bugs):
@@ -249,6 +260,9 @@ def piuparts_bugs_affecting(package):
 
 
 def main():
+    if len(sys.argv) > 1:
+        global distro
+        distro = sys.argv[1]
     mark_logs_with_reported_bugs()
     report_packages_with_many_logs()
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list