summaryrefslogtreecommitdiff
path: root/autoscripts
diff options
context:
space:
mode:
authorjoeyh <joeyh>2007-07-08 22:16:15 +0000
committerjoeyh <joeyh>2007-07-08 22:16:15 +0000
commit780fefcdcfd21f335378899f2e20d92978b476e7 (patch)
tree8b31dea658bc3c86e5b55932c137dfaa855e6dd9 /autoscripts
parent02f72dd6d954aa64c5a617cc7fb1647cbefd6562 (diff)
r2010: * dh_icons: New program to update Freedesktop icon caches. Thanks
to Josselin Mouette, Ross Burton, Jordi Mallach, and Loïc Minier. Closes: #329460 * Note that as a transitional measure, dh_icons will currently only update existing caches, and not create and new caches. Once everything is updating the icon caches, this will be changed. See #329460 for the full plan.
Diffstat (limited to 'autoscripts')
-rw-r--r--autoscripts/postinst-icons7
-rw-r--r--autoscripts/postrm-icons15
2 files changed, 22 insertions, 0 deletions
diff --git a/autoscripts/postinst-icons b/autoscripts/postinst-icons
new file mode 100644
index 0000000..3c018b3
--- /dev/null
+++ b/autoscripts/postinst-icons
@@ -0,0 +1,7 @@
+if which gtk-update-icon-cache >/dev/null 2>&1; then
+ for dir in #DIRLIST#; do
+ if [ -f "$dir"/icon-theme.cache ]; then
+ gtk-update-icon-cache --force --quiet "$dir"
+ fi
+ done
+fi
diff --git a/autoscripts/postrm-icons b/autoscripts/postrm-icons
new file mode 100644
index 0000000..3765560
--- /dev/null
+++ b/autoscripts/postrm-icons
@@ -0,0 +1,15 @@
+if [ "$1" = "remove" ]; then
+ for dir in #DIRLIST#; do
+ if [ -d "$dir" ]; then
+ if [ -f "$dir"/index.theme ] && \
+ [ -f "$dir"/icon-theme.cache ] && \
+ which gtk-update-icon-cache >/dev/null 2>&1
+ then
+ gtk-update-icon-cache --force --quiet "$dir"
+ else
+ rm -f "$dir"/icon-theme.cache
+ rmdir -p --ignore-fail-on-non-empty "$dir"
+ fi
+ fi
+ done
+fi