[csw-devel] SF.net SVN: gar:[12039] csw/mgar/gar/v2/lib/python/pkgdb.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Dec 20 13:00:15 CET 2010


Revision: 12039
          http://gar.svn.sourceforge.net/gar/?rev=12039&view=rev
Author:   wahwah
Date:     2010-12-20 12:00:15 +0000 (Mon, 20 Dec 2010)

Log Message:
-----------
pkgdb: Add replace support in importpkg

When calling importpkg, allow to replace packages in the database with updated
data.  Useful when database contents can be refreshed using pickled version of
package data.  Quicker than unpacking all the packages.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/pkgdb.py

Modified: csw/mgar/gar/v2/lib/python/pkgdb.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgdb.py	2010-12-20 11:59:44 UTC (rev 12038)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py	2010-12-20 12:00:15 UTC (rev 12039)
@@ -307,6 +307,9 @@
   parser.add_option("-c", "--catalog-release", dest="catrel",
                     default="current",
                     help="E.g. current, unstable, testing, stable")
+  parser.add_option("--replace", dest="replace",
+                    default=False, action="store_true",
+                    help="Replace packages when importing (importpkg)")
   options, args = parser.parse_args()
   if options.debug:
     logging.basicConfig(level=logging.DEBUG)
@@ -367,7 +370,7 @@
           "Importing %s, %s",
           stats["basic_stats"]["md5_sum"],
           stats["basic_stats"]["pkg_basename"])
-      package_stats.PackageStats.ImportPkg(stats)
+      package_stats.PackageStats.ImportPkg(stats, options.replace)
   elif command == 'add-to-cat':
     if len(args) <= 3:
       raise UsageError("Not enough arguments, see usage.")


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list