diff bin/publishpackages.py @ 249:a3f106580525

Add config settings "distribution" and "section" so that they don't have to be specified when running bin/publishpackages.py most of the time. Add them to demopublishpackages.cfg as well.
author Bernhard Herzog <bh@intevation.de>
date Mon, 09 Mar 2009 16:00:44 +0000
parents 55337021fe5b
children 8052aabada8b
line wrap: on
line diff
--- a/bin/publishpackages.py	Fri Mar 06 19:57:04 2009 +0000
+++ b/bin/publishpackages.py	Mon Mar 09 16:00:44 2009 +0000
@@ -30,7 +30,8 @@
     """
     return os.path.expandvars(os.path.expanduser(filename))
 
-config_desc = ["build_user", "build_host", "build_listpackages",
+config_desc = ["distribution", "section",
+               "build_user", "build_host", "build_listpackages",
                "publish_user", "publish_host", "publish_apt_archive_update",
                ("publish_dir", remove_trailing_slashes),
                ("cachedir",
@@ -113,6 +114,11 @@
 def publish_packages(config_filename, track, revision, dist, section):
     config = read_config(config_filename)
 
+    if dist is None:
+        dist = config["distribution"]
+    if section is None:
+        section = config["section"]
+
     for arch in ["binary-i386", "source"]:
         publish_packages_arch(config, track, revision, dist, section, arch)
 
@@ -123,10 +129,6 @@
 
 def main():
     options, args = parse_commandline()
-    for required_opt in ["dist", "section"]:
-        if getattr(options, required_opt) is None:
-            print >>sys.stderr, "The --%s option must be given" % required_opt
-            sys.exit(1)
     publish_packages(options.config_file, options.track, options.revision,
                      options.dist, options.section)
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)