Skip to content

Commit

Permalink
Fix %transfiletriggerpostun execution over multiple prefixes
Browse files Browse the repository at this point in the history
Since its introduction, %transfiletriggerpostun has only executed
matches on the first prefix of a trigger due to a missing inner
loop on the intel gathering stage. This is pronouncedly different
from the other trigger types where the loop does take place as a
part of calling matchFilesNext() repeatedly. I think...

Fixes: rpm-software-management#3048
  • Loading branch information
pmatilai committed Sep 2, 2024
1 parent a270c32 commit 8fdc8da
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/rpmtriggers.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ static void addTriggers(rpmts ts, Header trigH, rpmsenseFlags filter,
rpmTagVal prioTag = RPMTAG_TRANSFILETRIGGERPRIORITIES;

while ((ds = rpmdsFilterTi(triggers, tix))) {
if ((rpmdsNext(ds) >= 0) && (rpmdsFlags(ds) & filter) &&
strcmp(prefix, rpmdsN(ds)) == 0) {
unsigned int priority = getTrigPriority(trigH, prioTag, tix);
rpmtriggersAdd(ts->trigs2run, headerGetInstance(trigH),
tix, priority);
while (rpmdsNext(ds) >= 0) {
if ((rpmdsFlags(ds) & filter) && strcmp(prefix, rpmdsN(ds)) == 0) {
unsigned int priority = getTrigPriority(trigH, prioTag, tix);
rpmtriggersAdd(ts->trigs2run, headerGetInstance(trigH),
tix, priority);
}
}
rpmdsFree(ds);
tix++;
Expand Down

0 comments on commit 8fdc8da

Please sign in to comment.