# $Id$ xdg_update_icon_resource() { local themes if [[ ${MROOT} != / ]] && [[ ! -z ${MROOT} ]] then echo "Not updating icon cache in MROOT='${MROOT}'," echo "you need to update it by yourself later" return 0 fi if [ -x $(type -P xdg-icon-resource) ] then if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/icons ] then echo "Searching icon directories ..." pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null themes=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d -printf '%f\n' 2> /dev/null) popd &> /dev/null else themes="hicolor" fi # abort here, if no themes where found [[ -z ${themes} ]] && return echo "Updating xdg icon cache ..." local i for i in ${themes} do if [[ -f /usr/share/icons/${i}/index.theme ]] then xdg-icon-resource forceupdate --theme ${i} fi done else echo "xdg-icon-resource was not found, icon cache not updated" fi }