gsettings-schemas (1016B)
1#!/bin/sh 2# 3# GLib's GSettings XML schema files. 4# 5# Arguments: $ACTION = [run/targets] 6# $TARGET = [post-install/pre-remove] 7# $PKGNAME 8# $VERSION 9# $UPDATE = [yes/no] 10# 11ACTION="$1" 12TARGET="$2" 13PKGNAME="$3" 14VERSION="$4" 15UPDATE="$5" 16 17# The glib-compile-schemas binary program. 18GSCHEMASCOMP="usr/bin/glib-compile-schemas" 19 20# Where .schemas files go. 21GLIB_SCHEMAS_DIR="usr/share/glib-2.0/schemas" 22 23case "$ACTION" in 24targets) 25 echo "post-install post-remove pre-remove" 26 ;; 27run) 28 if [ ! -x "$GSCHEMASCOMP" ]; then 29 exit 0 30 fi 31 32 case "$TARGET" in 33 post-*) 34 [ ! -d ${GLIB_SCHEMAS_DIR} ] && exit 0 35 # Compile all GSettings schema files. 36 echo -n "Refreshing GSettings database from " 37 echo -n "${GLIB_SCHEMAS_DIR}... " 38 ${GSCHEMASCOMP} ${GLIB_SCHEMAS_DIR} 39 if [ $? -eq 0 ]; then 40 echo "done." 41 else 42 echo "failed!" 43 fi 44 ;; 45 pre-remove) 46 if [ "${PKGNAME}" = "glib" ]; then 47 rm -f ${GLIB_SCHEMAS_DIR}/*.compiled 48 echo "Removed GSettings database file." 49 fi 50 ;; 51 esac 52 ;; 53*) 54 exit 1 55 ;; 56esac 57 58exit 0