[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.47-41-ga9fc1b0

Andreas Beckmann debian at abeckmann.de
Fri Nov 30 11:20:39 UTC 2012


The following commit has been merged in the master branch:
commit 39f4fd7b939a22f3244c50dd61c5a78b0524fcb1
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Fri Oct 5 20:55:08 2012 +0200

    p-s: config: split piuparts-cmd into piuparts-{command,flags}
    
    piuparts-command should be a [global] setting and include default flags
      that are to be used for all sections
    piuparts-flags should contain the section specific flags
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/README.txt b/README.txt
index 9bcf8ac..92d6353 100644
--- a/README.txt
+++ b/README.txt
@@ -464,7 +464,9 @@ section, too, and will serve as defaults for all other sections
 
 * "log-file" is the name of a file to where the master should write its log messages. In the default configuration file it is "$SECTION/master.log". To disable logging, set it to "/dev/null".
 
-* "piuparts-cmd" is the command the slave uses to start piuparts. It should include 'sudo' if necessary so that piuparts runs with sufficient priviledges to do its testing (and that means root priviledges).
+* "piuparts-command" is the command the slave uses to start piuparts. It should include 'sudo' if necessary so that piuparts runs with sufficient priviledges to do its testing (and that means root priviledges). This command should be given in the [global] section and include all flags that are common for all sections.
+
+* "piuparts-flags" are appended to "piuparts-command" and should contain the section-specific flags.
 
 * "mirror" tells the slave which mirror it is to use. The slave gives this to piuparts when it runs it. The URLs for Packages and Sources files will be generated from this setting, too. Default (for fetching Packages/Sources): "http://cdn.debian.net/debian".
 
diff --git a/conf/piuparts.conf.sample b/conf/piuparts.conf.sample
index fe9ab83..88aba98 100644
--- a/conf/piuparts.conf.sample
+++ b/conf/piuparts.conf.sample
@@ -18,6 +18,7 @@ master-directory = /var/lib/piuparts/master
 output-directory = /var/lib/piuparts/htdocs
 doc-root = /piuparts/
 master-command = python /usr/share/piuparts/piuparts-master
+piuparts-command = sudo piuparts --scriptsdir /etc/piuparts/scripts --tmpdir /var/tmp
 idle-sleep = 300
 max-tgz-age = 604800
 expire-old-days = 120
@@ -32,7 +33,7 @@ reschedule-fail-count = 25
 [sid]
 precedence = 1
 description = "Debian sid / main"
-piuparts-cmd = sudo piuparts --no-symlinks --scriptsdir /etc/piuparts/scripts/ --tmpdir /var/tmp
+piuparts-flags = --no-symlinks
 # mirror = http://cdn.debian.net/debian
 distro = sid
 # area = main
diff --git a/debian/changelog b/debian/changelog
index edd236f..fe5cacc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,12 +14,17 @@ piuparts (0.48) UNRELEASED; urgency=low
   * piuparts.conf:
     - New per section settings: expire-old-days, expire-fail-days (defaulting
       to 0 which means expiration is disabled).
+    - Split and rename piuparts-cmd into piuparts-command ([global] setting
+      that should include all common flags) and piuparts-flags (for additional
+      section-specific flags).
   * piuparts-master.py:
     - Enable recycling before initializing the real package db.
     - Enable logging by default and set default log-file to
       $SECTION/master.log. Use "/dev/null" to disable logging.
   * piuparts-slave.py:
     - Retry sections with higher precedence more often.
+    - Construct the piuparts command line from the new config options
+      piuparts-command and piuparts-flags.
   * piuparts-report.py:
     - Don't hardcode section names, always show all known_problem reports.
   * detect_piuparts_issues: Catch the chroot running out of space.
diff --git a/piuparts-slave.py b/piuparts-slave.py
index a6e56bd..b3974ef 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -78,7 +78,8 @@ class Config(piupartslib.conf.Config):
                 "master-command": None,
                 "log-file": "piuparts-master.log",
                 "mirror": None,
-                "piuparts-cmd": "sudo piuparts",
+                "piuparts-command": "sudo piuparts",
+                "piuparts-flags": "",
                 "distro": None,
                 "area": None,
                 "chroot-tgz": None,
@@ -650,7 +651,9 @@ def test_package(config, package, packages_files):
     package.dump(output)
     output.write("\n")
 
-    base_command = config["piuparts-cmd"].split()
+    base_command = config["piuparts-command"].split()
+    if config["piuparts-flags"]:
+        base_command.extend(config["piuparts-flags"].split())
     if config["mirror"]:
         base_command.extend(["--mirror", config["mirror"]])
 
@@ -713,7 +716,9 @@ def create_chroot(config, tarball, distro):
     output_name = tarball + ".log"
     logging.debug("Opening log file %s" % output_name)
     logging.info("Creating new tarball %s" % tarball)
-    command = config["piuparts-cmd"].split()
+    command = config["piuparts-command"].split()
+    if config["piuparts-flags"]:
+        command.extend(config["piuparts-flags"].split())
     if config["mirror"]:
         command.extend(["--mirror", config["mirror"]])
     command.extend(["-d", distro])

-- 
piuparts git repository



More information about the Piuparts-commits mailing list