changeset 578:bccd69dedbe5

shlex.split all config parameters that may contain a command Return the command as list and use @ operator for the variable in cmdexpand
author Bjoern Ricks <bricks@intevation.de>
date Sat, 03 Sep 2011 11:53:12 +0000
parents 7a9841e4958f
children 97a5e09c84dc
files bin/publishdebianpackages.py bin/publishpackages.py bin/publishstaticweb.py
diffstat 3 files changed, 10 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/bin/publishdebianpackages.py	Sat Sep 03 11:48:00 2011 +0000
+++ b/bin/publishdebianpackages.py	Sat Sep 03 11:53:12 2011 +0000
@@ -29,7 +29,8 @@
 from treepkg.info.data import CacheDb
 
 config_desc = ["distribution", "section", "num_newest",
-               "build_user", "build_host", "build_listpackages",
+               "build_user", "build_host",
+               ("build_listpackages", shlex.split),
                "publish_user", "publish_host", 
                ("architectures", shlex.split, "armel i386 source"),
                ("after_upload_hook", shlex.split, ""),
@@ -76,7 +77,7 @@
 def get_treepkg_info(variables):
     runremote = prefix_for_remote_command(variables["build_user"],
                                           variables["build_host"])
-    xml = capture_stdout(cmdexpand("@runremote $build_listpackages"
+    xml = capture_stdout(cmdexpand("@runremote @build_listpackages"
                                    " --newest=$num_newest"
                                    " --only-successful",
                                    runremote=runremote,
--- a/bin/publishpackages.py	Sat Sep 03 11:48:00 2011 +0000
+++ b/bin/publishpackages.py	Sat Sep 03 11:53:12 2011 +0000
@@ -24,7 +24,8 @@
 from treepkg.publish import prefix_for_remote_command, copy_to_publishdir
 
 config_desc = ["distribution", "section", "num_newest",
-               "build_user", "build_host", "build_listpackages",
+               "build_user", "build_host",
+               ("build_listpackages", shlex.split),
                "publish_user", "publish_host",
                ("after_upload_hook", shlex.split),
                ("publish_remove_old_packages", convert_bool),
@@ -86,7 +87,7 @@
 
     runremote = prefix_for_remote_command(variables["build_user"],
                                           variables["build_host"])
-    files = capture_output(cmdexpand("@runremote $build_listpackages"
+    files = capture_output(cmdexpand("@runremote @build_listpackages"
                                      " @track @revision $pkgtype"
                                      " --newest=$num_newest",
                                      runremote=runremote,
--- a/bin/publishstaticweb.py	Sat Sep 03 11:48:00 2011 +0000
+++ b/bin/publishstaticweb.py	Sat Sep 03 11:53:12 2011 +0000
@@ -9,6 +9,7 @@
 """Publishes a static web-site with a status report"""
 
 import sys
+import shlex
 import os
 from optparse import OptionParser
 from ConfigParser import SafeConfigParser
@@ -28,7 +29,8 @@
     """
     return os.path.expandvars(os.path.expanduser(filename))
 
-staticweb_desc = ["build_user", "build_host", "build_create", "build_template",
+staticweb_desc = ["build_user", "build_host",
+                  ("build_create", shlex.split), "build_template",
                   "build_logs",
                   ("build_dir", remove_trailing_slashes),
                   "publish_user", "publish_host",
@@ -64,7 +66,7 @@
     config = read_config(config_filename)
 
     # create web-page on build host
-    call(cmdexpand("ssh $build_user$@$build_host $build_create"
+    call(cmdexpand("ssh $build_user$@$build_host @build_create"
                    " --show-logs=$build_logs"
                    " --status-template=$build_template $build_dir",
                    **config))
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)