r.immodules revision 7411
10139N/A#!/bin/sh
10139N/A#
10139N/A# Class Action Script for installing input method modules for libgtk
12219N/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.
10139N/A#
15291N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10139N/A# or http://www.opensolaris.org/os/licensing.
10615N/A# See the License for the specific language governing permissions
15301N/A# and limitations under the License.
15448N/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.
10139N/A# If applicable, add the following below this CDDL HEADER, with the
10139N/A# fields enclosed by brackets "[]" replaced with your own identifying
15301N/A# information: Portions Copyright [yyyy] [name of copyright owner]
10794N/A#
10139N/A# CDDL HEADER END
10794N/A#
12773N/A#
12773N/A# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
12773N/A# Use is subject to license terms.
10794N/A#
10139N/A
10640N/Atmpfile=/tmp/immodules.$$
10139N/Apkg_start="# Start $PKGINST"
10640N/Apkg_end="# End $PKGINST"
10139N/A
10820N/Awhile read dest
10139N/Ado
10820N/A [ -f ${dest} ] || continue;
10339N/A
10820N/A # Strip all entries belonging to this package
10861N/A start=0
13306N/A end=0
12139N/A egrep -s "$pkg_start" $dest && start=1
12139N/A egrep -s "$pkg_end" $dest && end=1
13379N/A
13379N/A if [ $start -ne $end ]; then
13932N/A echo "$0: missing Start or End delimiters for $PKGINST in $dest."
13932N/A echo "$0: $dest may be corrupted and was not updated."
15219N/A continue
14420N/A fi
14503N/A
14503N/A if [ $start -eq 1 ]; then
15449N/A sed -e "/$pkg_start/,/$pkg_end/d" $dest > $tmpfile || exit 1
15449N/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