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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Feb 10 19:00:06 CET 2011


Revision: 13246
          http://gar.svn.sourceforge.net/gar/?rev=13246&view=rev
Author:   wahwah
Date:     2011-02-10 18:00:06 +0000 (Thu, 10 Feb 2011)

Log Message:
-----------
pkgdb: A bugfix for pkgdb initdb

If the intention is to initialize the database, don't call the automanage
function.  One of the things that AutoManage does, is throwing an error if the
database does not have the right schema; if we call initdb, it's for exactly
this reason, that the schema needs to be initialized.

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	2011-02-10 13:02:53 UTC (rev 13245)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py	2011-02-10 18:00:06 UTC (rev 13246)
@@ -387,7 +387,10 @@
   md5_sums = args
 
   dm = database.DatabaseManager()
-  dm.AutoManage()
+  # Automanage is not what we want to do, if the intention is to initialize
+  # the database.
+  if command != 'initdb':
+    dm.AutoManage()
 
   if (command, subcommand) == ('show', 'errors'):
     for md5_sum in md5_sums:


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