Hi,

I've updated the patch for the current svn trunk.
As I have no running master/slave setup this is untested
from my side. It should probably be tested because piuparts-slave
changed a lot internally since the previous patch was created (as it
seems to me) unless you can tell from the review that everything is fine
;-)

Updated patch attached.

Best Regards,
Patrick
Index: piuparts-slave.py
===================================================================
--- piuparts-slave.py	(Revision 550)
+++ piuparts-slave.py	(Arbeitskopie)
@@ -1,6 +1,3 @@
-#!/usr/bin/python
-#
-# Copyright 2005 Lars Wirzenius (l...@iki.fi)
 # 
 # This program is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -235,8 +232,8 @@
         if not os.path.exists(self._config["chroot-tgz"]):
             create_chroot(self._config, self._config["chroot-tgz"], self._config["distro"])
     
-        if (self._config["upgrade-test-distros"] and not
-            os.path.exists(self._config["upgrade-test-chroot-tgz"])):
+        if (self._config["upgrade-test-distros"] and self._config["upgrade-test-chroot-tgz"]
+            and not os.path.exists(self._config["upgrade-test-chroot-tgz"])):
             create_chroot(self._config, self._config["upgrade-test-chroot-tgz"], 
                         self._config["upgrade-test-distros"].split()[0])
     
@@ -286,7 +283,11 @@
             time.sleep(int(self._idle_sleep))
         else:
             packages_files = {}
-            distros = [self._config["distro"]] + self._config["upgrade-test-distros"].split()
+            if self._config["upgrade-test-distros"]:
+                distros = [self._config["distro"]] + self._config["upgrade-test-distros"].split()
+            else:
+                distros = [config["distro"]]
+
             for distro in distros:
                 if distro not in packages_files:
                     packages_files[distro] = fetch_packages_file(self._config, distro)
@@ -314,14 +315,17 @@
 
 
 def upgrade_testable(config, package, packages_files):
-    distros = config["upgrade-test-distros"].split()
-    if not distros:
-        return False
-    for distro in distros:
-        if not package["Package"] in packages_files[distro]:
+    if config["upgrade-test-distros"]:
+        distros = config["upgrade-test-distros"].split()
+        if not distros:
             return False
-    return True
 
+        for distro in distros:
+            if not package["Package"] in packages_files[distro]:
+                return False
+        return True
+    else:
+        return False
 
 def test_package(config, package, packages_files):
     logging.info("Testing package %s/%s %s" % (config.section, package["Package"], package["Version"]))

Reply via email to