[Treepkg-commits] r175 - in trunk: . bin

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Mar 9 17:00:45 CET 2009


Author: bh
Date: 2009-03-09 17:00:44 +0100 (Mon, 09 Mar 2009)
New Revision: 175

Modified:
   trunk/bin/publishpackages.py
   trunk/demopublishpackages.cfg
Log:
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.


Modified: trunk/bin/publishpackages.py
===================================================================
--- trunk/bin/publishpackages.py	2009-03-06 19:57:04 UTC (rev 174)
+++ trunk/bin/publishpackages.py	2009-03-09 16:00:44 UTC (rev 175)
@@ -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)
 

Modified: trunk/demopublishpackages.cfg
===================================================================
--- trunk/demopublishpackages.cfg	2009-03-06 19:57:04 UTC (rev 174)
+++ trunk/demopublishpackages.cfg	2009-03-09 16:00:44 UTC (rev 175)
@@ -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



More information about the Treepkg-commits mailing list