[Rpm-metadata] createrepo/__init__.py

Seth Vidal skvidal at linux.duke.edu
Tue Jan 8 15:16:20 UTC 2008


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

New commits:
commit 6f0cd1cce81707fef698a176b91084514213a33d
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Jan 8 10:14:43 2008 -0500

    make it a more proper ts

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 8bb037a..c9c854e 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -10,7 +10,8 @@ import yumbased
 from optparse import OptionContainer
 
 
-from yum import misc
+from yum import misc, Errors
+import rpmUtils.transaction
 from utils import _, errorprint
 import readMetadata
 
@@ -72,7 +73,7 @@ class MetaDataGenerator:
         if config_obj == None:
             self.conf = MetaDataConfig()
             
-        self.ts = rpm.TransactionSet()
+        self.ts = rpmUtils.transaction.initReadOnlyTransaction()
         self.pkgcount = 0
         self.files = []
 
@@ -214,7 +215,7 @@ class MetaDataGenerator:
         rpmfile = '%s/%s/%s' % (self.conf.basedir, directory, rpmfile)
         try:
             po = yumbased.CreateRepoPackage(self.ts, rpmfile)
-        except yum.Errors.MiscError, e:
+        except Errors.MiscError, e:
             raise MDError, "Unable to open package: %s" % e
         return po
 



More information about the Rpm-metadata mailing list