[Frugalware-git] frugalware: update-desktop-database: add pacman hook for updating application mime cache
James Buren
ryuo at frugalware.org
Sun Jun 17 00:36:44 CEST 2012
Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware.git;a=commitdiff;h=2f0ad62867f46c0b185ccadf6e9e08219de5ff2f
commit 2f0ad62867f46c0b185ccadf6e9e08219de5ff2f
Author: James Buren <ryuo at frugalware.org>
Date: Sat Jun 16 10:36:29 2012 -0500
update-desktop-database: add pacman hook for updating application mime cache
diff --git a/etc/update-desktop-database b/etc/update-desktop-database
new file mode 100644
index 0000000..ac11cd8
--- /dev/null
+++ b/etc/update-desktop-database
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+post_pkginstall()
+{
+ # If there is no applications directory, there is nothing to do.
+ [ -d '/usr/share/applications' ] || return
+
+ # If there is no update utility, there is nothing to do.
+ [ -x '/usr/bin/update-desktop-database' ] || return
+
+ /usr/bin/update-desktop-database /usr/share/applications &> /dev/null
+}
+
+post_pkgremove()
+{
+ post_pkginstall
+}
+
+op=$1
+shift
+$op $*
More information about the Frugalware-git
mailing list