[Yum-devel] [PATCH] Use rpmsack returnGPGPubkeyPackages() in YumBase.gpgKeyCheck()

James Antill james at fedoraproject.org
Tue Feb 15 16:12:00 UTC 2011


On Tue, 2011-02-15 at 17:17 +0200, Panu Matilainen wrote:
> On 02/15/2011 04:56 PM, James Antill wrote:
> > On Tue, 2011-02-15 at 11:54 +0200, Panu Matilainen wrote:
> >> Reduces code duplication and unnecessary rpmdb reopens. The rpmdb
> >> gets opened shortly afterwards anyway and closed before any downloads
> >> so there should be no unwanted side-effects.
> >> ---
> >>   yum/__init__.py |    9 +--------
> >>   1 files changed, 1 insertions(+), 8 deletions(-)
> >
> >   NAK. As soon as you call rpmdb.returnGPGPubkeyPackages() then
> > rpmdb.returnPackages() needs to filter those "packages" out on each
> > call.
> 
> Hmm, so that's what the "hacky" comment referred to. I missed the 
> side-effect of _makePackageObject() adding them to global indexes.
> 
> OTOH having a function which should never be called seems a bit Spinal 
> Tap'ish to me :)

 Well, the idea is that the function is only called by things like the
keys plugin ... so it can be called, but we don't want to call it in a
normal path.

>  Would it break the keys-remove usage (or something 
> else) if it returned list of RPMInstalledPackage() created objects 
> instead of going through _makePackageObject()?

 I believe the big problem is "keys-remove", you can probably get away
with not using _makePackageObject() in returnGPGPubkeyPackages() for
list/info/etc. but removing things from the rpmdb which "aren't in" the
rpmdb is more than a little hack (having a quick look the call
dropCachedDataPostTransaction() is sure to be unhappy, although it could
be made to ignore gpg keys).

 In general the fact we have the gpg "packages" is hacky, and that is
going to leak out somewhere ... so I'm not dying to change anything,
unless it's an obviously better "leak" :).



More information about the Yum-devel mailing list