[PATCH] Use the rpm database to find packages installed by package payloads
Vratislav Podzimek
vpodzime at redhat.com
Mon Jan 26 07:45:59 UTC 2015
On Fri, 2015-01-23 at 10:41 -0500, David Shea wrote:
> The previous PackagePayload implementations of kernelVersionList had a
> problem in that they could miss kernels installed by packages not named
> "kernel" (kernel-core, kernel-PAE, kernel-debug) and in that there may
> be a difference between the package EVR and the version derived from
> s/vmlinuz-// (because there's a +PAE or +debug in it or something).
> ---
> pyanaconda/packaging/__init__.py | 19 +++++++++++++++++++
> pyanaconda/packaging/dnfpayload.py | 7 -------
> pyanaconda/packaging/yumpayload.py | 8 --------
> 3 files changed, 19 insertions(+), 15 deletions(-)
>
> diff --git a/pyanaconda/packaging/__init__.py b/pyanaconda/packaging/__init__.py
> index 2438b6f..2129347 100644
> --- a/pyanaconda/packaging/__init__.py
> +++ b/pyanaconda/packaging/__init__.py
> @@ -35,6 +35,7 @@ import ConfigParser
> import shutil
> import time
> from glob import glob
> +from fnmatch import fnmatch
> import threading
> import re
>
> @@ -696,6 +697,24 @@ class PackagePayload(Payload):
> return kernels
>
> @property
> + def kernelVersionList(self):
> + # Find all installed rpms that provide 'kernel'
> + # Unlike the rpm imports in Payload, this one is mandatory
> + import rpm
Maybe we could make Payload's rpm imports mandatory too? We do make sure
that rpm-python is available. Or if that's not possible, we should catch
the ImportError here in case rpm-python is not available and raise a
better (more descriptive) one. Otherwise this looks good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic
More information about the anaconda-patches
mailing list