changeset 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 5dd710b167d2
children b3f9cc956acc
files bin/publishpackages.py demopublishpackages.cfg
diffstat 2 files changed, 12 insertions(+), 5 deletions(-) [+]
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)
 
--- a/demopublishpackages.cfg	Fri Mar 06 19:57:04 2009 +0000
+++ b/demopublishpackages.cfg	Mon Mar 09 16:00:44 2009 +0000
@@ -4,6 +4,11 @@
 # adapt it to your needs.
 
 [publishpackages]
+# Distribution (e.g. etch, lenny, ...) and section (e.g. experimental,
+# unstable, ...) for which to publish the packages
+distribution: lenny
+section: experimental
+
 # Username and host on which the treepackager runs.  publishpackages.py
 # has to be able to connect to that host as the builduser via ssh
 # without knowning the password.  This is best achieved with the
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)