void-packages/triggers/gtk-icon-cache
Juan RP cad15bd3d2 Introduce $gtk_iconcache_dirs to fix the gtk-icon-cache trigger.
--HG--
extra : convert_revision : 1be7864a5554fd3779092adcdf1e9410be5d55a9
2009-04-20 01:20:31 +02:00

42 lines
777 B
Bash
Executable file

#!/bin/sh
#
# Updates GTK+ icon cache file with gtk-update-icon-cache(1).
#
# Arguments: $1 = action [run/targets]
# $2 = target [post-install/post-remove]
# $3 = pkgname
# $4 = version
#
trigger="gtk-icon-cache"
iconcache_bin=./usr/bin/gtk-update-icon-cache
case "$1" in
targets)
echo "post-install post-remove"
;;
run)
echo "Running $trigger trigger..."
case "$2" in
post-*)
for dir in ${gtk_iconcache_dirs}; do
if [ -f ${dir}/icon-theme.cache ]; then
rm -f ${dir}/icon-theme.cache
echo "Removed GTK+ icon theme cache for ${dir}."
fi
if [ -x ${iconcache_bin} ]; then
echo -n "Updating GTK+ icon cache for "
echo -n "${dir}... "
${iconcache_bin} -q -f -t ${dir}
echo "done."
fi
done
;;
esac
;;
*)
exit 1
;;
esac
exit 0