[Rpm-metadata] createrepo/__init__.py

Seth Vidal skvidal at linux.duke.edu
Tue Jan 8 14:45:06 UTC 2008


 createrepo/__init__.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9b53be6b00595ce98450453ddf4978b55e3382a0
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Jan 8 09:43:28 2008 -0500

    try except on package opening

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 7f30d91..8bb037a 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -210,10 +210,12 @@ class MetaDataGenerator:
         
 
     def read_in_package(self, directory, rpmfile):
-        # XXX fixme try/excepts here
         # directory is stupid - just make it part of the class
         rpmfile = '%s/%s/%s' % (self.conf.basedir, directory, rpmfile)
-        po = yumbased.CreateRepoPackage(self.ts, rpmfile)
+        try:
+            po = yumbased.CreateRepoPackage(self.ts, rpmfile)
+        except yum.Errors.MiscError, e:
+            raise MDError, "Unable to open package: %s" % e
         return po
 
     def writeMetadataDocs(self, pkglist, directory, current=0):



More information about the Rpm-metadata mailing list