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

Panu Matilainen pmatilai at laiskiainen.org
Tue Feb 15 15:17:28 UTC 2011


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 :) Would it break the keys-remove usage (or something 
else) if it returned list of RPMInstalledPackage() created objects 
instead of going through _makePackageObject()? Or alternatively, would 
you accept a patch that optionally did that - ie preserve the current 
functionality by default but optionally skipped the loading to global 
indexes (which would suffice for my purpose just fine)?

	- Panu -


More information about the Yum-devel mailing list