Bug 1403539

Summary: llvm-devel %postun scriptlet fails on upgrade
Product: [Fedora] Fedora Reporter: Mattias Ellert <mattias.ellert>
Component: llvmAssignee: Tom Stellard <tstellar>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 25CC: ajax, bos, davejohansen, dmalcolm, jistone, jv+fedora, petersen, scottt.tw, vedran
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: llvm-3.9.1-5.fc25 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-31 20:50:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mattias Ellert 2016-12-11 06:10:34 UTC
Description of problem:

$ rpm -q --scripts llvm-devel
postinstall scriptlet (using /bin/sh):
/usr/sbin/update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-64 64
postuninstall scriptlet (using /bin/sh):
[ $1 -eq 0 ] && /usr/sbin/update-alternatives --remove llvm-config /usr/bin/llvm-config-64

On upgrade, in the postuninstall scriptlet $1 is 1. This means that [ $1 -eq 0 ] evaluates to false, and the command after the && is not evaluated (i.e. not executed - which is the intention). The whole statement evaluates to false which in interpreted by rpm as a failure.

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

$ rpm -q llvm-devel
llvm-devel-3.8.0-1.fc25.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Upgrade llvm-devel

Actual results:
Error in %postun reported

Expected results:
No error

Comment 1 Mattias Ellert 2017-03-16 05:45:41 UTC
Still happening:

  Rensar upp   : llvm-devel-3.8.1-2.fc25.x86_64                           37/56 
varning: %postun(llvm-devel-3.8.1-2.fc25.x86_64)-skript misslyckades, slutstatus 1
Non-fatal POSTUN scriptlet failure in rpm package llvm-devel
Non-fatal POSTUN scriptlet failure in rpm package llvm-devel

%postun devel
[ $1 -eq 0 ] && %{_sbindir}/update-alternatives --remove llvm-config %{_bindir}/llvm-config-%{__isa_bits}

should be

%postun devel
if [ $1 -eq 0 ]; then
    %{_sbindir}/update-alternatives --remove llvm-config %{_bindir}/llvm-config-%{__isa_bits}
fi

Also, the requires for the scriptlets:

%package devel
Requires(posttrans): %{_sbindir}/alternatives
Requires(posttrans): %{_sbindir}/alternatives

should be

%package devel
Requires(post): %{_sbindir}/alternatives
Requires(postun): %{_sbindir}/alternatives

Comment 2 Tom Stellard 2017-03-23 10:43:12 UTC
*** Bug 1434603 has been marked as a duplicate of this bug. ***

Comment 3 Fedora Admin XMLRPC Client 2017-05-04 13:57:47 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 4 Fedora Update System 2017-08-25 21:40:30 UTC
llvm-3.9.1-5.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-3ff7bcde09

Comment 5 Fedora Update System 2017-08-26 22:37:50 UTC
llvm-3.9.1-5.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-3ff7bcde09

Comment 6 Fedora Update System 2017-08-31 20:50:54 UTC
llvm-3.9.1-5.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.