[Piuparts-commits] rev 86 - / people/jsw/multi-arch-master people/jsw/multi-arch-master/piupartslib

John Wright jsw-guest at alioth.debian.org
Wed Sep 5 00:27:04 UTC 2007


Author: jsw-guest
Date: 2007-09-05 00:27:04 +0000 (Wed, 05 Sep 2007)
New Revision: 86

Modified:
   /
   people/jsw/multi-arch-master/piuparts-master.py
   people/jsw/multi-arch-master/piuparts-slave.py
   people/jsw/multi-arch-master/piupartslib/packagesdb.py
Log:
 r77 at neptune:  jswright | 2007-08-29 22:55:05 -0600
 piuparts-master.py:
  * Allow multiple sections in the config file for different architecture/dist
    combinations.  For example. you could have a [sid-amd64] section that had a
    packages-url key for sid on amd64, and a separate section for [etch-ia64].
    Test logs are stored in a subdirectory corresponding to the section name.
  * If an argument is given on the command-line, it is taken as the section in
    the config file to use.  If no argument is given, it defaults to "master"
    for backwards compatibility.
 piupartslib/packagesdb.py:
  * The PackagesDB initializer now takes an optional prefix argument, to
    facilitate keeping the test logs for each section separate
 piuparts-slave.py:
  * New configuration options:
    - master-section: specify which section in the master config file to use
      (doesn't do anything yet...)
    - keep-sources-list: pass the --keep-sources-list option to piuparts
 
 Things are still a bit broken, but here's a start...
 



Property changes on: 
___________________________________________________________________
Name: svk:merge
   - b12c1668-1bd8-44a9-a1e9-87753b0bf707:/local/piuparts:76
   + b12c1668-1bd8-44a9-a1e9-87753b0bf707:/local/piuparts:77

Modified: people/jsw/multi-arch-master/piuparts-master.py
===================================================================
--- people/jsw/multi-arch-master/piuparts-master.py	2007-09-05 00:27:00 UTC (rev 85)
+++ people/jsw/multi-arch-master/piuparts-master.py	2007-09-05 00:27:04 UTC (rev 86)
@@ -48,8 +48,8 @@
 
 class Config(piupartslib.conf.Config):
 
-    def __init__(self):
-        piupartslib.conf.Config.__init__(self, "master",
+    def __init__(self, section="master"):
+        piupartslib.conf.Config.__init__(self, section,
             {
                 "log-file": None,
                 "packages-url": None,
@@ -104,7 +104,7 @@
 
 class Master(Protocol):
 
-    def __init__(self, input, output, packages_file):
+    def __init__(self, input, output, packages_file, section=None):
         Protocol.__init__(self, input, output)
         self._commands = {
             "reserve": self._reserve,
@@ -113,7 +113,7 @@
             "fail": self._fail,
             "untestable": self._untestable,
         }
-        self._db = piupartslib.packagesdb.PackagesDB()
+        self._db = piupartslib.packagesdb.PackagesDB(prefix=section)
         self._db.create_subdirs()
         self._db.read_packages_file(packages_file)
         self._writeline("hello")
@@ -170,7 +170,14 @@
 
 
 def main():
-    config = Config()
+    # For supporting multiple architectures and suites, we take a command-line
+    # argument referring to a section in the master configuration file.  For
+    # backwards compatibility, if no argument is given, the "master" section is
+    # assumed.
+    if len(sys.argv) == 2:
+        config = Config(section=sys.argv[1])
+    else:
+        config = Config()
     config.read(CONFIG_FILE)
     
     setup_logging(logging.DEBUG, config["log-file"])

Modified: people/jsw/multi-arch-master/piuparts-slave.py
===================================================================
--- people/jsw/multi-arch-master/piuparts-slave.py	2007-09-05 00:27:00 UTC (rev 85)
+++ people/jsw/multi-arch-master/piuparts-slave.py	2007-09-05 00:27:04 UTC (rev 86)
@@ -64,6 +64,7 @@
                 "master-user": None,
                 "master-directory": ".",
                 "master-command": None,
+                "master-section": None,
                 "mirror": None,
                 "piuparts-cmd": "python piuparts.py",
                 "distro": "sid",
@@ -72,6 +73,7 @@
                 "upgrade-test-chroot-tgz": None,
                 "max-reserved": "1",
                 "debug": "no",
+                "keep-sources-list": "no",
             },
             ["master-host", "master-user", "master-command"])
 
@@ -236,6 +238,8 @@
     
     command = "%(piuparts-cmd)s -ad %(distro)s -b %(chroot-tgz)s " % \
                 config
+    if config["keep-sources-list"] in ["yes", "true"]:
+        command += "--keep-sources-list "
     command += package["Package"]
     
     logging.debug("Executing: %s" % command)

Modified: people/jsw/multi-arch-master/piupartslib/packagesdb.py
===================================================================
--- people/jsw/multi-arch-master/piupartslib/packagesdb.py	2007-09-05 00:27:00 UTC (rev 85)
+++ people/jsw/multi-arch-master/piupartslib/packagesdb.py	2007-09-05 00:27:04 UTC (rev 86)
@@ -212,7 +212,8 @@
         "dependency-fix-not-yet-tested": "dependency-fix-not-yet-tested",
     }
 
-    def __init__(self, logdb=None):
+    def __init__(self, logdb=None, prefix=None):
+        self.prefix = prefix
         self._packages_files = []
         self._ready_for_testing = None
         self._logdb = logdb or LogDB()
@@ -225,18 +226,24 @@
         
     def set_subdirs(self, ok=None, fail=None, evil=None, reserved=None,
                     moreok=None, morefail=None):
+        # Prefix all the subdirs with the prefix
+        if self.prefix:
+            format = self.prefix + "/%s"
+        else:
+            format = "%s"
+
         if ok:
-            self._ok = ok
+            self._ok = format % ok
         if fail:
-            self._fail = fail
+            self._fail = format % fail
         if evil:
-            self._evil = evil
+            self._evil = format % evil
         if reserved:
-            self._reserved = reserved
+            self._reserved = format % reserved
         if moreok:
-            self._moreok = moreok
+            self._moreok = format % moreok
         if morefail:
-            self._morefail = morefail
+            self._morefail = format % morefail
         self._all = [self._ok, self._fail, self._evil, self._reserved] + \
                     self._moreok + self._morefail
            




More information about the Piuparts-commits mailing list