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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Feb 22 16:43:37 CET 2010


Revision: 8740
          http://gar.svn.sourceforge.net/gar/?rev=8740&view=rev
Author:   wahwah
Date:     2010-02-22 15:43:36 +0000 (Mon, 22 Feb 2010)

Log Message:
-----------
mGAR v2: checkpkg, delete rows from all the tables.

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

Modified: csw/mgar/gar/v2/lib/python/checkpkg.py
===================================================================
--- csw/mgar/gar/v2/lib/python/checkpkg.py	2010-02-22 15:33:04 UTC (rev 8739)
+++ csw/mgar/gar/v2/lib/python/checkpkg.py	2010-02-22 15:43:36 UTC (rev 8740)
@@ -395,10 +395,11 @@
       except sqlite3.OperationalError, e:
         logging.warn(e)
       logging.info("Deleting all rows from the cache database")
-      sql = "DELETE FROM config;"
-      c.execute(sql)
-      sql = "DELETE FROM systempkgmap;"
-      c.execute(sql)
+      for table in ("config", "systempkgmap", "packages"):
+        try:
+          c.execute("DELETE FROM %s;" % table)
+        except sqlite3.OperationalError, e:
+          logging.warn("sqlite3.OperationalError: %s", e)
 
 def SharedObjectDependencies(pkgname,
                              binaries_by_pkgname,


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