[Piuparts-commits] [SCM] piuparts git repository branch, piatti, updated. 0.48-19-g93bfc2b

Andreas Beckmann debian at abeckmann.de
Sat Dec 1 10:51:01 UTC 2012


The following commit has been merged in the piatti branch:
commit 204626a0e81ca88246a395fc633f74411bdebfcf
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Mon Nov 5 17:34:56 2012 +0100

    p-s: prepare for moving package checks to test_package()
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index f63f5e3..d504a29 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -530,7 +530,7 @@ class Section:
             if package_name in packages_file:
                 package = packages_file[package_name]
                 if version == package["Version"]:
-                    test_package(self._config, package, packages_files)
+                    test_package(self._config, package_name, version, packages_files, package)
                 else:
                     logging.info("Cannot test %s/%s %s" % (self._config.section, package_name, version))
                     create_file(os.path.join("untestable",
@@ -634,12 +634,10 @@ def run_test_with_timeout(cmd, maxwait, kill_all=True):
     return p.returncode,stdout
 
 
-def test_package(config, package, packages_files):
+def test_package(config, pname, pvers, packages_files, package):
     global old_sigint_handler
     old_sigint_handler = signal(SIGINT, sigint_handler)
 
-    pname = package["Package"]
-    pvers = package["Version"]
     logging.info("Testing package %s/%s %s" % (config.section, pname, pvers))
 
     output_name = log_name(pname, pvers)
@@ -660,8 +658,10 @@ def test_package(config, package, packages_files):
     if config["tmpdir"]:
         base_command.extend(["--tmpdir", config["tmpdir"]])
 
+    subdir = "fail"
     ret = 0
-    if config["chroot-tgz"]:
+
+    if ret == 0 and config["chroot-tgz"]:
         command = base_command[:]
         command.extend(["-b", config["chroot-tgz"]])
         command.extend(["-d", config["distro"]])
@@ -706,9 +706,7 @@ def test_package(config, package, packages_files):
     output.write(time.strftime("End: %Y-%m-%d %H:%M:%S %Z\n",
                                time.gmtime()))
     output.close()
-    if ret != 0:
-        subdir = "fail"
-    else:
+    if ret == 0:
         subdir = "pass"
     os.rename(new_name, os.path.join(subdir, output_name))
     logging.debug("Done with %s: %s (%d)" % (output_name, subdir, ret))

-- 
piuparts git repository



More information about the Piuparts-commits mailing list