On Wed, 2012-02-01 at 13:24 +0100, Zdeněk Pavlas wrote:
> 'list available' hides packages that are installed, or a newer
> version is installed. To find out the newest version installed,
> ghe RPMDB query must not contain explicit version.
> ---
> yum/__init__.py | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
>
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 4c68e22..d1807c2 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -2517,7 +2517,11 @@ class YumBase(depsolve.Depsolve):
> if pkgnarrow == 'all':
> dinst = {}
> ndinst = {} # Newest versions by name.arch
> - for po in self.rpmdb.returnPackages(patterns=patterns,
> + rpm_patterns = patterns
> + if not showdups:
> + # need to find the newest, so strip versions if supplied
> + rpm_patterns = [re.sub('-\d.*', '-*', p) for p in
> rpm_patterns]
> + for po in self.rpmdb.returnPackages(patterns=rpm_patterns,
> ignore_case=ic):
> dinst[po.pkgtup] = po
> if showdups:
This is the wrong way to try and fix this. Pretty sure the first bug is
in the available section too.
You also can't do that s///, because you are assuming things about pkg
naming/versioning that aren't true.
_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel