r.immodules revision 7038
252N/A#!/bin/sh
252N/A#
252N/A# Class Action Script for installing input method modules for libgtk
252N/A#
252N/A# CDDL HEADER START
252N/A#
252N/A# The contents of this file are subject to the terms of the
252N/A# Common Development and Distribution License, Version 1.0 only
252N/A# (the "License"). You may not use this file except in compliance
252N/A# with the License.
252N/A#
252N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
252N/A# or http://www.opensolaris.org/os/licensing.
252N/A# See the License for the specific language governing permissions
252N/A# and limitations under the License.
252N/A#
252N/A# When distributing Covered Code, include this CDDL HEADER in each
252N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
252N/A# If applicable, add the following below this CDDL HEADER, with the
252N/A# fields enclosed by brackets "[]" replaced with your own identifying
252N/A# information: Portions Copyright [yyyy] [name of copyright owner]
252N/A#
252N/A# CDDL HEADER END
252N/A#
252N/A#
252N/A# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
252N/A# Use is subject to license terms.
252N/A#
252N/A
252N/Atmpfile=/tmp/immodules.$$
252N/Apkg_start="# Start $PKGINST"
252N/Apkg_end="# End $PKGINST"
252N/A
252N/Awhile read dest
252N/Ado
252N/A [ -f ${dest} ] || continue;
252N/A
252N/A # Strip all entries belonging to this package
252N/A start=0
252N/A end=0
252N/A egrep -s "$pkg_start" $dest && start=1
252N/A egrep -s "$pkg_end" $dest && end=1
252N/A
252N/A if [ $start -ne $end ]; then
252N/A echo "$0: missing Start or End delimiters for $PKGINST in $dest."
252N/A echo "$0: $dest may be corrupted and was not updated."
252N/A continue
252N/A fi
252N/A
252N/A if [ $start -eq 1 ]; then
252N/A sed -e "/$pkg_start/,/$pkg_end/d" $dest > $tmpfile || exit 1
252N/A cp $tmpfile $dest || exit 1
252N/A rm -f $tmpfile
252N/A test ! -s $dest && rm -f $dest
252N/A else
252N/A echo "$0: WARNING - no entries found in $dest for $PKGINST."
252N/A exit 0
252N/A fi
252N/Adone
252N/A
252N/Aexit 0
252N/A