forked from rpm-software-management/rpm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass the number of instances of the target (i.e. triggering) package left after the operation as the second argument ($2) to file trigger scripts, similarly to regular triggers. Don't pass it to the %transfiletrigger* variants, though, since we can't easily obtain a count-corrected value when such a file trigger is fired by a transaction element. This is because when runFileTriggers() is called in rpmtsRun(), no psm instance has been created yet and thus psm->scriptArg or psm->countCorrection, set by rpmpsmNew(), isn't readily available to us in runHandleTriggersInPkg(). While possible to work around, having arg2 in transaction file triggers doesn't seem worth the trouble. Make arg2 correspond to the first matching package found, as opposed to being an aggregate count of all the matching packages, even if the latter would be easier as we wouldn't have to store the matched package name in the mfi struct and just use rpmdbGetIteratorCount(mfi->pi). The reason for this is two-fold: it's consistent with how regular triggers work and it allows file triggers to detect an upgrade (arg2 > 1) of a triggering package. Fixes: rpm-software-management#2755
- Loading branch information
Showing
7 changed files
with
40 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters