[Treepkg-commits] r385 - branches/treepkg-status/bin

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed Jul 28 09:35:55 CEST 2010


Author: bricks
Date: 2010-07-28 09:35:54 +0200 (Wed, 28 Jul 2010)
New Revision: 385

Added:
   branches/treepkg-status/bin/listcachedb.py
Log:
add helper tool to list content of a cache db


Added: branches/treepkg-status/bin/listcachedb.py
===================================================================
--- branches/treepkg-status/bin/listcachedb.py	2010-07-28 07:35:21 UTC (rev 384)
+++ branches/treepkg-status/bin/listcachedb.py	2010-07-28 07:35:54 UTC (rev 385)
@@ -0,0 +1,31 @@
+#! /usr/bin/python
+# Copyright (C) 2010 by Intevation GmbH
+# Authors:
+# Bjoern Ricks    <bjoern.ricks at intevation.de>
+#
+# 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()


Property changes on: branches/treepkg-status/bin/listcachedb.py
___________________________________________________________________
Name: svn:executable
   + *



More information about the Treepkg-commits mailing list