[yum-cvs] yum/yum __init__.py, 1.245, 1.246 misc.py, 1.17, 1.18 packages.py, 1.64, 1.65
Seth Vidal
skvidal at linux.duke.edu
Fri Sep 8 13:32:54 UTC 2006
Update of /home/groups/yum/cvs/yum/yum
In directory login1.linux.duke.edu:/tmp/cvs-serv15406/yum
Modified Files:
__init__.py misc.py packages.py
Log Message:
- fix up findDeps interface - it now takes a list of package objects
- clean up a deprecation in deplistoutput
- remove RpmBase._prcoTuple2Printable() since it was no longer needed and
only introduced in this devel series.
Index: __init__.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/__init__.py,v
retrieving revision 1.245
retrieving revision 1.246
diff -u -r1.245 -r1.246
--- __init__.py 6 Sep 2006 04:17:15 -0000 1.245
+++ __init__.py 8 Sep 2006 13:32:51 -0000 1.246
@@ -1090,27 +1090,18 @@
return restring
def findDeps(self, pkgs):
- """Return the dependencies for a given package, as well
+ """Return the dependencies for a given package object list, as well
possible solutions for those dependencies.
- Returns the deps as a dict of:
+ Returns the deps as a dict of dicts:
packageobject = [reqs] = [list of satisfying pkgs]"""
results = {}
self.doRepoSetup()
- self.doRpmDBSetup()
-
- avail = self.pkgSack.returnPackages()
- exactmatch, matched, unmatched = parsePackages(avail, pkgs)
- if len(unmatched) > 0:
- self.logger.critical('No Match for arguments: %s', unmatched)
-
- pkgs = misc.unique(exactmatch + matched)
-
for pkg in pkgs:
results[pkg] = {}
- reqs = pkg.returnPrco('requires');
+ reqs = pkg.requires
reqs.sort()
pkgresults = results[pkg] # shorthand so we don't have to do the
# double bracket thing
Index: misc.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/misc.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- misc.py 3 Sep 2006 09:24:40 -0000 1.17
+++ misc.py 8 Sep 2006 13:32:51 -0000 1.18
@@ -306,3 +306,21 @@
elif pkg == newest:
ret.append(pkg)
return ret
+
+def prco_tuple_to_string(prcoTuple):
+ """returns a text string of the prco from the tuple format"""
+
+ (name, flag, (e, v, r)) = prcoTuple
+ flags = {'GT':'>', 'GE':'>=', 'EQ':'=', 'LT':'<', 'LE':'<='}
+ if flag is None:
+ return name
+
+ base = '%s %s ' % (name, flags[flag])
+ if e not in [0, '0', None]:
+ base += '%s:' % e
+ if v is not None:
+ base += '%s' % v
+ if r is not None:
+ base += '-%s' % r
+
+ return base
Index: packages.py
===================================================================
RCS file: /home/groups/yum/cvs/yum/yum/packages.py,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- packages.py 2 Sep 2006 22:58:55 -0000 1.64
+++ packages.py 8 Sep 2006 13:32:52 -0000 1.65
@@ -229,7 +229,7 @@
if printable:
results = []
for prco in prcos:
- results.append(self._prcoTuple2Printable(prco))
+ results.append(misc.prco_tuple_to_string(prco))
return results
return prcos
@@ -325,26 +325,6 @@
DeprecationWarning, stacklevel=2)
return self.provides_names
- def _prcoTuple2Printable(self, prcoTuple):
- """convert the prco tuples into a nicer human string"""
- # maybe move this into yum.misc to clean it out of here
- # and make it callable from elsewhere
- (name, flag, (e, v, r)) = prcoTuple
- flags = {'GT':'>', 'GE':'>=', 'EQ':'=', 'LT':'<', 'LE':'<='}
- if flag is None:
- return name
-
- base = '%s %s ' % (name, flags[flag])
- if e not in [0, '0', None]:
- base += '%s:' % e
- if v is not None:
- base += '%s' % v
- if r is not None:
- base += '-%s' % r
-
- return base
-
-
filelist = property(fget=lambda self: self.returnFileEntries(ftype='file'))
dirlist = property(fget=lambda self: self.returnFileEntries(ftype='dir'))
ghostlist = property(fget=lambda self: self.returnFileEntries(ftype='ghost'))
@@ -457,7 +437,7 @@
"""convert the prco tuples into a nicer human string"""
warnings.warn('prcoPrintable() will go away in a future version of Yum.\n',
DeprecationWarning, stacklevel=2)
- return self._prcoTuple2Printable(prcoTuple)
+ return misc.prco_tuple_to_string(prcoTuple)
def requiresList(self):
"""return a list of requires in normal rpm format"""
More information about the Yum-cvs-commits
mailing list