cbe-remove
author laca
Mon, 16 Jun 2008 10:48:00 +0000
changeset 17 5bfcb9e423cd
parent 10 a65a967018ee
child 30 3fcf6ebb59f2
permissions -rwxr-xr-x
2008-06-16 Laszlo (Laca) Peter <[email protected]> * CBEdiff.spec: move gendiff to CBEenv.spec * CBEenv.spec: moved gendiff here from CBEdiff.spec

#!/bin/bash
#
# Script for uninstalling the common build environment for JDS on Solaris
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License, Version 1.0 only
# (the "License").  You may not use this file except in compliance
# with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved.
# Use is subject to license terms.
#

PKGRM="/usr/sbin/pkgrm"
ADMIN=`/usr/bin/mktemp /tmp/admin.XXXXX`

echo "mail="             > $ADMIN
echo "instance=unique"  >> $ADMIN
echo "conflict=quit"    >> $ADMIN
echo "setuid=nocheck"   >> $ADMIN
echo "action=nocheck"   >> $ADMIN
echo "partial=quit"     >> $ADMIN
echo "idepend=nocheck"  >> $ADMIN
echo "rdepend=nocheck"  >> $ADMIN
echo "space=quit"       >> $ADMIN

my_id=`/usr/xpg4/bin/id -u`
if [ "x$my_id" != x0 ]; then
    profiles | grep 'Software Installation' > /dev/null
    if [ $? != 0 ]; then
	echo 'Run this script as root or a user with the "Software Installation" profile'
	echo 'See the user_attr(4) and profiles(1) manual pages for details'
	exit 1
    fi
    PKGRM="pfexec /usr/sbin/pkgrm"
fi

IFS=" 	
"
for pkg in `pkginfo | grep 'JDS CBE' | awk '{ print $2; }'`; do
    $PKGRM -a $ADMIN -n $pkg
done
for pkg in `pkginfo | grep 'Desktop CBE' | awk '{ print $2; }'`; do
    $PKGRM -a $ADMIN -n $pkg
done
pkginfo -q SUNWpkgbuild && $PKGRM -a $ADMIN -n SUNWpkgbuild
pkginfo -q SFpkgbuild && $PKGRM -a $ADMIN -n SFpkgbuild

rm -f $ADMIN