summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorNaohiro Aota <naota@gentoo.org>2012-06-21 15:10:59 +0000
committerNaohiro Aota <naota@gentoo.org>2012-06-21 15:10:59 +0000
commit6171aa9e862c722365477c78c8343f12299a33cf (patch)
treece17540c3cd5c6a763eee988a30d3a483a2f0382 /eclass
parentStable for HPPA (bug #417999). (diff)
downloadgentoo-2-6171aa9e862c722365477c78c8343f12299a33cf.tar.gz
gentoo-2-6171aa9e862c722365477c78c8343f12299a33cf.tar.bz2
gentoo-2-6171aa9e862c722365477c78c8343f12299a33cf.zip
Add new function gnome2_query_immodules_gtk{2,3} to update immodules cache. #413529
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/gnome2-utils.eclass40
2 files changed, 44 insertions, 2 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 8e8f899ed0c0..8bbd887ea1fa 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.321 2012/06/20 09:26:50 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.322 2012/06/21 15:10:59 naota Exp $
+
+ 21 Jun 2012; Naohiro Aota <naota@gentoo.org> gnome2-utils.eclass:
+ Add new function gnome2_query_immodules_gtk{2,3} to update immodules cache.
+ #413529
20 Jun 2012; Michał Górny <mgorny@gentoo.org> eutils.eclass:
prune_libtool_files(): report .a removal only if it exists, and explain the
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index ace8b207a688..4dcee9860c51 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/gnome2-utils.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.27 2012/05/02 21:05:38 eva Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.28 2012/06/21 15:10:59 naota Exp $
# @ECLASS: gnome2-utils.eclass
# @MAINTAINER:
@@ -386,3 +386,41 @@ gnome2_schemas_update() {
${updater} --allow-any-name "$@" "${EROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
eend $?
}
+
+# @FUNCTION: gnome2_query_immodules_gtk2
+# @USAGE: gnome2_query_immodules_gtk2
+# @DESCRIPTION:
+# Updates gtk2 immodules/gdk-pixbuf loaders listing.
+gnome2_query_immodules_gtk2() {
+ local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)"
+
+ local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0"
+ local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules"
+ local gtk_conf_dir=$(dirname "${gtk_conf}")
+
+ einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:"
+ einfo "-> ${gtk_conf}"
+
+ mkdir -p "${gtk_conf_dir}"
+ local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules)
+ if [ -z "${tmp_file}" ]; then
+ ewarn "gtk_query_immodules: cannot create temporary file"
+ return 1
+ fi
+
+ if ${query_exec} > "${tmp_file}"; then
+ cat "${tmp_file}" > "${gtk_conf}" || \
+ ewarn "Failed to write to ${gtk_conf}"
+ else
+ ewarn "Cannot update gtk.immodules, file generation failed"
+ fi
+ rm "${tmp_file}"
+}
+
+# @FUNCTION: gnome2_query_immodules_gtk3
+# @USAGE: gnome2_query_immodules_gtk3
+# @DESCRIPTION:
+# Updates gtk3 immodules/gdk-pixbuf loaders listing.
+gnome2_query_immodules_gtk3() {
+ "${EPREFIX}/usr/bin/gtk-query-immodules-3.0" --update-cache
+}