# HG changeset patch # User Bjoern Ricks # Date 1280302554 0 # Node ID b0179962ce26e73ced0e77287dc7b9e2e02a8246 # Parent a2ba58ffbfbef6a7cc01affcc23780aa457545fe add helper tool to list content of a cache db diff -r a2ba58ffbfbe -r b0179962ce26 bin/listcachedb.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/listcachedb.py Wed Jul 28 07:35:54 2010 +0000 @@ -0,0 +1,31 @@ +#! /usr/bin/python +# Copyright (C) 2010 by Intevation GmbH +# Authors: +# Bjoern Ricks +# +# This program is free software under the GPL (>=v2) +# Read the file COPYING coming with the software for details. + +from optparse import OptionParser + +import treepkgcmd +from treepkg.info.data import CacheDb + +def main(): + parser = OptionParser() + parser.add_option("--db", help=("path to the CacheDb")) + options, args = parser.parse_args() + + cachedb = CacheDb(options.db) + packages = cachedb.get_packages() + for package in packages: + print "=============================" + print "name: %s" % package.name + print "=============================" + print "binary: %s" % package.filename + print "source: %s" % package.sourcepath + print "arch: %s" % package.arch + print "md5sum: %s" % package.md5sum + +if __name__ == "__main__": + main()