createrepo/__init__.py

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

New commits:
commit 6f0cd1cce81707fef698a176b91084514213a33d
Author: Seth Vidal <[email protected]>
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
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.