createrepo/__init__.py

[email protected] (Seth Vidal)
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
 createrepo/__init__.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 9b53be6b00595ce98450453ddf4978b55e3382a0
Author: Seth Vidal <[email protected]>
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):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.