changeset 199:24d119c27150

listpackages command: if --track is omitted, list files of all tracks.
author Bernhard Herzog <bh@intevation.de>
date Wed, 20 Aug 2008 13:05:57 +0000
parents edd20598be27
children ce03e24f6d0f
files bin/listpackages.py
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/bin/listpackages.py	Wed Aug 20 12:59:45 2008 +0000
+++ b/bin/listpackages.py	Wed Aug 20 13:05:57 2008 +0000
@@ -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@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()
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)