I'm working on using file triggers for pecl extension (un)registration (in php-pear package) http://pkgs.fedoraproject.org/cgit/rpms/php-pear.git/commit/?h=private-drop-pecl-dep&id=43a3dfa944725625b5c8b12760713fc55def99f7 It seems to work as expected, but a small question. During php-pear update, both triggers are run, so all extensions are unregistered (filetriggerun) and then registered again (transfiletriggerin) I understand this can be very complex, as the same transaction can remove some pecl extension, update pear, add some other pecl extension. Can you confirm ? or give explanation on how to improved ? Shouldn' filetriggerun be run for file - being removed (removal or update of the package owning the file) - in rpmdb if final removal of the package containg the trigger And transfiletriggerin be run for file - being added (install or update of the package owning the file) - in rpmdb if initial install of the package containg the trigger But I could understand this can be very complex, especially if the trigger code change...
(In reply to Remi Collet from comment #0) > I'm working on using file triggers for pecl extension (un)registration (in > php-pear package) > > http://pkgs.fedoraproject.org/cgit/rpms/php-pear.git/commit/?h=private-drop- > pecl-dep&id=43a3dfa944725625b5c8b12760713fc55def99f7 > > It seems to work as expected, but a small question. > > During php-pear update, both triggers are run, so all extensions are > unregistered (filetriggerun) and then registered again (transfiletriggerin) > > I understand this can be very complex, as the same transaction can remove > some pecl extension, update pear, add some other pecl extension. > > Can you confirm ? or give explanation on how to improved ? > > > Shouldn' filetriggerun be run for file > - being removed (removal or update of the package owning the file) > - in rpmdb if final removal of the package containg the trigger It is also called when a package containing the trigger is updated because upgrade consists of installation and uninstallation. This can be useful when the storage (database) for registration of extension will change. Then you need to remove all extension registration from old storage and store them into new one. Nevertheless we can add an argument for trigger script. From this argument it will be possible to find out if the final removal of the package containing the trigger or just an update is in progress. So we will leave decision if trigger script should be executed during updates of package containing trigger on package maintainers > > And transfiletriggerin be run for file > - being added (install or update of the package owning the file) > - in rpmdb if initial install of the package containg the trigger This is the same. > > But I could understand this can be very complex, especially if the trigger > code change...
Thanks for the clarification (it was also my thinking (last line of my comment) The new arg idea seems interesting...
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle. Changing version to '24'. More information and reason for this action is here: https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase
(In reply to Ľuboš Kardoš from comment #1) > Nevertheless we can add an argument for trigger script. From this argument > it will be possible to find out if the final removal of the package > containing the trigger or just an update is in progress. So we will leave > decision if trigger script should be executed during updates of package > containing trigger on package maintainers Isn't the $2 argument for regular triggers already there for this purpose? And $1 would be the package containing the trigger? $1 and $2 seem to be both 0 for my tests with %filetriggerin and %filetriggerun, no matter if it's an initial install, update, or removal. This makes it practically impossible to implement for example the texinfo scriptlets using file triggers (the uninstall phase needs to know if it's the final removal): https://fedoraproject.org/wiki/Packaging:Scriptlets#Texinfo (The install-info scriptlets are a bit broken though; the uninstall should not actually not be checking for final removal, but instead if an info file will be present after the erase/update operation. But I suppose there's no sane way to do that and that's why they're implemented like they are ATM.)
> $1 and $2 seem to be both 0 for my tests with %filetriggerin and > %filetriggerun, no matter if it's an initial install, update, or removal. > This makes it practically impossible to implement for example the texinfo > scriptlets using file triggers (the uninstall phase needs to know if it's > the final removal): > https://fedoraproject.org/wiki/Packaging:Scriptlets#Texinfo Any update on this?
This message is a reminder that Fedora 24 is nearing its end of life. Approximately 2 (two) weeks from now Fedora will stop maintaining and issuing updates for Fedora 24. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '24'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 24 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
I have not tested this recently, but I am not aware of seeing this fixed.
This is an upstream matter, there are various short-comings in the file trigger design that will need to be eventually addressed: https://github.com/rpm-software-management/rpm/projects/14