Bug 1284645 - rpm %transfiletriggerpostun is not called
Summary: rpm %transfiletriggerpostun is not called
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 24
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: 1288081 1343357
TreeView+ depends on / blocked
Reported: 2015-11-23 18:12 UTC by Zbigniew Jędrzejewski-Szmek
Modified: 2016-11-20 08:29 UTC (History)
10 users (show)

Fixed In Version: rpm-4.13.0-3.fc26
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-11-20 08:29:22 UTC
Type: Bug

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1282115 0 unspecified CLOSED rpm %transfiletriggerun is called twice per transaction 2021-02-22 00:41:40 UTC

Internal Links: 1282115

Description Zbigniew Jędrzejewski-Szmek 2015-11-23 18:12:28 UTC
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

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):

Comment 1 Ľuboš Kardoš 2015-11-25 10:00:39 UTC
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.

Comment 2 Zbigniew Jędrzejewski-Szmek 2015-11-25 13:21:02 UTC
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.

Comment 3 Vít Ondruch 2015-12-02 13:05:49 UTC
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
 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
 rm -rf %{buildroot}
@@ -756,6 +764,9 @@ rm -rf %{buildroot}
+* 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

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
-vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null
-> %{vimfiles}/doc/tags
-vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null
+#vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null
+#> %{vimfiles}/doc/tags
+#vim -c ":helptags %{vimfiles}/doc" -c :q &> /dev/null
 %doc CONTRIBUTING.markdown README.markdown

No matter what I do, the "%{vimfiles}/doc/tags" is never updated during uninstallation of vim-commentary.

Comment 4 Vít Ondruch 2015-12-02 13:25:12 UTC
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

Comment 5 Jan Kurik 2016-02-24 14:01:14 UTC
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:

Comment 6 Panu Matilainen 2016-11-07 11:50:53 UTC
It's an upstream bug, fixed now:

I'll push updates for this later, right now we need to get the 4.13.0 update through to people.

Comment 7 Panu Matilainen 2016-11-07 13:37:22 UTC
Fixed in rawhide as of rpm-4.13.0-3.fc26, stable version to be done later.

Comment 8 Vít Ondruch 2016-11-07 15:37:03 UTC
Thx, it works for the case above. Going to implement the triggers for vim (bug 1343357) right away ;)

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