[Rpm-maint] rpm feature request

Panu Matilainen pmatilai at redhat.com
Tue Jul 31 06:47:43 UTC 2007

On Mon, 30 Jul 2007, seth vidal wrote:

> Would it be possible in some future rpm python interface to get rid of
> the horrible setVsFLAGS bitmask and just have the items be attributes
> you set or unset in the ts object?
> ts = rpm.TransactionSet()
> ts.gpgcheck = False
> ts.hdrcheck = True
> ts.installroot = '/some/place'
> etc. etc
> I know 'being pythonic' isn't really a needed feature of rpm - but it
> would make finding out what things are set and how the are set much
> easier.

This being rpm doesn't need to mean unpythonic either, but ...

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

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)

Another possibility might be some kind of set object. Whatever it ends up 
being, it has to internally work directly on the actual bitfield, 
otherwise we'll end up having to keep extra state information around here 
and there for no good reason.

 	- Panu -

More information about the Rpm-maint mailing list