[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.
seth vidal
skvidal at fedoraproject.org
Thu Jun 24 13:43:18 UTC 2010
On Wed, 2010-06-23 at 15:17 -0400, James Antill wrote:
> 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"?
I think having it broken out like this gives us better opportunity for
better error messages - like that one.
>
> > 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?
I don't think so - b/c I can completely see making a YumDeltaPackage()
which derives from there, especially for createrepo's use.
> Also did you want to catch rpm.error too?
What's making the rpm.error, here? drpms are valid rpm pkg headers.
-sv
More information about the Yum-devel
mailing list