[Rpm-maint] [rpm-software-management/rpm] Fix file triggers running twice from add/remove elements on upgrade (PR #4044)

Panu Matilainen notifications at github.com
Fri Nov 14 10:25:40 UTC 2025


If the file trigger source and target are updated in the same transaction, the we end up running various triggers twice due to the add/remove elements in the transaction matching.

Add the necessary filtering to the file trigger gathering logic: on upgrade, filetriggerin runs from the new package, filetriggerun from the old package, but counterintuitively postun runs from the new package, because the old package no longer exists in the db at the point when it runs. Update the documentation to reflect this as well.

There are still some duplicate triggers executing due to the separate target/source runs, but that's a slightly different problem and will be addressed separately.

Fixes: #4030

You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/4044

-- Commit Summary --

  * Reproducer tests for #4030
  * Add tests for %transfiletriggerun as well, missing since 2017. Uff.
  * Lift the transfiletrigger skip logic to a helper function
  * Fix file triggers running twice from add/remove elements on upgrade

-- File Changes --

    M docs/man/rpm-scriptlets.7.scd (10)
    M lib/rpmtriggers.cc (46)
    M tests/data/SPECS/parallel.spec (4)
    M tests/rpmscript.at (49)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/4044.patch
https://github.com/rpm-software-management/rpm/pull/4044.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4044
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/4044 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20251114/bb6d7b62/attachment-0001.htm>


More information about the Rpm-maint mailing list