[yum-cvs] yum/yum rpmsack.py,1.43,1.44
James Bowes
jbowes at linux.duke.edu
Sun Apr 8 20:40:20 UTC 2007
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv13042/yum
Modified Files:
rpmsack.py
Log Message:
Revert my previous read-only ts patch
Index: rpmsack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/rpmsack.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- rpmsack.py 8 Apr 2007 16:32:54 -0000 1.43
+++ rpmsack.py 8 Apr 2007 20:40:18 -0000 1.44
@@ -47,7 +47,7 @@
def __init__(self, root='/'):
self.root = root
self._header_dict = {}
- self.ts = initReadOnlyTransaction(root=self.root)
+ self.ts = None
def _get_pkglist(self):
'''Getter for the pkglist property.
@@ -61,6 +61,8 @@
pkglist = property(_get_pkglist, None)
def readOnlyTS(self):
+ if not self.ts:
+ self.ts = initReadOnlyTransaction(root=self.root)
return self.ts
def buildIndexes(self):
@@ -76,7 +78,7 @@
pass
def searchAll(self, name, query_type='like'):
- ts = self.ts
+ ts = self.readOnlyTS()
result = {}
# check provides
@@ -98,7 +100,7 @@
def searchFiles(self, name):
"""search the filelists in the rpms for anything matching name"""
- ts = self.ts
+ ts = self.readOnlyTS()
result = {}
mi = ts.dbMatch('basenames', name)
@@ -113,7 +115,7 @@
def searchPrco(self, name, prcotype):
- ts = self.ts
+ ts = self.readOnlyTS()
result = {}
tag = self.DEP_TABLE[prcotype][0]
mi = ts.dbMatch(tag, name)
@@ -208,7 +210,7 @@
def _all_packages(self):
'''Generator that yield (header, index) for all packages
'''
- ts = self.ts
+ ts = self.readOnlyTS()
mi = ts.dbMatch()
for hdr in mi:
@@ -221,7 +223,7 @@
warnings.warn('_header_from_index() will go away in a future version of Yum.\n',
Errors.YumFutureDeprecationWarning, stacklevel=2)
- ts = self.ts
+ ts = self.readOnlyTS()
try:
mi = ts.dbMatch(0, idx)
except (TypeError, StopIteration), e:
More information about the Yum-cvs-commits
mailing list