[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.48-79-gdf94975

Andreas Beckmann debian at abeckmann.de
Sat Jan 12 11:33:09 UTC 2013


The following commit has been merged in the master branch:
commit b67309125287cc6f0e872837b8590e601ef194ed
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Mon Nov 5 18:43:56 2012 +0100

    p-s: test_package: check existence before distupgrade test
    
    for distupgrades, dump package info from all distros
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index 673467e..fe8c495 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -555,20 +555,6 @@ def log_name(package, version):
     return "%s_%s.log" % (package, version)
 
 
-def upgrade_testable(config, package, packages_files):
-    if config["upgrade-test-distros"]:
-        distros = config["upgrade-test-distros"].split()
-        if not distros:
-            return False
-
-        for distro in distros:
-            if not package["Package"] in packages_files[distro]:
-                return False
-        return True
-    else:
-        return False
-
-
 def run_test_with_timeout(cmd, maxwait, kill_all=True):
 
     def terminate_subprocess(p, kill_all):
@@ -698,7 +684,39 @@ def test_package(config, pname, pvers, packages_files, package):
             ret += 1024
             output.write(" *** PIUPARTS OUTPUT INCOMPLETE ***\n");
 
-    if ret == 0 and config["upgrade-test-chroot-tgz"] and upgrade_testable(config, package, packages_files):
+    if ret == 0 and config["upgrade-test-chroot-tgz"]:
+        distros = config["upgrade-test-distros"].split()
+        if distros:
+            # the package must exist in at least one of the older distros
+            for distro in distros[:-1]:
+                if pname in packages_files[distro]:
+                    break
+            else:
+                output.write("Package %s not found in any old distribution\n" % pname)
+                ret = -10003
+
+            # and (usually) in the target distro
+            distro = distros[-1]
+            if not pname in packages_files[distro]:
+                    output.write("Package %s not found in %s\n" % (pname, distro))
+                    ret = -10004
+            else:
+                package = packages_files[distro][pname]
+                if pvers != package["Version"]:
+                    output.write("Package %s %s not found in %s, %s is available\n" % (pname, pvers, distro, package["Version"]))
+                    ret = -10005
+
+            for distro in distros:
+                output.write("\n[%s]\n" % distro)
+                if pname in packages_files[distro]:
+                    packages_files[distro][pname].dump(output)
+            output.write("\n")
+        else:
+            ret = -10010
+        if ret != 0:
+            subdir = "untestable"
+
+    if ret == 0 and config["upgrade-test-chroot-tgz"]:
         command = base_command[:]
         command.extend(["-b", config["upgrade-test-chroot-tgz"]])
         for distro in config["upgrade-test-distros"].split():

-- 
piuparts git repository



More information about the Piuparts-commits mailing list