[yum-cvs] yum/yum depsolve.py,1.118,1.119 packages.py,1.91,1.92
Seth Vidal
skvidal at linux.duke.edu
Thu Feb 15 10:03:26 UTC 2007
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv1493/yum
Modified Files:
depsolve.py packages.py
Log Message:
fix checkRemove and flesh out inPrcoRange() to be fairly complete
Index: depsolve.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/depsolve.py,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- depsolve.py 15 Feb 2007 05:48:34 -0000 1.118
+++ depsolve.py 15 Feb 2007 10:03:24 -0000 1.119
@@ -1261,7 +1261,8 @@
def _checkRemove(self, txmbr):
po = txmbr.po
provs = po.returnPrco('provides')
-
+ #provs.append((po.name, None, (None, None, None)))
+
# get the files in the package and express them as "provides"
files = po.filelist
filesasprovs = map(lambda f: (f, None, None), files)
@@ -1274,11 +1275,13 @@
continue
if prov[0].startswith("/usr/share/doc"): # XXX: ignore doc files
continue
+
self.verbose_logger.log(logginglevels.DEBUG_4, "looking to see what requires %s of %s" %(prov, po))
+
(r, f, v) = prov
removeList = []
- for pkgtup in self.rpmdb.whatRequires(r, None, None):
+ for pkgtup in self.rpmdb.whatRequires(r, f, v):
if pkgtup in removeList or pkgtup in removing:
continue
# check the rpmdb first for something still installed
@@ -1298,7 +1301,7 @@
# if something else provides this name and it's not being
# removed, then we don't need to worry about it
stillavail = False
- for pkgtup in self.rpmdb.whatProvides(r, None, None):
+ for pkgtup in self.rpmdb.whatProvides(r, f, v):
if pkgtup in removing:
continue
txmbrs = self.tsInfo.getMembers(pkgtup)
@@ -1310,9 +1313,11 @@
stillavail = True # it's being installed
break
if stillavail:
- self.verbose_logger.log(logginglevels.DEBUG_1, "more than one package provides %s" %(r,))
+ self.verbose_logger.log(logginglevels.DEBUG_1, "more than one package provides %s" %(r,))
continue
-
+
+ # we have a list of all the items impacted and left w/unresolved deps
+ # by this remove. stick them in the ret list with their
for pkgtup in removeList:
po = self.getInstalledPackageObject(pkgtup)
flags = {"GT": rpm.RPMSENSE_GREATER,
Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -r1.91 -r1.92
--- packages.py 14 Feb 2007 20:41:36 -0000 1.91
+++ packages.py 15 Feb 2007 10:03:24 -0000 1.92
@@ -257,14 +257,24 @@
# we only ever get here if we have a versioned prco
# nameonly shouldn't ever raise it
(reqn, reqf, (reqe, reqv, reqr)) = reqtuple
+ # however, just in case
# find the named entry in pkgobj, do the comparsion
for (n, f, (e, v, r)) in self.returnPrco(prcotype):
if reqn == n:
# found it
+ if f is None:
+ return 1
if f != 'EQ':
# isn't this odd, it's not 'EQ' - it really should be
# use the pkgobj's evr for the comparison
- (e, v, r) = (self.epoch, self.ver, self.rel)
+ if e is None:
+ e = self.epoch
+ if v is None:
+ v = self.ver
+ if r is None:
+ r = self.rel
+
+ #(e, v, r) = (self.epoch, self.ver, self.rel)
# and you thought we were done having fun
# if the requested release is left out then we have
# to remove release from the package prco to make sure the match
@@ -276,17 +286,49 @@
e = None
if reqv is None: # just for the record if ver is None then we're going to segfault
v = None
+
rc = rpmUtils.miscutils.compareEVR((e, v, r), (reqe, reqv, reqr))
+ # does not match unless
if rc >= 1:
if reqf in ['GT', 'GE', 4, 12]:
return 1
+ if reqf in ['EQ', 8]:
+ if f in ['EQ', 'LE', 'GE', 8, 10, 12]:
+ return 1
if rc == 0:
- if reqf in ['GE', 'LE', 'EQ', 8, 10, 12]:
- return 1
+ if reqf in ['GT', 4]:
+ if f in ['GT', 'GE', 4, 12]:
+ return 1
+ if reqf in ['GE', 12]:
+ if f in ['GT', 'GE', 'EQ', 'LE', 4, 12, 8, 10]:
+ return 1
+ if reqf in ['EQ', 8]:
+ if f in ['EQ', 'GE', 'LE', 8, 12, 10]:
+ return 1
+ if reqf in ['LE', 10]:
+ if f in ['EQ', 'LE', 'LT', 'GE', 8, 10, 2, 12]:
+ return 1
+ if reqf in ['LT', 2]:
+ if f in ['LE', 'LT', 10, 2]:
+ return 1
if rc <= -1:
- if reqf in ['LT', 'LE', 2, 10]:
+ if reqf in ['GT', 'GE', 'EQ', 4, 12, 8]:
+ if f in ['GT', 'GE', 4, 12]:
+ return 1
+ if reqf in ['LE', 'LT', 10, 2]:
return 1
+
+
+# if rc >= 1:
+# if reqf in ['GT', 'GE', 4, 12]:
+# return 1
+# if rc == 0:
+# if reqf in ['GE', 'LE', 'EQ', 8, 10, 12]:
+# return 1
+# if rc <= -1:
+# if reqf in ['LT', 'LE', 2, 10]:
+# return 1
return 0
def returnChangelog(self):
More information about the Yum-cvs-commits
mailing list