Bug 1284645 - rpm %transfiletriggerpostun is not called
rpm %transfiletriggerpostun is not called
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
24
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 1288081 1343357
  Show dependency treegraph
 
Reported: 2015-11-23 13:12 EST by Zbigniew Jędrzejewski-Szmek
Modified: 2016-11-20 03:29 EST (History)
10 users (show)

See Also:
Fixed In Version: rpm-4.13.0-3.fc26
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-11-20 03:29:22 EST
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 Zbigniew Jędrzejewski-Szmek 2015-11-23 13:12:28 EST
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
Comment 1 Ľuboš Kardoš 2015-11-25 05:00:39 EST
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 08:21:02 EST
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 08:05:49 EST
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@redhat.com>
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@redhat.com> 7.4.945-1
+- Add RPM file triggers support.
+
 * Tue Dec 01 2015 Karsten Hopp <karsten@redhat.com> 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.
Comment 4 Vít Ondruch 2015-12-02 08:25:12 EST
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 09:01:14 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 6 Panu Matilainen 2016-11-07 06:50:53 EST
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.
Comment 7 Panu Matilainen 2016-11-07 08:37:22 EST
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 10:37:03 EST
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.