Bug 1301677 - File triggers clarification
File triggers clarification
Status: NEW
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: FutureFeature, Tracking
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-25 11:31 EST by Remi Collet
Modified: 2017-07-28 10:31 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Remi Collet 2016-01-25 11:31:48 EST
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...
Comment 1 Ľuboš Kardoš 2016-01-26 04:41:25 EST
(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...
Comment 2 Remi Collet 2016-01-26 04:54:24 EST
Thanks for the clarification (it was also my thinking (last line of my comment)

The new arg idea seems interesting...
Comment 3 Jan Kurik 2016-02-24 09:20:35 EST
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
Comment 4 Ville Skyttä 2016-08-12 14:43:54 EDT
(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.)
Comment 5 Vít Ondruch 2017-02-13 11:22:02 EST
> $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?
Comment 6 Fedora End Of Life 2017-07-25 15:50:57 EDT
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.
Comment 7 Vít Ondruch 2017-07-26 06:13:44 EDT
I have not tested this recently, but I am not aware of seeing this fixed.

Note You need to log in before you can comment on or make changes to this bug.