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