gtk2/SuSEconfig.gtk2
Vincent Untz da8b1773b0 Accepting request 46189 from home:vuntz:branches:GNOME:Factory
Copy from home:vuntz:branches:GNOME:Factory/gtk2 via accept of submit request 46189 revision 2.
Request was accepted with message:
ok

OBS-URL: https://build.opensuse.org/request/show/46189
OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/gtk2?expand=0&rev=114
2010-08-25 11:10:17 +00:00

48 lines
1.3 KiB
Bash

#! /bin/sh
# Copyright (c) 2002 SuSE Gmbh Nuernberg, Germany. All rights reserved.
#
# Author: Holger Hetterich <hhetter@suse.de>, 2002
#
#
# check if we are started as root
# only one of UID and USER must be set correctly
if test "$UID" != 0 -a "$USER" != root; then
echo "You must be root to start $0."
exit 1
fi
test -n "$ROOT" && exit 0
# Remove all old icon cache files to prevent keeping of empty
# directories with icon-theme.cache after removing themes.
if test -f $r/var/cache/gtk-2.0/icon-theme.cache-list ; then
for DIR in $(<$r/var/cache/gtk-2.0/icon-theme.cache-list) ; do
if test $(ls -1 "$DIR" | wc --lines) -le 1 -a -f $DIR/icon-theme.cache; then
rm -f $DIR/icon-theme.cache
rmdir --ignore-fail-on-non-empty "$DIR"
fi
done
rm /var/cache/gtk-2.0/icon-theme.cache-list
fi
# Update icon cache.
(
# Ensure, that $XDG_DATA_DIRS is set properly. (#71978, #240603)
if test "$PROFILEREAD" != true ; then
. $r/etc/profile
fi
IFS="$IFS:"
for DIR in ${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} ; do
for SUBDIR in $DIR/icons/* ; do
if test ! -L "$SUBDIR" -a -d "$SUBDIR" ; then
/usr/bin/gtk-update-icon-cache --quiet --ignore-theme-index "$SUBDIR"
if test -f $SUBDIR/icon-theme.cache ; then
echo $SUBDIR >>$r/var/cache/gtk-2.0/icon-theme.cache-list
fi
fi
done
done
)
exit 0