[yum-cvs] yum/yum __init__.py,1.330,1.331 depsolve.py,1.166,1.167
James Bowes
jbowes at linux.duke.edu
Thu Jun 7 22:53:27 UTC 2007
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv29048/yum
Modified Files:
__init__.py depsolve.py
Log Message:
Add unit tests for the depsolver
Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.330
retrieving revision 1.331
diff -u -r1.330 -r1.331
--- __init__.py 5 Jun 2007 19:49:37 -0000 1.330
+++ __init__.py 7 Jun 2007 22:53:24 -0000 1.331
@@ -2018,22 +2018,6 @@
return returndict
- def isPackageInstalled(self, pkgname):
- installed = False
- if self.rpmdb.installed(name = pkgname):
- installed = True
-
- lst = self.tsInfo.matchNaevr(name = pkgname)
- for txmbr in lst:
- if txmbr.output_state in TS_INSTALL_STATES:
- return True
- if installed and len(lst) > 0:
- # if we get here, then it was installed, but it's in the tsInfo
- # for an erase or obsoleted --> not going to be installed at end
- return False
- return installed
- _isPackageInstalled = isPackageInstalled
-
def getKeyForPackage(self, po, askcb = None, fullaskcb = None):
"""Retrieve a key for a package. If needed, prompt for if the
key should be imported using askcb.
Index: depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.166
retrieving revision 1.167
diff -u -r1.166 -r1.167
--- depsolve.py 5 Jun 2007 15:27:20 -0000 1.166
+++ depsolve.py 7 Jun 2007 22:53:24 -0000 1.167
@@ -1171,7 +1171,24 @@
removeList.append(instpo)
self._removing.append(instpo.pkgtup)
return removeList
-
+
+ def isPackageInstalled(self, pkgname):
+ installed = False
+ if self.rpmdb.installed(name = pkgname):
+ installed = True
+
+ lst = self.tsInfo.matchNaevr(name = pkgname)
+ for txmbr in lst:
+ if txmbr.output_state in TS_INSTALL_STATES:
+ return True
+ if installed and len(lst) > 0:
+ # if we get here, then it was installed, but it's in the tsInfo
+ # for an erase or obsoleted --> not going to be installed at end
+ return False
+ return installed
+ _isPackageInstalled = isPackageInstalled
+
+
class DepCheck(object):
"""object that YumDepsolver uses to see what things are needed to close
the transaction set. attributes: requires, conflicts are a list of
More information about the Yum-cvs-commits
mailing list