[Yum-devel] [PATCH] - multiple checks to make sure we're not trying to install a deltarpm directly - also make sure no bogons filter in for localinstall.
James Antill
james at fedoraproject.org
Wed Jun 23 19:17:44 UTC 2010
On Wed, 2010-06-23 at 14:58 -0400, Seth Vidal wrote:
> ---
> cli.py | 4 ++++
> yum/__init__.py | 5 +++++
> 2 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/cli.py b/cli.py
> index 2f1479b..fc4ee1c 100644
> --- a/cli.py
> +++ b/cli.py
> @@ -863,6 +863,10 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
>
> installing = False
> for pkg in filelist:
> + if not pkg.endswith('.rpm'):
> + self.verbose_logger.log(yum.logginglevels.INFO_2,
> + "Skipping: %s, filename does not end in .rpm.", pkg)
> + continue
> txmbrs = self.installLocal(pkg, updateonly=updateonly)
> if txmbrs:
> installing = True
Given this, what do you think of making "yum localinstall" just be an
alias for "yum install"?
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 9a0bc15..dc7c7ef 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -3709,6 +3709,11 @@ class YumBase(depsolve.Depsolve):
> self.verbose_logger.log(logginglevels.INFO_2,
> _('Examining %s: %s'), po.localpath, po)
>
> + # apparently someone wanted to try to install a drpm as an rpm :(
> + if po.hdr['payloadformat'] == 'drpm':
> + self.logger.critical(_('Cannot localinstall deltarpm: %s. Skipping.'), pkg)
> + return tx_return
> +
Is it worth doing this check in YumLocalPackage() instead?
Also did you want to catch rpm.error too?
More information about the Yum-devel
mailing list