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