# HG changeset patch # User Bernhard Herzog # Date 1219237557 0 # Node ID 24d119c2715044811105c52385f4932b05996203 # Parent edd20598be27d903a1d6c01b8ef6b8f705b51d7b listpackages command: if --track is omitted, list files of all tracks. diff -r edd20598be27 -r 24d119c27150 bin/listpackages.py --- 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 # @@ -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()