| 1 | # Copyright 1999-2006 Gentoo Foundation |
1 | # Copyright 1999-2006 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.16 2010/12/07 06:23:34 eva Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.17 2010/12/07 06:25:23 eva Exp $ |
| 4 | |
4 | |
| 5 | # |
5 | # |
| 6 | # gnome2-utils.eclass |
6 | # gnome2-utils.eclass |
| 7 | # |
7 | # |
| 8 | # Set of auxiliary functions used to perform actions commonly needed by packages |
8 | # Set of auxiliary functions used to perform actions commonly needed by packages |
| … | |
… | |
| 45 | |
45 | |
| 46 | # Applies any schema files installed by the current ebuild to Gconf's database |
46 | # Applies any schema files installed by the current ebuild to Gconf's database |
| 47 | # using gconftool-2 |
47 | # using gconftool-2 |
| 48 | gnome2_gconf_install() { |
48 | gnome2_gconf_install() { |
| 49 | local updater="${ROOT}${GCONFTOOL_BIN}" |
49 | local updater="${ROOT}${GCONFTOOL_BIN}" |
| 50 | local F |
|
|
| 51 | |
50 | |
| 52 | if [[ ! -x "${updater}" ]]; then |
51 | if [[ ! -x "${updater}" ]]; then |
|
|
52 | debug-print "${updater} is not executable" |
| 53 | return |
53 | return |
| 54 | fi |
54 | fi |
| 55 | |
55 | |
| 56 | if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then |
56 | if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then |
| 57 | einfo "No GNOME 2 GConf schemas found" |
57 | debug-print "No GNOME 2 GConf schemas found" |
| 58 | return |
58 | return |
| 59 | fi |
59 | fi |
| 60 | |
60 | |
| 61 | # We are ready to install the GCONF Scheme now |
61 | # We are ready to install the GCONF Scheme now |
| 62 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
62 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
| 63 | export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" |
63 | export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" |
| 64 | |
64 | |
| 65 | einfo "Installing GNOME 2 GConf schemas" |
65 | einfo "Installing GNOME 2 GConf schemas" |
| 66 | |
66 | |
|
|
67 | local F |
| 67 | for F in ${GNOME2_ECLASS_SCHEMAS}; do |
68 | for F in ${GNOME2_ECLASS_SCHEMAS}; do |
| 68 | if [[ -e "${ROOT}${F}" ]]; then |
69 | if [[ -e "${ROOT}${F}" ]]; then |
| 69 | # echo "DEBUG::gconf install ${F}" |
70 | debug-print "Installing schema: ${F}" |
| 70 | "${updater}" --makefile-install-rule "${ROOT}${F}" 1>/dev/null |
71 | "${updater}" --makefile-install-rule "${ROOT}${F}" 1>/dev/null |
| 71 | fi |
72 | fi |
| 72 | done |
73 | done |
| 73 | |
74 | |
| 74 | # have gconf reload the new schemas |
75 | # have gconf reload the new schemas |
| … | |
… | |
| 83 | |
84 | |
| 84 | # Removes schema files previously installed by the current ebuild from Gconf's |
85 | # Removes schema files previously installed by the current ebuild from Gconf's |
| 85 | # database. |
86 | # database. |
| 86 | gnome2_gconf_uninstall() { |
87 | gnome2_gconf_uninstall() { |
| 87 | local updater="${ROOT}${GCONFTOOL_BIN}" |
88 | local updater="${ROOT}${GCONFTOOL_BIN}" |
| 88 | local F |
|
|
| 89 | |
89 | |
| 90 | if [[ ! -x "${updater}" ]]; then |
90 | if [[ ! -x "${updater}" ]]; then |
|
|
91 | debug-print "${updater} is not executable" |
| 91 | return |
92 | return |
| 92 | fi |
93 | fi |
| 93 | |
94 | |
| 94 | if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then |
95 | if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then |
| 95 | einfo "No GNOME 2 GConf schemas found" |
96 | debug-print "No GNOME 2 GConf schemas found" |
| 96 | return |
97 | return |
| 97 | fi |
98 | fi |
| 98 | |
99 | |
| 99 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
100 | unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL |
| 100 | export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" |
101 | export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")" |
| 101 | |
102 | |
| 102 | einfo "Uninstalling GNOME 2 GConf schemas" |
103 | einfo "Uninstalling GNOME 2 GConf schemas" |
| 103 | |
104 | |
|
|
105 | local F |
| 104 | for F in ${GNOME2_ECLASS_SCHEMAS}; do |
106 | for F in ${GNOME2_ECLASS_SCHEMAS}; do |
| 105 | if [[ -e "${ROOT}${F}" ]]; then |
107 | if [[ -e "${ROOT}${F}" ]]; then |
| 106 | # echo "DEBUG::gconf uninstall ${F}" |
108 | debug-print "Uninstalling gconf schema: ${F}" |
| 107 | "${updater}" --makefile-uninstall-rule "${ROOT}${F}" 1>/dev/null |
109 | "${updater}" --makefile-uninstall-rule "${ROOT}${F}" 1>/dev/null |
| 108 | fi |
110 | fi |
| 109 | done |
111 | done |
| 110 | |
112 | |
| 111 | # have gconf reload the new schemas |
113 | # have gconf reload the new schemas |
| … | |
… | |
| 137 | debug-print "${updater} is not executable" |
139 | debug-print "${updater} is not executable" |
| 138 | return |
140 | return |
| 139 | fi |
141 | fi |
| 140 | |
142 | |
| 141 | if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then |
143 | if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then |
|
|
144 | debug-print "No icon cache to update" |
| 142 | return |
145 | return |
| 143 | fi |
146 | fi |
| 144 | |
|
|
| 145 | |
147 | |
| 146 | ebegin "Updating icons cache" |
148 | ebegin "Updating icons cache" |
| 147 | |
149 | |
| 148 | local retval=0 |
150 | local retval=0 |
| 149 | local fails=( ) |
151 | local fails=( ) |
| … | |
… | |
| 243 | debug-print "${updater} is not executable" |
245 | debug-print "${updater} is not executable" |
| 244 | return |
246 | return |
| 245 | fi |
247 | fi |
| 246 | |
248 | |
| 247 | if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then |
249 | if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then |
| 248 | debug-print "no schemas to update" |
250 | debug-print "No GSettings schemas to update" |
| 249 | return |
251 | return |
| 250 | fi |
252 | fi |
| 251 | |
253 | |
| 252 | ebegin "Updating GSettings schemas" |
254 | ebegin "Updating GSettings schemas" |
| 253 | ${updater} --allow-any-name "$@" "${ROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null |
255 | ${updater} --allow-any-name "$@" "${ROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null |