Bug 475927

Summary: The post install and uninstall scripts use gtk-update-icon-cache without making sure its available
Product: [Fedora] Fedora Reporter: Bruno Wolff III <bruno>
Component: freedroidAssignee: Ville Skyttä <ville.skytta>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 10CC: ville.skytta
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 1.0.2-10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-01 20:14:25 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 Bruno Wolff III 2008-12-11 05:23:01 UTC
Description of problem:
The spec file for freedroid doesn't require coreutils for the post install and post uninstall scripts. This can cause problems during fresh installs or when build live cds.
You can include the following in the spec file to fix this:
Requires(post): coreutils
Requires(postun): coreutils

Version-Release number of selected component (if applicable):
freedroid-1.0.2-9.fc9.i386

How reproducible:
The error can be verified by examining the spec file. The symptoms can show up randomly based on install order.


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Ville Skyttä 2008-12-11 18:51:02 UTC
There's nothing in the package's %post and %postun that would use anything from coreutils as far as I can tell, so adding the dependencies would be wrong.

Comment 2 Bruno Wolff III 2008-12-11 21:22:55 UTC
I did see an error for freedroid when running livecd-creator. I may have mixed up one of the reports as I was going through about a dozen. However there does seem to be an issue.
[bruno@cerberus ~]$ rpm -q --scripts freedroid
postinstall scriptlet (using /bin/sh):
gtk-update-icon-cache -qf /usr/share/icons/hicolor &>/dev/null || :
postuninstall scriptlet (using /bin/sh):
gtk-update-icon-cache -qf /usr/share/icons/hicolor &>/dev/null || :

gtk-update-icon-cache is provided by gtk2 which you dobn't have a requires for.
However what I was told is that one is supposed to test that gtk-update-icon-cache exists and skip the call if it doesn't. That way you don't need gtk2 installed. The idiom for doing this that was recommended to me was:
touch --no-create /usr/share/icons/hicolor
if [ -x /usr/bin/gtk-update-icon-cache ]; then
  /usr/bin/gtk-update-icon-cache --quiet /usr/share/icons/hicolor || :
fi
If you go this route then you need to do post and postun requires on coreutils.
I am not sure how I messed up the report. I was checking scripts, so I shouldn't have seen any coreutils dependency.

Comment 3 Bruno Wolff III 2008-12-12 05:44:57 UTC
Now that I am back home, I found out how I got confused. It was freedroidrpg that used the touch command, rather than freedroid. So I need to file a bug against that package. However freedroid does seem to be doing something nonstandard with its scripts that could cause errors during fresh installs and livecd builds.

Comment 4 Ville Skyttä 2008-12-12 07:43:49 UTC
If the "touch" is required for KDE, then indeed the scripts need some adjustments.  The GTK part is already functionally equivalent to the "recommended" approach.  I'll look into it.

Comment 5 Ville Skyttä 2009-07-01 20:14:25 UTC
The icon cache scriptlets are up to date with current packaging guidelines since 1.0.2-10 (F-11+ at the moment).