[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.42-59-gc28b2f1

Andreas Beckmann debian at abeckmann.de
Sat Mar 10 09:08:55 UTC 2012


The following commit has been merged in the develop branch:
commit c28b2f1278fa1d0dea02fb061d9c11d5bdacfe9a
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Mon Mar 5 17:57:37 2012 +0100

    simplify and reindent
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/piuparts-slave.py b/piuparts-slave.py
index 770020d..75b6f76 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -371,41 +371,40 @@ class Section:
             if os.path.exists("idle.stamp"):
                 os.unlink("idle.stamp")
 
-        test_count = 0
-        if self._slave.get_reserved():
-            self._check_tarball()
-            packages_files = {}
-            if self._config["distro"]:
-                distros = [self._config["distro"]]
-            else:
-                distros = []
+        if self._config["distro"]:
+            distros = [self._config["distro"]]
+        else:
+            distros = []
 
-            if self._config["upgrade-test-distros"]:
-                distros += self._config["upgrade-test-distros"].split()
+        if self._config["upgrade-test-distros"]:
+            distros += self._config["upgrade-test-distros"].split()
 
-            for distro in distros:
-                if distro not in packages_files:
-                    packages_files[distro] = fetch_packages_file(self._config, distro)
-            if self._config["distro"]:
-              packages_file = packages_files[self._config["distro"]]
-            else:
-              packages_file = packages_files[distro]
-
-            for package_name, version in self._slave.get_reserved():
-                test_count += 1
-                if package_name in packages_file:
-                    package = packages_file[package_name]
-                    if version == package["Version"] or self._config["upgrade-test-distros"]:
-                        test_package(self._config, package, packages_files)
-                    else:
-                        create_file(os.path.join("untestable", 
-                                    log_name(package_name, version)),
-                                    "%s %s not found" % (package_name, version))
+        packages_files = {}
+        for distro in distros:
+            if distro not in packages_files:
+                packages_files[distro] = fetch_packages_file(self._config, distro)
+        if self._config["distro"]:
+            packages_file = packages_files[self._config["distro"]]
+        else:
+            packages_file = packages_files[distro]
+
+        test_count = 0
+        self._check_tarball()
+        for package_name, version in self._slave.get_reserved():
+            test_count += 1
+            if package_name in packages_file:
+                package = packages_file[package_name]
+                if version == package["Version"] or self._config["upgrade-test-distros"]:
+                    test_package(self._config, package, packages_files)
                 else:
                     create_file(os.path.join("untestable", 
                                 log_name(package_name, version)),
-                                "Package %s not found" % package_name)
-                self._slave.forget_reserved(package_name, version)
+                                "%s %s not found" % (package_name, version))
+            else:
+                create_file(os.path.join("untestable",
+                            log_name(package_name, version)),
+                            "Package %s not found" % package_name)
+            self._slave.forget_reserved(package_name, version)
         return test_count
 
 

-- 
piuparts git repository



More information about the Piuparts-commits mailing list