Mercurial > treepkg
view bin/listpackages.py @ 159:3f2ec4314855
Changed matching string enterprise->enterprise35, so it matches
again the version strings in all three files, necessary
since kdesvn r816025 | pradeepto | 2008-06-03 06:45:13 +0200 (Di, 03 Jun 2008)Cosmetics.
author | Bernhard Reiter <bernhard@intevation.de> |
---|---|
date | Thu, 19 Jun 2008 10:13:39 +0000 |
parents | 3caf4a5ecbf0 |
children | 24d119c27150 |
line wrap: on
line source
#! /usr/bin/python2.4 # Copyright (C) 2007 by Intevation GmbH # Authors: # Bernhard Herzog <bh@intevation.de> # # This program is free software under the GPL (>=v2) # Read the file COPYING coming with the software for details. """List the absolute filenames of packages created by treepkg""" import sys import treepkgcmd from treepkg.options import create_parser from treepkg.report import get_packager_group def parse_commandline(): parser = create_parser() parser.set_defaults(binary=False, source=False) parser.add_option("--revision", type="int", 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")) parser.add_option("--source", action="store_true", help=("List source packages")) parser.add_option("--binary", action="store_true", help=("List binary packages")) return parser.parse_args() def list_track_packages(track, revision, source, binary): revisions = track.get_revisions() if not revisions: print >>sys.stderr, "No revisions have been packaged" sys.exit(1) if revision is None: revpkg = revisions[-1] else: for revpkg in revisions: if revpkg.revision == revision: break else: revpkg = None if revpkg is not None: if source: for filename in revpkg.list_source_files(): print filename if binary: for filename in revpkg.list_binary_files(): print filename else: print >>sys.stderr, "No revision", repr(revision) sys.exit(1) 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) def main(): options, args = parse_commandline() list_packages(options.config_file, options.track, options.revision, source=options.source, binary=options.binary) main()