gnome2-utils.eclass: add gnome2_giomodule_cache_update function, bug #518422
authorGilles Dartiguelongue <eva@gentoo.org>
Sat, 2 Jan 2016 14:12:43 +0000 (15:12 +0100)
committerGilles Dartiguelongue <eva@gentoo.org>
Sat, 2 Jan 2016 15:41:06 +0000 (16:41 +0100)
eclass/gnome2-utils.eclass

index 94ec32c6a87e47fb6d5cfc9dd268ab8001a61359..05ddf24c27fa6eada657027058151e3044512f7f 100644 (file)
@@ -460,6 +460,29 @@ gnome2_query_immodules_gtk3() {
        eend $?
 }
 
+# @FUNCTION: gnome2_giomodule_cache_update
+# @USAGE: gnome2_giomodule_cache_update
+# @DESCRIPTION:
+# Updates glib's gio modules cache.
+# This function should be called from pkg_postinst and pkg_postrm.
+gnome2_giomodule_cache_update() {
+       has ${EAPI:-0} 0 1 2 && ! use prefix && EROOT="${ROOT}"
+       local updater="${EROOT}/usr/bin/${CHOST}-gio-querymodules"
+
+       if [[ ! -x ${updater} ]]; then
+               updater="${EROOT}/usr/bin/gio-querymodules"
+       fi
+
+       if [[ ! -x ${updater} ]]; then
+               debug-print "${updater} is not executable"
+               return
+       fi
+
+       ebegin "Updating GIO modules cache"
+       ${updater} "${EROOT%/}"/usr/$(get_libdir)/gio/modules
+       eend $?
+}
+
 # @FUNCTION: gnome2_disable_deprecation_warning
 # @DESCRIPTION:
 # Disable deprecation warnings commonly found in glib based packages.