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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Feb 16 17:35:37 CET 2011


Revision: 13338
          http://gar.svn.sourceforge.net/gar/?rev=13338&view=rev
Author:   wahwah
Date:     2011-02-16 16:35:36 +0000 (Wed, 16 Feb 2011)

Log Message:
-----------
pkgdb: Don't die on a pkg insert problem

When insertion of a package into a catalog errors out, don't die, but catch
the exception and log it.

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-16 16:35:03 UTC (rev 13337)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py	2011-02-16 16:35:36 UTC (rev 13338)
@@ -298,9 +298,15 @@
               sqo_srv4.basename)
           stats = sqo_srv4.GetStatsStruct()
           package_stats.PackageStats.ImportPkg(stats, True)
-        db_catalog.AddSrv4ToCatalog(
-            sqo_srv4, osrel, arch, catrel)
+        try:
+          db_catalog.AddSrv4ToCatalog(
+              sqo_srv4, osrel, arch, catrel)
+        except checkpkg_lib.CatalogDatabaseError, e:
+          logging.warning(
+              "Could not insert %s (%s) into the database. %s",
+              sqo_srv4.basename, sqo_srv4.md5_sum, e)
 
+
   def SyncFromCatalogTree(self, catrel, base_dir, force_unpack=False):
     logging.debug("SyncFromCatalogTree(%s, %s, force_unpack=%s)",
                   repr(catrel), repr(base_dir), force_unpack)


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