[yum-cvs] yum/yum __init__.py,1.309,1.310 depsolve.py,1.140,1.141

Jeremy Katz katzj at linux.duke.edu
Mon Mar 19 20:21:13 UTC 2007


Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv10977/yum

Modified Files:
	__init__.py depsolve.py 
Log Message:
export the isPackageInstalled method and just use the one from __init__
instead of copies everywhere.  remove the one from the depsolver which
is subtly different (and breaks for the fresh install case)


Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.309
retrieving revision 1.310
diff -u -r1.309 -r1.310
--- __init__.py	19 Mar 2007 10:43:11 -0000	1.309
+++ __init__.py	19 Mar 2007 20:21:11 -0000	1.310
@@ -1444,7 +1444,7 @@
         
         if self.conf.enable_group_conditionals:
             for condreq, cond in thisgroup.conditional_packages.iteritems():
-                if self._isPackageInstalled(cond):
+                if self.isPackageInstalled(cond):
                     try:
                         txmbrs = self.install(name = condreq)
                     except Errors.InstallError:
@@ -1979,9 +1979,7 @@
         
         return returndict
 
-    def _isPackageInstalled(self, pkgname):
-        # FIXME: Taken from anaconda/pirut 
-        # clean up and make public
+    def isPackageInstalled(self, pkgname):
         installed = False
         if self.rpmdb.installed(name = pkgname):
             installed = True
@@ -1995,6 +1993,7 @@
             # 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

Index: depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -r1.140 -r1.141
--- depsolve.py	19 Mar 2007 02:31:11 -0000	1.140
+++ depsolve.py	19 Mar 2007 20:21:11 -0000	1.141
@@ -1029,22 +1029,6 @@
         self.path = []
         self.loops = []
 
-    def isPackageInstalled(self, pkgname):
-        # FIXME: this sucks.  we should probably suck it into yum proper
-        # but it'll need a bit of cleanup first.
-        if not self.rpmdb.installed(name = pkgname):
-            return False
-
-        lst = self.tsInfo.matchNaevr(name = pkgname)
-        for txmbr in lst:
-            if txmbr.output_state in TS_INSTALL_STATES:
-                return True
-        if 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 True
-
     def _provideToPkg(self, req):
         best = None
         (r, f, v) = req




More information about the Yum-cvs-commits mailing list