gtk-icon-cache (959B)
1#!/bin/sh 2# 3# Updates GTK+ icon cache file with gtk-update-icon-cache(1). 4# 5# Arguments: $ACTION = [run/targets] 6# $TARGET = [post-install/post-remove] 7# $PKGNAME 8# $VERSION 9# $UPDATE = [yes/no] 10# 11ACTION="$1" 12TARGET="$2" 13PKGNAME="$3" 14VERSION="$4" 15UPDATE="$5" 16 17iconcache_bin=usr/bin/gtk-update-icon-cache 18 19case "$ACTION" in 20targets) 21 echo "post-install post-remove" 22 ;; 23run) 24 if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then 25 for dir in ${gtk_iconcache_dirs}; do 26 if [ -f .${dir}/icon-theme.cache ]; then 27 rm -f .${dir}/icon-theme.cache 28 echo -n "Removed GTK+ icon theme " 29 echo "cache for ${dir}." 30 fi 31 done 32 exit 0 33 fi 34 35 if [ ! -x $iconcache_bin ]; then 36 exit 0 37 fi 38 39 case "$TARGET" in 40 post-*) 41 for dir in ${gtk_iconcache_dirs}; do 42 if [ -d ".${dir}" ]; then 43 echo -n "Updating GTK+ icon cache for " 44 echo "${dir}..." 45 ${iconcache_bin} -q -f -t .${dir} 46 fi 47 done 48 ;; 49 esac 50 ;; 51*) 52 exit 1 53 ;; 54esac 55 56exit 0