[yum-cvs] yum/yum __init__.py, 1.196.2.2, 1.196.2.3 sqlitesack.py, 1.29.2.1, 1.29.2.2
Seth Vidal
skvidal at linux.duke.edu
Tue Apr 25 05:59:48 UTC 2006
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv2073/yum
Modified Files:
Tag: yum-2_6_X
__init__.py sqlitesack.py
Log Message:
prune out some of the exact duplicates
Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.196.2.2
retrieving revision 1.196.2.3
diff -u -r1.196.2.2 -r1.196.2.3
--- __init__.py 19 Apr 2006 22:16:16 -0000 1.196.2.2
+++ __init__.py 25 Apr 2006 05:59:46 -0000 1.196.2.3
@@ -1173,9 +1173,14 @@
self.log(4, 'searching the simple way')
pkgs = self.returnPackagesByDep(arg)
for po in pkgs:
+ # if the match is already in the list, just skip it
+ if matches.has_key(po):
+ continue
+
+ matches[po] = [arg]
if callback:
callback(po, [arg])
- matches[po] = [arg]
+
# search pkgSack - fully populate the worthwhile metadata to search
# if it even vaguely matches
@@ -1231,9 +1236,11 @@
tmpvalues.append(prov)
if len(tmpvalues) > 0:
- if callback:
- callback(po, tmpvalues)
- matches[po] = tmpvalues
+ if not matches.has_key(po):
+ matches[po] = tmpvalues
+ if callback:
+ callback(po, tmpvalues)
+
self.doRpmDBSetup()
# installed rpms, too
Index: sqlitesack.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/sqlitesack.py,v
retrieving revision 1.29.2.1
retrieving revision 1.29.2.2
diff -u -r1.29.2.1 -r1.29.2.2
--- sqlitesack.py 19 Apr 2006 22:15:38 -0000 1.29.2.1
+++ sqlitesack.py 25 Apr 2006 05:59:46 -0000 1.29.2.2
@@ -189,7 +189,7 @@
# This should never be called with a name containing a %
assert(name.find('%') == -1)
- result = []
+ result = {}
quotename = name.replace("'","''")
(dirname,filename) = os.path.split(name)
@@ -200,8 +200,11 @@
for ob in cur.fetchall():
if (self.excludes[rep].has_key(ob['pkgId'])):
continue
- pkg = self.getPackageDetails(ob['pkgId'])
- result.append((self.pc(pkg,rep)))
+
+ pkgid = ob['pkgId']
+ if not result.has_key(pkgid):
+ pkg = self.getPackageDetails(ob['pkgId'])
+ result[pkgid] = (self.pc(pkg,rep))
# check filelists/dirlists
for (rep,cache) in self.filelistsdb.items():
@@ -258,10 +261,12 @@
if (not real):
continue
- pkg = self.getPackageDetails(ob['pkgId'])
- result.append((self.pc(pkg,rep)))
+ pkgid = ob['pkgId']
+ if not result.has_key(pkgid):
+ pkg = self.getPackageDetails(ob['pkgId'])
+ result[pkgid] = (self.pc(pkg,rep))
- return result
+ return result.values()
def returnObsoletes(self):
obsoletes = {}
More information about the Yum-cvs-commits
mailing list