%posttrans, %transfiletriggerin, and script ordering
Can anyone tell what exactly happens if an rpm transaction contains both calls to %posttrans and %transfiletriggerin? Is there any reliable order in which these scripts are called in the posttrans stage? Or putting it differently, is there any way to make sure the %posttrans script of package A runs after the %transfiletriggerin of package B, or vice versa? Regards Martin
Hi Martin, Martin Wilck <mwilck@suse.com> writes:
Can anyone tell what exactly happens if an rpm transaction contains both calls to %posttrans and %transfiletriggerin? Is there any reliable order in which these scripts are called in the posttrans stage?
librpm will first run %posttrans and then %transfiletriggerin (see [1] and [2]). However, I cannot tell you exactly how zypper does it, because it subprocesses calls to rpm without calling the scriptlets and calls them manually afterwards. So I wouldn't rely on any ordering of these scriptlets, as you might get different behaviors between zypper and dnf.
Or putting it differently, is there any way to make sure the %posttrans script of package A runs after the %transfiletriggerin of package B, or vice versa?
At least with librpm: it does not look like there's a way. Cheers, Dan Footnotes: [1] https://github.com/rpm-software-management/rpm/blob/master/lib/transaction.c... [2] https://github.com/rpm-software-management/rpm/blob/master/lib/transaction.c... -- Dan Čermák <dcermak@suse.com> Software Engineer Development tools SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nuremberg Germany (HRB 36809, AG Nürnberg) Managing Director: Felix Imendörffer
On Mon, Aug 30, 2021 at 11:19 AM Martin Wilck <mwilck@suse.com> wrote:
Can anyone tell what exactly happens if an rpm transaction contains both calls to %posttrans and %transfiletriggerin? Is there any reliable order in which these scripts are called in the posttrans stage?
According to https://github.com/rpm-software-management/rpm/blob/fd57fc716231c8296d340fdb... the order is %pretrans %transfiletriggerun transaction itself %posttrans %transfiletriggerpostun %transfiletriggerin
Or putting it differently, is there any way to make sure the %posttrans script of package A runs after the %transfiletriggerin of package B, or vice versa?
It does not look to be possible. %posttrans and %transfiletriggerin are executed in two separate steps sequentially.
participants (3)
-
Andrei Borzenkov
-
Dan Čermák
-
Martin Wilck