[yum-cvs] yum/rpmUtils __init__.py,1.21.2.2,1.21.2.3
Seth Vidal
skvidal at login.linux.duke.edu
Mon Jun 20 04:18:49 UTC 2005
Update of /home/groups/yum/cvs/yum/rpmUtils
In directory login:/tmp/cvs-serv28466/rpmUtils
Modified Files:
Tag: yum-2_2_X
__init__.py
Log Message:
make the header-by-index check work properly for older rpm versions
Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/rpmUtils/__init__.py,v
retrieving revision 1.21.2.2
retrieving revision 1.21.2.3
diff -u -r1.21.2.2 -r1.21.2.3
--- __init__.py 20 Jun 2005 00:26:41 -0000 1.21.2.2
+++ __init__.py 20 Jun 2005 04:18:47 -0000 1.21.2.3
@@ -61,15 +61,18 @@
self.match_on_index = 1
try:
- mi = self.ts.dbMatch(0, 1)
+ # we need the find a known index so we can test if
+ # rpm/rpm-python allows us to grab packages by db index.
+ mi = self.ts.dbMatch()
hdr = mi.next()
- except TypeError, e:
+ known_index = mi.instance()
+ mi = self.ts.dbMatch(0, known_index)
+ hdr = mi.next()
+ except (TypeError, StopIteration), e:
self.match_on_index = 0
- except StopIteration, e:
- pass
else:
self.match_on_index = 1
-
+
self.indexdict = {}
mi = self.ts.dbMatch()
More information about the Yum-cvs-commits
mailing list