gtk3-immodules (919B)
1#!/bin/sh 2# 3# Updates GTK+3 IM modules file with gtk-query-immodules-3.0(1). 4# 5# Arguments: $ACTION = [run/targets] 6# $TARGET = [post-install/post-remove] 7# $PKGNAME 8# $VERSION 9# $UPDATE = [yes/no] 10# 11ACTION="$1" 12TARGET="$2" 13PKGNAME="$3" 14VERSION="$4" 15UPDATE="$5" 16 17immodules_bin=usr/bin/gtk-query-immodules-3.0 18immodules_cache=usr/lib/gtk-3.0/3.0.0/immodules.cache 19 20case "$ACTION" in 21targets) 22 echo "post-install post-remove" 23 ;; 24run) 25 if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+3" ]; then 26 [ -f ${immodules_cache} ] && rm -f ${immodules_cache} 27 exit 0 28 fi 29 case "$TARGET" in 30 post-*) 31 if [ -f etc/gtk-3.0/gtk.immodules ]; then 32 echo "Removing obsolete conf file: etc/gtk-3.0/gtk.immodules" 33 rm -f etc/gtk-3.0/gtk.immodules 34 fi 35 36 if [ ! -x $immodules_bin ]; then 37 exit 0 38 fi 39 40 echo "Updating GTK+3 immodules cache..." 41 $immodules_bin --update-cache 42 ;; 43 esac 44 ;; 45*) 46 exit 1 47 ;; 48esac 49 50exit 0