[Treepkg-commits] r124 - trunk/bin

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Aug 20 15:05:58 CEST 2008


Author: bh
Date: 2008-08-20 15:05:57 +0200 (Wed, 20 Aug 2008)
New Revision: 124

Modified:
   trunk/bin/listpackages.py
Log:
listpackages command: if --track is omitted, list files of all tracks.


Modified: trunk/bin/listpackages.py
===================================================================
--- trunk/bin/listpackages.py	2008-08-20 12:59:45 UTC (rev 123)
+++ trunk/bin/listpackages.py	2008-08-20 13:05:57 UTC (rev 124)
@@ -1,5 +1,5 @@
 #! /usr/bin/python2.4
-# Copyright (C) 2007 by Intevation GmbH
+# Copyright (C) 2007, 2008 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh at intevation.de>
 #
@@ -21,7 +21,8 @@
                       help=("The revision whose files are to be listed."
                             " If not given, the latest revision is used"))
     parser.add_option("--track",
-                      help=("The package track whose files are to be listed"))
+                      help=("The package track whose files are to be listed."
+                            " If not given, files of all tracks are listed."))
     parser.add_option("--source", action="store_true",
                       help=("List source packages"))
     parser.add_option("--binary", action="store_true",
@@ -57,13 +58,14 @@
 
 def list_packages(config_file, trackname, revision, source, binary):
     group = get_packager_group(config_file)
-    for track in group.get_package_tracks():
-        if track.name == trackname:
-            list_track_packages(track, revision, source, binary)
-            break
-    else:
-        print >>sys.stderr, "no track named", trackname
-        sys.exit(1)
+    tracks = group.get_package_tracks()
+    if trackname is not None:
+        tracks = [track for track in tracks if track.name == trackname]
+        if not tracks:
+            print >>sys.stderr, "no track named", trackname
+            sys.exit(1)
+    for track in tracks:
+        list_track_packages(track, revision, source, binary)
 
 def main():
     options, args = parse_commandline()



More information about the Treepkg-commits mailing list