Bug 1403539 - llvm-devel %postun scriptlet fails on upgrade
Summary: llvm-devel %postun scriptlet fails on upgrade
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: llvm
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1434603 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-11 06:10 UTC by Mattias Ellert
Modified: 2017-08-31 20:50 UTC (History)
9 users (show)

Fixed In Version: llvm-3.9.1-5.fc25
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-31 20:50:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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.


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