/[gentoo-x86]/eclass/gnome2-utils.eclass
Gentoo

Diff of /eclass/gnome2-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.12 Revision 1.17
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.12 2008/10/19 10:35:58 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
12# 12#
13 13
14 14
15 15
16# Path to gconftool-2 16# Path to gconftool-2
17: ${GCONFTOOL_BIN:="${ROOT}usr/bin/gconftool-2"} 17: ${GCONFTOOL_BIN:="/usr/bin/gconftool-2"}
18 18
19# Directory where scrollkeeper-update should do its work 19# Directory where scrollkeeper-update should do its work
20: ${SCROLLKEEPER_DIR:="${ROOT}var/lib/scrollkeeper"} 20: ${SCROLLKEEPER_DIR:="/var/lib/scrollkeeper"}
21 21
22# Path to scrollkeeper-update 22# Path to scrollkeeper-update
23: ${SCROLLKEEPER_UPDATE_BIN:="${ROOT}usr/bin/scrollkeeper-update"} 23: ${SCROLLKEEPER_UPDATE_BIN:="/usr/bin/scrollkeeper-update"}
24
25# Path to gtk-update-icon-cache
26: ${GTK_UPDATE_ICON_CACHE:="/usr/bin/gtk-update-icon-cache"}
27
28# Path to glib-compile-schemas
29: ${GLIB_COMPILE_SCHEMAS:="/usr/bin/glib-compile-schemas"}
24 30
25 31
26 32
27DEPEND=">=sys-apps/sed-4" 33DEPEND=">=sys-apps/sed-4"
28 34
38 44
39 45
40# 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
41# using gconftool-2 47# using gconftool-2
42gnome2_gconf_install() { 48gnome2_gconf_install() {
43 local F 49 local updater="${ROOT}${GCONFTOOL_BIN}"
44 50
45 if [[ ! -x "${GCONFTOOL_BIN}" ]]; then 51 if [[ ! -x "${updater}" ]]; then
52 debug-print "${updater} is not executable"
46 return 53 return
47 fi 54 fi
48 55
49 if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then 56 if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
50 einfo "No GNOME 2 GConf schemas found" 57 debug-print "No GNOME 2 GConf schemas found"
51 return 58 return
52 fi 59 fi
53 60
54 # We are ready to install the GCONF Scheme now 61 # We are ready to install the GCONF Scheme now
55 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL 62 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
56 export GCONF_CONFIG_SOURCE="$("${GCONFTOOL_BIN}" --get-default-source | sed "s;:/;:${ROOT};")" 63 export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")"
57 64
58 einfo "Installing GNOME 2 GConf schemas" 65 einfo "Installing GNOME 2 GConf schemas"
59 66
67 local F
60 for F in ${GNOME2_ECLASS_SCHEMAS}; do 68 for F in ${GNOME2_ECLASS_SCHEMAS}; do
61 if [[ -e "${ROOT}${F}" ]]; then 69 if [[ -e "${ROOT}${F}" ]]; then
62 # echo "DEBUG::gconf install ${F}" 70 debug-print "Installing schema: ${F}"
63 "${GCONFTOOL_BIN}" --makefile-install-rule "${ROOT}${F}" 1>/dev/null 71 "${updater}" --makefile-install-rule "${ROOT}${F}" 1>/dev/null
64 fi 72 fi
65 done 73 done
66 74
67 # have gconf reload the new schemas 75 # have gconf reload the new schemas
68 pids=$(pgrep -x gconfd-2) 76 pids=$(pgrep -x gconfd-2)
75 83
76 84
77# 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
78# database. 86# database.
79gnome2_gconf_uninstall() { 87gnome2_gconf_uninstall() {
88 local updater="${ROOT}${GCONFTOOL_BIN}"
89
90 if [[ ! -x "${updater}" ]]; then
91 debug-print "${updater} is not executable"
92 return
93 fi
94
95 if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
96 debug-print "No GNOME 2 GConf schemas found"
97 return
98 fi
99
100 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
101 export GCONF_CONFIG_SOURCE="$("${updater}" --get-default-source | sed "s;:/;:${ROOT};")"
102
103 einfo "Uninstalling GNOME 2 GConf schemas"
104
80 local F 105 local F
81
82 if [[ ! -x "${GCONFTOOL_BIN}" ]]; then
83 return
84 fi
85
86 if [[ -z "${GNOME2_ECLASS_SCHEMAS}" ]]; then
87 einfo "No GNOME 2 GConf schemas found"
88 return
89 fi
90
91 unset GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
92 export GCONF_CONFIG_SOURCE=$("${GCONFTOOL_BIN}" --get-default-source | sed "s;:/;:${ROOT};")
93
94 einfo "Uninstalling GNOME 2 GConf schemas"
95
96 for F in ${GNOME2_ECLASS_SCHEMAS}; do 106 for F in ${GNOME2_ECLASS_SCHEMAS}; do
97 if [[ -e "${ROOT}${F}" ]]; then 107 if [[ -e "${ROOT}${F}" ]]; then
98 # echo "DEBUG::gconf uninstall ${F}" 108 debug-print "Uninstalling gconf schema: ${F}"
99 "${GCONFTOOL_BIN}" --makefile-uninstall-rule "${ROOT}${F}" 1>/dev/null 109 "${updater}" --makefile-uninstall-rule "${ROOT}${F}" 1>/dev/null
100 fi 110 fi
101 done 111 done
102 112
103 # have gconf reload the new schemas 113 # have gconf reload the new schemas
104 pids=$(pgrep -x gconfd-2) 114 pids=$(pgrep -x gconfd-2)
121 131
122 132
123# Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild 133# Updates Gtk+ icon cache files under /usr/share/icons if the current ebuild
124# have installed anything under that location. 134# have installed anything under that location.
125gnome2_icon_cache_update() { 135gnome2_icon_cache_update() {
126 local updater="$(type -p gtk-update-icon-cache 2> /dev/null)" 136 local updater="${ROOT}${GTK_UPDATE_ICON_CACHE}"
127 137
128 if [[ ! -x "${updater}" ]] ; then 138 if [[ ! -x "${updater}" ]] ; then
129 debug-print "${updater} is not executable" 139 debug-print "${updater} is not executable"
130 return 140 return
131 fi 141 fi
132 142
133 if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then 143 if [[ -z "${GNOME2_ECLASS_ICONS}" ]]; then
144 debug-print "No icon cache to update"
134 return 145 return
135 fi 146 fi
136
137 147
138 ebegin "Updating icons cache" 148 ebegin "Updating icons cache"
139 149
140 local retval=0 150 local retval=0
141 local fails=( ) 151 local fails=( )
214} 224}
215 225
216 226
217# Updates the global scrollkeeper database. 227# Updates the global scrollkeeper database.
218gnome2_scrollkeeper_update() { 228gnome2_scrollkeeper_update() {
219 if [[ -x "${SCROLLKEEPER_UPDATE_BIN}" ]]; then 229 if [[ -x "${ROOT}${SCROLLKEEPER_UPDATE_BIN}" ]]; then
220 einfo "Updating scrollkeeper database ..." 230 einfo "Updating scrollkeeper database ..."
221 "${SCROLLKEEPER_UPDATE_BIN}" -q -p "${SCROLLKEEPER_DIR}" 231 "${ROOT}${SCROLLKEEPER_UPDATE_BIN}" -q -p "${ROOT}${SCROLLKEEPER_DIR}"
222 fi 232 fi
223} 233}
234
235gnome2_schemas_savelist() {
236 pushd "${D}" &>/dev/null
237 export GNOME2_ECLASS_GLIB_SCHEMAS=$(find 'usr/share/glib-2.0/schemas' -name '*.gschema.xml' 2>/dev/null)
238 popd &>/dev/null
239}
240
241gnome2_schemas_update() {
242 local updater="${ROOT}${GLIB_COMPILE_SCHEMAS}"
243
244 if [[ ! -x ${updater} ]]; then
245 debug-print "${updater} is not executable"
246 return
247 fi
248
249 if [[ -z ${GNOME2_ECLASS_GLIB_SCHEMAS} ]]; then
250 debug-print "No GSettings schemas to update"
251 return
252 fi
253
254 ebegin "Updating GSettings schemas"
255 ${updater} --allow-any-name "$@" "${ROOT%/}/usr/share/glib-2.0/schemas" &>/dev/null
256 eend $?
257}

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.17

  ViewVC Help
Powered by ViewVC 1.1.20