[Rpm-maint] [PATCH 4/6] Create a new publicly accessible function, rpmteHeaderOpen
pmatilai at laiskiainen.org
Mon Jul 26 12:25:04 UTC 2010
On Mon, 26 Jul 2010, Panu Matilainen wrote:
> On Wed, 14 Jul 2010, Steve Lawrence wrote:
>> When the SELinux policy collection plugin is executed, the transaction
>> element has already been closed, and the header cannot be accessed.
>> However, access to the header is needed to extract policy data. The new
>> rpmteHeaderOpen function allows accessing the header of a closed
>> transaction element by opening it if necessary.
> Is there a chance that this gets called on packages which are not yet
> installed? If so, I suspect it'll confuse the heck out of yum's (and probably
> others) transaction callback/progress handling. Also there's no guarantee the
> package file exists after its installed (eg depsolvers might delete packages
> after installing to save diskspace).
> rpmteHeader() is already a somewhat strange interface, adding another similar
> doesn't make it any better... but I don't have any concrete ideas off-hand
> how to make it all saner. One possibility might be having another opetional
> collection hook which gets executed while the element header is open to
> permit whatever data the plugins might need to be collected from the headers.
Oh and BTW, hook(s) that actually execute once for every package in a
collection should be useful for other purposes too.
The currect collection implementation is basically "one-shot" collection
which is generally an optimization to avoid redundant calls to something
potentially expensive. The other aspect of collections is that they help
reducing clutter in spec files, but not all of these cases are one-shot in
nature. For example file registration type activity (such as system
services, .info files etc) is often not possible with one-shot collections
but could be done by collection hooks which execute once for every element
in a collection.
- Panu -
More information about the Rpm-maint