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