Bug 520158
Summary: | warning: %postun(nss-softokn-3.12.3.99.3-21.fc12.x86_64) scriptlet failed, exit status 1 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Andreas Schwab <schwab> | ||||||
Component: | nss-softokn | Assignee: | Elio Maldonado Batiz <emaldona> | ||||||
Status: | CLOSED CURRENTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | low | ||||||||
Version: | 12 | CC: | emaldona, horsley1953, jreiser, kengert, nicolas.mailhot, rrelyea, wtogami | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | 3.12.4-18.fc12 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2010-09-25 00:32:22 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: | |||||||||
Attachments: |
|
Description
Andreas Schwab
2009-08-28 16:49:54 UTC
*** Bug 520529 has been marked as a duplicate of this bug. *** Fix applied in nss-softokn-3.12.3.99.3-24.fc12. "Fix" didn't work. Created attachment 359420 [details]
Fix logic in %postun trigger
Created attachment 359435 [details] Fix logic in %postun trigger I tested this with the scratch build at http://koji.fedoraproject.org/koji/taskinfo?taskID=1648481 Requesting Bob Relyea's review. ouch, the logic makes my head hurt. OK [ $1 = 0 ] returns 1 if $1 == 0 and continues. [ $1 = 0 } returns 0 if $1 != 0 and runs the exit 0. This is correct, however I think you want to run /sbin/ldconfig before the test so it runs even in the update case. bob This is wrong, the shell uses negative logic. 0 means true and 1 (!= 0) means false, thus [ $1 = 0 ] returns 0 if $1 == 0. You need the overall exit code to be 0 so you always need to use || as the toplevel operator. I don't understand why the original fix didn't work. You are right, in [ expr ] test evaluates expr, and if the result is true, it return exit status of 0, otherwise it returns a non-zero. I don't why the original fix doesn't work either. I propose the following to make the logic patently clear: %postun /sbin/ldconfig >/dev/null 2>/dev/null if [ $1 > 0 ] then; exit 0 fi %{__rm} -f %{_sysconfdir}/prelink.conf.d/nss-softokn-prelink.conf Why not: if [ $1 = 0 ] then; %{__rm} -f %{_sysconfdir}/prelink.conf.d/nss-softokn-prelink.conf fi exit 0 bob OK, I haven't really been following this, but these code snippets look like someone thinks $1 is the result of running the ldconfig command. That is not the case, $? is the result from running ldconfig (just ignore me if I don't understand how $1 is being used :-). The thinking is that after uninstall the %postun script will called and passed a argument, $1, equal to the number of instances remaining. Only when no instances remain will we remove the nss-prelink.conf file. Things are getting worse, not better. Rawhide of Sunday, Sept.6 gives: Cleanup : nss-softokn-3.12.4-2.fc12.i686 /var/tmp/rpm-tmp.1QWujd: line 2: [: missing `]' /var/tmp/rpm-tmp.1QWujd: line 4: syntax error near unexpected token `fi' /var/tmp/rpm-tmp.1QWujd: line 4: `fi' Non-fatal POSTUN scriptlet failure in rpm package nss-softokn warning: %postun(nss-softokn-3.12.4-2.fc12.i686) scriptlet failed, exit status 2 The following %postun /sbin/ldconfig >/dev/null 2>/dev/null [ $1 = 0 ] || exit 0 %{__rm} -f %{_sysconfdir}/prelink.conf.d/nss-softokn-prelink.conf works. As of this writing updating nss-softokn-3.12.4-8.fc12 works for me. I installed Fedora 12 Alpha "asis" which comes with 3.12.3.99-6 and did a yum update on nss, ns-softokn, etc. which updated to 3.12.4-8 without conflicts and warnings after the cleanup of the older version. *** Bug 520715 has been marked as a duplicate of this bug. *** *** Bug 521580 has been marked as a duplicate of this bug. *** This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle. Changing version to '12'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping No longer using %postun or any scriptlets as we don't do prelink blacklisting. |