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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Jan 17 16:26:18 CET 2011


Revision: 12983
          http://gar.svn.sourceforge.net/gar/?rev=12983&view=rev
Author:   wahwah
Date:     2011-01-17 15:26:17 +0000 (Mon, 17 Jan 2011)

Log Message:
-----------
pkgdb: gen-cat detect missing pkg files

When gen-cat is called and the file in allpkgs doesn't exist, pkgdb throws an
error.

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-01-17 14:38:13 UTC (rev 12982)
+++ csw/mgar/gar/v2/lib/python/pkgdb.py	2011-01-17 15:26:17 UTC (rev 12983)
@@ -84,6 +84,10 @@
   "Error in command line options."
 
 
+class OpencswTreeError(Error):
+  "A problem with the OpenCSW directory tree."
+
+
 class HtmlGenerator(object):
 
   def __init__(self, identifiers, template=None):
@@ -574,6 +578,8 @@
         logging.debug("Existing files: %s", len(existing_files))
         for pkg in pkgs:
           src_path = os.path.join(allpkgs_dir, pkg.basename)
+          if not os.path.exists(src_path):
+            raise OpencswTreeError("File %s does not exist" % repr(src_path))
           # Try to find if the package was already available in previous
           # os releases
           already_existing_in_osrel = None


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