[Yum-devel] [PATCH 2/2] add a provides_for method to package objects
Seth Vidal
skvidal at fedoraproject.org
Thu Apr 8 15:30:33 UTC 2010
so we can check if this package satisfies the specific requirement
completely (including file deps).
---
yum/packages.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
diff --git a/yum/packages.py b/yum/packages.py
index 33cbc39..58be729 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -438,6 +438,7 @@ class RpmBase(object):
continue
if f == '=':
+ print 'hmm'
f = 'EQ'
if f != 'EQ' and prcotype == 'provides':
# isn't this odd, it's not 'EQ' and it is a provides
@@ -458,7 +459,19 @@ class RpmBase(object):
return result
-
+ def provides_for(self, reqtuple):
+ """check to see if the package object provides for the requirement
+ passed, including searching filelists if the requirement is a file
+ dep"""
+
+ if self.checkPrco('provides', reqtuple):
+ return True
+
+ if reqtuple[0].startswith('/'):
+ if reqtuple[0] in self.filelist + self.dirlist + self.ghostlist:
+ return True
+
+ return False
def returnChangelog(self):
"""return changelog entries"""
--
1.6.6
More information about the Yum-devel
mailing list