summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorJonathan Callen <abcd@gentoo.org>2010-06-22 23:36:47 -0400
committerJonathan Callen <abcd@gentoo.org>2010-06-23 17:10:45 -0400
commit1001c3852d2814d2786c84578045f7046500df7c (patch)
tree4a45973d0be62854910b059985c26210f4685d1a /eclass
parenteclass: add gnome2.eclass and gnome2-utils.eclass from tree (diff)
downloadgnome-1001c3852d2814d2786c84578045f7046500df7c.tar.gz
gnome-1001c3852d2814d2786c84578045f7046500df7c.tar.bz2
gnome-1001c3852d2814d2786c84578045f7046500df7c.zip
eclass: add gsettings support to gnome2.eclass
Diffstat (limited to 'eclass')
-rw-r--r--eclass/gnome2-utils.eclass24
-rw-r--r--eclass/gnome2.eclass3
2 files changed, 27 insertions, 0 deletions
diff --git a/eclass/gnome2-utils.eclass b/eclass/gnome2-utils.eclass
index 7f9ef898..4c7d4f36 100644
--- a/eclass/gnome2-utils.eclass
+++ b/eclass/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 c67eb846..4a8d147c 100644
--- a/eclass/gnome2.eclass
+++ b/eclass/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