# $Header: /magellan-cvs/mage/include/gnome2.minc,v 1.13 2008/04/10 21:56:38 niro Exp $ # shall we run scrollkeeper ? (per default no) : ${SCROLLKEEPER_UPDATE="0"} gn2_reload_gconf() { local pids if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] then # have gconf reload the new schemas pids=$(pgrep -x gconfd-2) if [[ $? = 0 ]] then echo "Reloading gconf schemas ..." kill -HUP ${pids} fi fi } gn2_update_gconf() { # first update gconf if [ -x ${MROOT}/usr/bin/gconftool-2 ] then pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null local schemas=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null) popd &> /dev/null # abort here, if no schemas where found [[ -z ${schemas} ]] && return echo "Updating gconf schemas ..." export GCONF_CONFIG_SOURCE=$(${MROOT}/usr/bin/gconftool-2 --get-default-source) local i for i in ${schemas} do # echo "DEBUG::gconf install ${i}" ${MROOT}/usr/bin/gconftool-2 --makefile-install-rule ${MROOT}/${i} 1>/dev/null done gn2_reload_gconf fi } gn2_update_scrollkeeper() { # than run scrollkeeper if [ -x ${MROOT}/usr/bin/scrollkeeper-update ] && [[ ${SCROLLKEEPER_UPDATE} = 1 ]] then echo "Updating scrollkeeper ..." ${MROOT}/usr/bin/scrollkeeper-update -q -p ${MROOT}/var/lib/scrollkeeper fi } gn2_update_desktop_db() { # update desktop db if [ -x ${MROOT}/usr/bin/update-desktop-database ] then echo "Updating desktop mime database ..." ${MROOT}/usr/bin/update-desktop-database -q ${MROOT}/usr/share/applications fi } gn2_update_mime_db() { # update mime db if [ -x ${MROOT}/usr/bin/update-mime-database ] then echo "Updating shared mime info database ..." ${MROOT}/usr/bin/update-mime-database ${MROOT}/usr/share/mime fi } gn2_update_icon_cache() { local icons if [ -x ${MROOT}/usr/bin/gtk-update-icon-cache ] then if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/icons ] then pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null icons=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null) popd &> /dev/null else icons="usr/share/icons/hicolor" fi # abort here, if no icons where found [[ -z ${icons} ]] && return echo "Updating icons cache ..." local i for i in ${icons} do if [[ -f ${MROOT}/${i}/index.theme ]] then ${MROOT}/usr/bin/gtk-update-icon-cache -qf ${MROOT}/${i} fi done fi } gn2_update_schemas() { if [ -x ${MROOT}/usr/bin/glib-compile-schemas ] then echo "Updating glib schemas ..." ${MROOT}/usr/bin/glib-compile-schemas ${MROOT}/usr/share/glib-2.0/schemas fi } gn2_update_gio() { if [ -x ${MROOT}/usr/bin/gio-querymodules ] then echo "Updating glib gio modules ..." ${MROOT}/usr/bin/gio-querymodules ${MROOT}/usr/$(mlibdir)/gio/modules fi } gn2_postinstall() { gn2_update_gconf gn2_update_scrollkeeper gn2_update_schemas gn2_update_gio gn2_update_desktop_db gn2_update_mime_db gn2_update_icon_cache } gn2_postremove() { gn2_update_scrollkeeper gn2_update_schemas gn2_update_gio gn2_update_desktop_db gn2_update_mime_db gn2_update_icon_cache } export_inherits gn2 postinstall postremove