Bug 489700 - rpm post scriptlets not run on upgrade
rpm post scriptlets not run on upgrade
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
x86_64 Linux
low Severity medium
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-03-11 10:16 EDT by Deji Akingunola
Modified: 2009-03-18 09:14 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-18 09:14:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Deji Akingunola 2009-03-11 10:16:39 EDT
Description of problem: The following rpm post scriptlets is not run when I tried to upgrade 'mpich2' packages with 'rpm -Uvh', although it runs successfully when installing (either the former or the latter version).
/usr/sbin/alternatives	\
	--install %{_bindir}/mpirun mpi-run %{_bindir}/mpiexec.py 41	\
	--slave	%{_bindir}/mpiexec mpi-exec %{_bindir}/mpiexec.py	\
	--slave	%{_mandir}/man1/mpiexec.1.gz mpi-exec-man		\
			%{_mandir}/man1/mp-mpiexec.1.gz		\
	--slave	%{_mandir}/man1/mpif90.1.gz mpif90-man		\
			%{_mandir}/man1/mp-mpif90.1.gz		\
	--slave	%{_mandir}/man1/mpif77.1.gz mpif77-man		\
			%{_mandir}/man1/mp-mpif77.1.gz		\
	--slave	%{_mandir}/man1/mpicc.1.gz mpicc-man		\
			%{_mandir}/man1/mp-mpicc.1.gz		\
	--slave	%{_mandir}/man1/mpic++.1.gz mpic++-man		\

%post devel
/usr/sbin/alternatives	\
	--install %{_bindir}/mpicc mpicc 				\
				%{_bindir}/mp%{mode}-mpicc %{priority}	\
	--slave	%{_bindir}/mpicxx  mpicxx  %{_bindir}/mp%{mode}-mpicxx	\
	--slave	%{_bindir}/mpif90  mpif90  %{_bindir}/mp%{mode}-mpif90	\
	--slave	%{_bindir}/mpif77  mpif77  %{_bindir}/mp%{mode}-mpif77

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Try to install the mpich2-1.0.8-1 binaries (mpich2, mpich2-libs, mpich2-devel) from http://deji.fedorapeople.org/
2. Upgrade to mpich2-1.0.8-3 binaries from http://koji.fedoraproject.org/koji/buildinfo?buildID=93591
Actual results: 
/usr/bin/{mpiexec,mpirun,mpif90,mpicc,mpif77,mpicxx} doesn't exist after upgrade (linnks not setup by alternatives)

Expected results:
/usr/bin/{mpiexec,mpirun,mpif90,mpicc,mpif77,mpicxx} links setup by alternatives.

Additional info:
I've tried to add conditional to the post script (if [$1 -gt 0 ]), but I still ran into the issue.

However, running 'rpm -Uvh --force' after the initially running 'rpm -Uvh' causes the scriptlets to run, and the alternatives link properly set up.
Comment 1 Panu Matilainen 2009-03-18 09:14:34 EDT
See https://fedoraproject.org/wiki/Packaging/ScriptletSnippets, the order of scriptlets is not what you might expect and you need to detect upgrade in all %post, %preun etc. This thread might be helpful too:

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