[Rpm-maint] rpm feature request

Panu Matilainen pmatilai at redhat.com
Wed Aug 1 07:15:44 UTC 2007


On Tue, 31 Jul 2007, seth vidal wrote:

> On Tue, 2007-07-31 at 09:47 +0300, Panu Matilainen wrote:
>
>> There are a number of other places as well where bitfield is used:
>> tsflags, vsflags, verifyflags (once the verification api gets done) etc,
>> if something is to be done about them I think it should be a generic
>> bitfield wrapper object that supports nicer set/get methods than the raw
>> bitfield. The above would instead become something like
>
> Alternatively just get rid of the bitfields all together. :)

They're not going away on C-level... and I don't actually mind them in 
python either :)

>> ts = rpm.ts()
>> ts.vsflags.set(rpm.RPMVSF_NOHDRCHK, True)
>> flag = ts.vsflags.get(<item>) # return boolean
>>
>> Of course those flags are negative so .. maybe it'd want some extra
>> wrapping to turn it into something like
>> ts.vsflags.set('gpgcheck', True)
>
> yes, I'd be perfectly happy with that, though:
> ts.vsflags.gpgcheck = True
>
> looks so much nicer :)

That's fine by me as well, just a matter of overloading __setattr__ and 
__getattr__ to do the actual bitfield manipulation + some mapping for 
attribute names <-> corresponding bitfield items.

 	- Panu -



More information about the Rpm-maint mailing list