Fedora Account System
Red Hat Associate
Red Hat Customer
Description of problem: I have the following test packages: $ rpm -q --filetriggers transfiletriggers filetriggerin scriptlet (using /bin/sh) -- /usr/share/doc logger transfiletriggers filetriggerin $*: $(head|xargs echo) filetriggerun scriptlet (using /bin/sh) -- /usr/share/doc logger transfiletriggers filetriggerun $*: $(head|xargs echo) filetriggerpostun scriptlet (using /bin/sh) -- /usr/share/doc logger transfiletriggers filetriggerpostun $*: $(head|xargs echo) transfiletriggerin scriptlet (using /bin/sh) -- /usr/share/doc logger transfiletriggers transfiletriggerin $*: $(head|xargs echo) transfiletriggerun scriptlet (using /bin/sh) -- /usr/share/doc logger transfiletriggers transfiletriggerun $*: $(head|xargs echo) transfiletriggerpostun scriptlet (using /bin/sh) -- /usr/share/doc logger transfiletriggers transfiletriggerpostun $*: $(head|xargs echo) $ rpm -q -l transfiletriggers-a /usr/share/doc/transfiletriggers-a /usr/share/doc/transfiletriggers-a/README As in $subject, I don't see %transfiletriggerpostun called. - installation calls: filetriggerin, transfiletriggerin - removal calls: transfiletriggerun, filetriggerun, filetriggerpostun - reinstall calls: transfiletriggerun, filetriggerin, filetriggerun, filetriggerpostun, transfiletriggerin Version-Release number of selected component (if applicable): rpm-4.13.0-0.rc1.13.fc24.x86_64
There is a different problem. %(trans)filetriggerpostun should be called only for packages that fire a trigger. It shouldn't be called for a package containing that trigger because the trigger is executed after the package is uninstalled so the trigger is also uninstalled and probably commands called in the trigger are uninstalled as well. I need to look deeper into this.
My report wasn't very clear: I was talking about installing/uninstalling/upgrading package transfiletriggers-a.rpm while the triggers were in package transfiletriggers.rpm. Whether %(trans)filetriggerpostun will be called after transfiletriggers.rpm itself is uninstalled is an orthogonal issue.
I facing the same issues. I wanted to propose following patch for vim: From c8e3818f88c5bdb3bb6055b0cc1f38e74657db66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch> Date: Tue, 1 Dec 2015 15:51:39 +0100 Subject: [PATCH] Add RPM file triggers support. --- vim.spec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vim.spec b/vim.spec index 98175e9..6c4183b 100644 --- a/vim.spec +++ b/vim.spec @@ -542,6 +542,14 @@ if [ -x /%{_bindir}/gtk-update-icon-cache ]; then fi update-desktop-database &> /dev/null ||: +# Refresh documentation helptags +%transfiletriggerin common -- %{_datadir}/%{name}/vimfiles/doc +vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null + +%transfiletriggerpostun common -- %{_datadir}/%{name}/vimfiles/doc +> %{_datadir}/%{name}/vimfiles/doc/tags +vim -c ":helptags %{_datadir}/%{name}/vimfiles/doc" -c :q &> /dev/null + %clean rm -rf %{buildroot} @@ -756,6 +764,9 @@ rm -rf %{buildroot} %{_datadir}/icons/hicolor/*/apps/* %changelog +* Tue Dec 01 2015 Vít Ondruch <vondruch> 7.4.945-1 +- Add RPM file triggers support. + * Tue Dec 01 2015 Karsten Hopp <karsten> 7.4.945-1 - patchlevel 945 -- 2.6.3 Later trying with vim-commentary modified as follows: diff --git a/vim-commentary.spec b/vim-commentary.spec index dff1e65..a420639 100644 --- a/vim-commentary.spec +++ b/vim-commentary.spec @@ -48,12 +48,12 @@ install -m 644 %{SOURCE1} %{buildroot}%{appdata_dir} # Check the AppData add-on to comply with guidelines. appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/*.metainfo.xml -%post -vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null - -%postun -> %{vimfiles}/doc/tags -vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null +#%post +#vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null +# +#%postun +#> %{vimfiles}/doc/tags +#vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null %files %doc CONTRIBUTING.markdown README.markdown No matter what I do, the "%{vimfiles}/doc/tags" is never updated during uninstallation of vim-commentary.
Just for the sake of completeness, this is what RPM says about the triggers: $ rpm -q -p --filetriggers ./vim-common-7.4.945-1.fc24.x86_64.rpm transfiletriggerin scriptlet (using /bin/sh) -- /usr/share/vim/vimfiles/doc vim -c ":helptags /usr/share/vim/vimfiles/doc" -c :q &> /dev/null transfiletriggerpostun scriptlet (using /bin/sh) -- /usr/share/vim/vimfiles/doc > /usr/share/vim/vimfiles/doc/tags vim -c ":helptags /usr/share/vim/vimfiles/doc" -c :q &> /dev/null
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
It's an upstream bug, fixed now: https://github.com/rpm-software-management/rpm/commit/f6521c50f6836374a0f7995f8f393aaf36e178ea I'll push updates for this later, right now we need to get the 4.13.0 update through to people.
Fixed in rawhide as of rpm-4.13.0-3.fc26, stable version to be done later.
Thx, it works for the case above. Going to implement the triggers for vim (bug 1343357) right away ;)