Bug 259041

Summary: fonts-japanese %postun script is setup for a failure and it fails
Product: [Fedora] Fedora Reporter: Michal Jaegermann <michal>
Component: fonts-japaneseAssignee: Akira TAGOH <tagoh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: rawhideCC: eng-i18n-bugs, petersen
Target Milestone: ---Keywords: i18n
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-10-02 06:01: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:

Description Michal Jaegermann 2007-08-28 04:35:08 UTC
Description of problem:

'rpm -q --scripts fonts-japanese' produces this:

postinstall scriptlet (using /bin/sh):
{
    umask 133
    [ -x /usr/bin/fc-cache ] && /usr/bin/fc-cache /usr/share/fonts
}
postuninstall scriptlet (using /bin/sh):
{
    umask 133
    [ "$1" = "0" -a -x /usr/bin/fc-cache ] && /usr/bin/fc-cache /usr/share/fonts
}

The problem is that when '"$1" = "0"' term fails then the whole thing
returns with an error code as '|| :' is not there.  Another failure will
happen if '[ -x /usr/bin/fc-cache ]' will not end up as "true".

Due to the above in updates one gets:

  Cleanup   : fonts-japanese               ######################### [4/4]
error: %postun(fonts-japanese-0.20061016-9.fc8.noarch) scriptlet failed, exit
status 1

resuliting in duplicates which have to be removed with
'rpm -e --noscripts ....' (and file conflicts if you will try
to upgrade to 0.20061016-10.fc8 while both 0.20061016-9.fc8
and 0.20061016-8.fc8 are still present).

Version-Release number of selected component (if applicable):
fonts-japanese-0.20061016-10.fc8 and earlier

How reproducible:
always

Comment 1 Jens Petersen 2007-08-28 05:11:15 UTC
Thanks for the report.

I basically reproduced this I think, but I still wonder understand
why the postun script started to fail now though.


Comment 2 Jens Petersen 2007-08-28 06:30:29 UTC
(In reply to comment #1)
> I still wonder understand why the postun script started to fail now though.

Nevermind reproduced easily with a test shellscript.

Thanks again for reporting this, Michal, and for the clear explanation.

I updated fonts-japanese and sazanami-fonts now to use the standard
fedora fonts scriptlets.  Of course we can't fix the broken %postun
in the older packages unfortunately...