[Rpm-maint] [rpm-software-management/rpm] File triggers run twice on package upgrade (Issue #4030)
Panu Matilainen
notifications at github.com
Fri Nov 7 10:39:36 UTC 2025
pmatilai left a comment (rpm-software-management/rpm#4030)
Hmm. Using packages from one of our own test-cases, upgrading both the package with all possible file triggers and a package triggering it:
```
# rpm -Uv /tmp/parallel-trigger-1.0-1.noarch.rpm /tmp/parallel-1.0-1.noarch.rpm
# dnf -y install /tmp/parallel-2.0-1.noarch.rpm /tmp/parallel-trigger-2.0-1.noarch.rpm
>>> Running %triggerun scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Finished %triggerun scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-1.0-1 TRANSFILETRIGGERUN 1 | 12
>>>
[3/6] Upgrading parallel-trigger-0:2.0- 100% | 854.0 B/s | 100.0 B | 00m00s
>>> Running %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 FILETRIGGERIN 2 1 | 12
>>>
[4/6] Upgrading parallel-0:2.0-1.noarch 100% | 3.3 KiB/s | 100.0 B | 00m00s
>>> Running %triggerin scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Finished %triggerin scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-1.0-1 FILETRIGGERIN 2 2 | 12
>>>
>>> Running %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 FILETRIGGERIN 2 2 | 12
>>>
[5/6] Removing parallel-trigger-0:1.0-1 100% | 24.4 KiB/s | 100.0 B | 00m00s
[6/6] Removing parallel-0:1.0-1.noarch 100% | 18.0 B/s | 12.0 B | 00m01s
>>> Running %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 FILETRIGGERPOSTUN 1 1 | 11
>>>
>>> Running %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 TRANSFILETRIGGERPOSTUN 1 | 0
>>>
>>> Running %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 TRANSFILETRIGGERIN 2 | 12
>>>
```
A few noteworthy things here:
- dnf reports two instances of `%triggerpostun` running, but the latter is actually `%transfiletriggerpostun` as indicated by the testcase scriptlet output, so there's a fair chance for confusion
- in both cases, it's the version from the newer package
- here, it's `%triggerin` that runs twice - once for the old and once for the new package, which is of course buggy
Apparently this is order-dependent, from the same starting point, with the packages swapped around:
```
# dnf -y install /tmp/parallel-trigger-2.0-1.noarch.rpm /tmp/parallel-2.0-1.noarch.rpm
>>> Running %triggerun scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Finished %triggerun scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-1.0-1 TRANSFILETRIGGERUN 1 | 12
>>>
[3/6] Upgrading parallel-0:2.0-1.noarch 100% | 1.0 KiB/s | 100.0 B | 00m00s
>>> Running %triggerin scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Finished %triggerin scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-1.0-1 FILETRIGGERIN 1 2 | 12
>>>
[4/6] Upgrading parallel-trigger-0:2.0- 100% | 2.2 KiB/s | 100.0 B | 00m00s
>>> Running %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 FILETRIGGERIN 2 2 | 24
>>>
[5/6] Removing parallel-0:1.0-1.noarch 100% | 400.0 B/s | 12.0 B | 00m00s
>>> Running %triggerpostun scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Finished %triggerpostun scriptlet: parallel-trigger-0:1.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-1.0-1 FILETRIGGERPOSTUN 2 1 | 11
>>>
>>> Running %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 FILETRIGGERPOSTUN 2 1 | 11
>>>
[6/6] Removing parallel-trigger-0:1.0-1 100% | 161.0 B/s | 100.0 B | 00m01s
>>> Running %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerpostun scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 TRANSFILETRIGGERPOSTUN 1 | 0
>>>
>>> Running %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Finished %triggerin scriptlet: parallel-trigger-0:2.0-1.noarch
>>> Scriptlet output:
>>> parallel-trigger-2.0-1 TRANSFILETRIGGERIN 2 | 12
>>>
```
And here we got both `%triggerin` and `%triggerpostun` running twice - once for the new and again for the old. Uff.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/4030#issuecomment-3501790403
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/issues/4030/3501790403 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20251107/db12208f/attachment-0001.htm>
More information about the Rpm-maint
mailing list