Bug 489700

Summary: rpm post scriptlets not run on upgrade
Product: [Fedora] Fedora Reporter: Deji Akingunola <dakingun>
Component: rpmAssignee: Panu Matilainen <pmatilai>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: ffesti, jnovy, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-03-18 13:14:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Deji Akingunola 2009-03-11 14:16:39 UTC
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).
...
%post
/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		\
			%{_mandir}/man1/mp-mpicxx.1.gz
...
and

...
%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
3.
  
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 13:14:34 UTC
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:
http://lists.rpm.org/pipermail/rpm-maint/2009-March/002384.html