diff --git a/shutils/metadata_scripts.sh b/shutils/metadata_scripts.sh index 2f2e05fb30..7604ea455d 100644 --- a/shutils/metadata_scripts.sh +++ b/shutils/metadata_scripts.sh @@ -90,6 +90,15 @@ _EOF echo >> $tmpf fi + # + # Handle GTK+ Icon cache directories. + # + if [ -n "${gtk_iconcache_dirs}" ]; then + echo "export gtk_iconcache_dirs=\"${gtk_iconcache_dirs}\"" \ + >> $tmpf + echo >> $tmpf + fi + if [ -n "$triggers" ]; then found=1 echo "case \"\${ACTION}\" in" >> $tmpf diff --git a/shutils/tmpl_funcs.sh b/shutils/tmpl_funcs.sh index a7d5825db0..f80591f542 100644 --- a/shutils/tmpl_funcs.sh +++ b/shutils/tmpl_funcs.sh @@ -71,7 +71,7 @@ reset_tmpl_vars() build_depends libtool_fixup_la_stage no_fixup_libtool \ disable_parallel_build run_depends cross_compiler \ only_for_archs patch_args conf_files keep_dirs \ - noarch subpackages sourcepkg \ + noarch subpackages sourcepkg gtk_iconcache_dirs \ abi_depends api_depends triggers \ XBPS_EXTRACT_DONE XBPS_CONFIGURE_DONE \ XBPS_BUILD_DONE XBPS_INSTALL_DONE FILESDIR DESTDIR \ diff --git a/triggers/gtk-icon-cache b/triggers/gtk-icon-cache index 9fdc828cf1..ecb7283127 100755 --- a/triggers/gtk-icon-cache +++ b/triggers/gtk-icon-cache @@ -9,7 +9,6 @@ # trigger="gtk-icon-cache" iconcache_bin=./usr/bin/gtk-update-icon-cache -iconcache_dir=./usr/share/icons/hicolor case "$1" in targets) @@ -20,10 +19,18 @@ run) case "$2" in post-*) - if [ -x ${iconcache_bin} ]; then - echo "Updating GTK's icon cache themes..." - ${iconcache_bin} -f -t ${iconcache_dir} - fi + 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 ;;