[Yum-devel] [PATCH 2/2] add a provides_for method to package objects
James Antill
james at fedoraproject.org
Thu Apr 8 18:34:13 UTC 2010
On Thu, 2010-04-08 at 11:30 -0400, Seth Vidal wrote:
> 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'
:) :). I'm pretty sure this only happens from "make check", but did you
mean to leave that in there?
> 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
It might be worth using misc.re_primary_filename and primary_only here.
ACK.
More information about the Yum-devel
mailing list