Currently, http://fedoraproject.org/wiki/Packaging/ScriptletSnippets#head-7103f6c38d1b5... recommends including scriptlet: %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : but *not* adding any Requires: for this.
A consequence is that when/if gtk-update-icon-cache is not available, the existing scriptlet generates error output.
2 fixes come to mind: 1. ignore all output: (line wrapped) %{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor \ >& /dev/null || :
2. wrap, allow for real errors to display: if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||: fi
Any opinions on which approach (1 or 2 or other) is a preferred solution here?
Myself, I'd lean toward 1 (it's shorter), unless there's value in seeing possible error output from gtk-update-icon-cache.
-- Rex
p.s. Looking closer, it appears option 2 was in place at one time, but was removed via http://fedoraproject.org/wiki/Packaging/ScriptletSnippets?action=diff&re... with comment: Remove extraneous if [ -x PROGRAM ] (Not needed if the scriptlet also uses ||:)
Rex Dieter wrote:
Currently, http://fedoraproject.org/wiki/Packaging/ScriptletSnippets#head-7103f6c38d1b5... recommends including scriptlet: %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || : but *not* adding any Requires: for this.
Odd...
A consequence is that when/if gtk-update-icon-cache is not available, the existing scriptlet generates error output.
2 fixes come to mind:
- ignore all output: (line wrapped)
%{_bindir}/gtk-update-icon-cache %{_datadir}/icons/hicolor \ >& /dev/null || :
- wrap, allow for real errors to display:
if [ -x %{_bindir}/gtk-update-icon-cache ]; then %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor ||: fi
We have been following this 2 for most packages. well there is a requires touch operation above it, so KDE will picks up the new icons if gtk-update-icon-cache isn't installed.
Any opinions on which approach (1 or 2 or other) is a preferred solution here?
There is a lot of prior art for 2.
p.s. Looking closer, it appears option 2 was in place at one time, but was removed via http://fedoraproject.org/wiki/Packaging/ScriptletSnippets?action=diff&re... with comment: Remove extraneous if [ -x PROGRAM ] (Not needed if the scriptlet also uses ||:)
Ah, okay. Yea, so I would just revert that change. But really we should just get it out of post and rpm should run it automatically if an icon gets installed. I guess there isn't really an hooks to do that now, though.
--Ray
Ray Strode wrote:
Rex Dieter wrote:
p.s. Looking closer, it appears option 2 was in place at one time, but was removed via
http://fedoraproject.org/wiki/Packaging/ScriptletSnippets?action=diff&re...
with comment: Remove extraneous if [ -x PROGRAM ] (Not needed if the scriptlet also uses ||:)
Ah, okay. Yea, so I would just revert that change.
fyi, reverted.
-- Rex
desktop@lists.fedoraproject.org