[Rpm-maint] semantics of %posttrans?
Panu Matilainen
pmatilai at redhat.com
Wed Jun 27 07:48:33 UTC 2007
On Tue, 26 Jun 2007, Paul Nasrat wrote:
> On Tue, 2007-06-26 at 15:41 -0400, Bill Nottingham wrote:
>> If I'm reading right, %posttrans/%pretrans is only run if it's part of
>> a package being added/updated, not a package being removed.
Yup. For the background why that's the case see
https://lists.dulug.duke.edu/pipermail/rpm-devel/2006-January/000706.html
Maybe I'm missing something here but I don't quite see how callback
modification is required for implementing it for removed items. Since a
package to be removed is in the db, it's possible to look up the header
via the ts element to retrieve with all the required script information.
For posttrans that might get a bit more interesting as the headers aren't
to be found in the db anymore I guess, so they'd need to be queued at the
beginning of transaction and executed after it.
>>
>> 1) Is this the semantics we want?
>
> No - a transaction set should be a set of operations.
Agreed, but...
>> 2) If so, does it imply the need for a (ugh) %postuntrans?
>
> Makes no sense, unless in the context of a "rollback" (an untrans, by
> some definition...)
Well, a package might want to know whether it's being removed or
installed/upgraded in a transaction. So the %postuntrans does kinda
make sense when you think of it as "the transaction where this package got
removed." The terminology is confusing though, "pre/posttrans" makes you
immediately think of "before and after a transaction starts and stops" and
pre/postuntrans sounds, indeed, like some reverse transaction.
Maybe it'd make sense to have %pre/posttrans scriptlets have similar
(similar, not equal, because the situation where they run is different)
convention as normal pre/post etc scriptlets where arg1 is set
appropriately on install/upgrade/remove.
- Panu -
More information about the Rpm-maint
mailing list