#! /bin/sh if test "$1" = --help ; then echo "Usage: $0" echo "Rebuilds gconf database from scratch using installed schemas." echo "or: $0 OPTION" echo "" echo "Needs root privileges." echo "" echo "These option names may not be abbreviated." echo " --verbose explain what is being done" echo " --help display this help and exit" echo " --version output version information and exit" echo "" echo "Report bugs to http://bugzilla.novell.com/." exit fi if test "$1" = --version ; then echo "gconftool-rebuild 2.0" exit fi if test "$1" = --verbose ; then function vecho { echo "$@" } VERBOSE=" --verbose" UNVERBOSE="" else function vecho { : } VERBOSE="" UNVERBOSE=" >/dev/null" fi if test "$UID" != 0 -a "$USER" != root; then echo "You must be root to start $0." >&2 exit 1 fi vecho "Rebuilding GConf database from scratch..." vecho "" vecho "Removing old database..." rm$VERBOSE -rf /etc/opt/gnome/gconf/gconf.xml.defaults vecho "" vecho "Setting default source..." umask 0022 mkdir$VERBOSE /etc/opt/gnome/gconf/gconf.xml.defaults export GCONF_CONFIG_SOURCE=`/opt/gnome/bin/gconftool-2 --get-default-source` shopt -s nullglob cd /etc/opt/gnome/gconf/schemas vecho "" vecho "Installing database entries from schemas..." for SCHEMAS in /etc/opt/gnome/gconf/schemas/*.schemas ; do eval /opt/gnome/bin/gconftool-2 --makefile-install-rule $SCHEMAS$UNVERBOSE done vecho "" vecho "Installing database entries from entries..." for SCHEMAS in /etc/opt/gnome/gconf/schemas/*.entries ; do eval /opt/gnome/bin/gconftool-2 --direct --config-source=$GCONF_CONFIG_SOURCE --load $SCHEMAS$UNVERBOSE done if test -d /usr/local/etc/gconf/schemas ; then cd /usr/local/etc/gconf/schemas vecho "" vecho "Installing database entries from schemas in /usr/local..." for SCHEMAS in /usr/local/etc/gconf/schemas/*.schemas ; do eval /opt/gnome/bin/gconftool-2 --makefile-install-rule $SCHEMAS$UNVERBOSE done vecho "" vecho "Installing database entries from entries in /usr/local..." for SCHEMAS in /usr/local/etc/gconf/schemas/*.entries ; do eval /opt/gnome/bin/gconftool-2 --direct --config-source=$GCONF_CONFIG_SOURCE --load $SCHEMAS$UNVERBOSE done fi vecho "" vecho "Done."