diff options
-rw-r--r-- | eclass/gnome2-utils.eclass | 26 | ||||
-rw-r--r-- | eclass/gnome2.eclass | 5 |
2 files changed, 29 insertions, 2 deletions
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass index 7f9ef898ba95..0094968210f6 100644 --- a/eclass/gnome2-utils.eclass +++ b/eclass/gnome2-utils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.13 2008/10/22 21:04:53 eva Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.14 2010/12/07 06:18:55 eva Exp $ # # gnome2-utils.eclass @@ -221,3 +221,27 @@ gnome2_scrollkeeper_update() { "${SCROLLKEEPER_UPDATE_BIN}" -q -p "${SCROLLKEEPER_DIR}" fi } + +gnome2_schemas_savelist() { + pushd "${D}" &>/dev/null + export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null) + popd &>/dev/null +} + +gnome2_schemas_update() { + local updater="$(type -P glib-compile-schemas 2>/dev/null)" + + if [[ ! -x ${updater} ]]; then + debug-print "${updater} is not executable" + return + fi + + if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then + debug-print "no schemas to update" + return + fi + + ebegin "Updating GSettings schemas" + ${updater} --allow-any-name "$@" "${ROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null + eend $? +} diff --git a/eclass/gnome2.eclass b/eclass/gnome2.eclass index c67eb8466d2b..d32aff4410f9 100644 --- a/eclass/gnome2.eclass +++ b/eclass/gnome2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.87 2010/04/26 19:37:25 abcd Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2.eclass,v 1.88 2010/12/07 06:18:55 eva Exp $ # # gnome2.eclass @@ -121,6 +121,7 @@ gnome2_src_install() { gnome2_pkg_preinst() { gnome2_gconf_savelist gnome2_icon_savelist + gnome2_schemas_savelist } gnome2_pkg_postinst() { @@ -128,6 +129,7 @@ gnome2_pkg_postinst() { fdo-mime_desktop_database_update fdo-mime_mime_database_update gnome2_icon_cache_update + gnome2_schemas_update if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then gnome2_scrollkeeper_update @@ -142,6 +144,7 @@ gnome2_pkg_postrm() { fdo-mime_desktop_database_update fdo-mime_mime_database_update gnome2_icon_cache_update + gnome2_schemas_update --uninstall if [[ "${SCROLLKEEPER_UPDATE}" = "1" ]]; then gnome2_scrollkeeper_update |