cbe-remove
author xlucas
Tue, 28 Apr 2009 09:49:26 +0000
changeset 41 31570364d0f1
parent 30 3fcf6ebb59f2
permissions -rwxr-xr-x
2009-03-16 Lukas (Luc) Oboril <[email protected]> * bump pkgbuild to latest version 1.3.98.4 * add Sun Studio Express 03/09 as known compiler
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     1
#!/bin/bash
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     2
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     3
# Script for uninstalling the common build environment for JDS on Solaris
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     4
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     5
# CDDL HEADER START
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     6
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     7
# The contents of this file are subject to the terms of the
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     8
# Common Development and Distribution License, Version 1.0 only
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
     9
# (the "License").  You may not use this file except in compliance
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    10
# with the License.
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    11
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    12
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    13
# or http://www.opensolaris.org/os/licensing.
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    14
# See the License for the specific language governing permissions
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    15
# and limitations under the License.
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    16
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    17
# When distributing Covered Code, include this CDDL HEADER in each
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    18
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    19
# If applicable, add the following below this CDDL HEADER, with the
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    20
# fields enclosed by brackets "[]" replaced with your own identifying
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    21
# information: Portions Copyright [yyyy] [name of copyright owner]
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    22
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    23
# CDDL HEADER END
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    24
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    25
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    26
# Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved.
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    27
# Use is subject to license terms.
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    28
#
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    29
30
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    30
PKGRM="pfexec /usr/sbin/pkgrm"
1
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    31
ADMIN=`/usr/bin/mktemp /tmp/admin.XXXXX`
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    32
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    33
echo "mail="             > $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    34
echo "instance=unique"  >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    35
echo "conflict=quit"    >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    36
echo "setuid=nocheck"   >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    37
echo "action=nocheck"   >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    38
echo "partial=quit"     >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    39
echo "idepend=nocheck"  >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    40
echo "rdepend=nocheck"  >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    41
echo "space=quit"       >> $ADMIN
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    42
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    43
my_id=`/usr/xpg4/bin/id -u`
30
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    44
prof_sw_inst=`/bin/profiles | nl -s: | grep 'Software Installation' | cut -f1 -d:`
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    45
prof_pri_adm=`/bin/profiles | nl -s: | grep 'Primary Administrator' | cut -f1 -d:`
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    46
prof_basic_usr=`/bin/profiles | nl -s: | grep 'Basic Solaris User' | cut -f1 -d:`
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    47
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    48
if [ "x$my_id" = x0 ]; then
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    49
    PKGRM="/usr/sbin/pkgrm"
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    50
elif [ "x$prof_sw_inst" = x -a "x$prof_pri_adm" = x ]; then
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    51
    echo 'Run this script as a user with the "Software Installation"' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    52
    echo 'or "Primary Administrator" profile.' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    53
    test -x /usr/bin/users-admin && {
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    54
	echo 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    55
	echo 'You can also use the users-admin program (System -> Administration ->' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    56
	echo 'Users and Groups in the GNOME menu) to assign profiles.' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    57
	echo 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    58
    }
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    59
    echo 'See the user_attr(4) and profiles(1) manual pages for further details' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    60
    exit 1
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    61
else
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    62
    if [ "x$prof_basic_usr" != x ]; then
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    63
	if [ "x$prof_sw_inst" != x ]; then
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    64
	    if [ $prof_sw_inst -gt $prof_basic_usr ]; then
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    65
		echo 'The "Software Installation" profile in /etc/user_attr should appear' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    66
		echo 'before Basic Solaris User.' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    67
		exit 1
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    68
	    fi
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    69
	fi
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    70
	if [ "x$prof_pri_adm" != x ]; then
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    71
	    if [ $prof_pri_adm -gt $prof_basic_usr ]; then
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    72
		echo 'The "Primary Administrator" profile in /etc/user_attr should appear' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    73
		echo 'before Basic Solaris User.' 1>&2
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    74
		exit 1
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    75
	    fi
3fcf6ebb59f2 2008-06-26 Laszlo (Laca) Peter <[email protected]>
laca
parents: 10
diff changeset
    76
	fi
1
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    77
    fi
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    78
fi
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    79
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    80
IFS=" 	
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    81
"
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    82
for pkg in `pkginfo | grep 'JDS CBE' | awk '{ print $2; }'`; do
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    83
    $PKGRM -a $ADMIN -n $pkg
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    84
done
10
a65a967018ee 2008-06-11 Laszlo (Laca) Peter <[email protected]>
laca
parents: 1
diff changeset
    85
for pkg in `pkginfo | grep 'Desktop CBE' | awk '{ print $2; }'`; do
a65a967018ee 2008-06-11 Laszlo (Laca) Peter <[email protected]>
laca
parents: 1
diff changeset
    86
    $PKGRM -a $ADMIN -n $pkg
a65a967018ee 2008-06-11 Laszlo (Laca) Peter <[email protected]>
laca
parents: 1
diff changeset
    87
done
1
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    88
pkginfo -q SUNWpkgbuild && $PKGRM -a $ADMIN -n SUNWpkgbuild
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    89
pkginfo -q SFpkgbuild && $PKGRM -a $ADMIN -n SFpkgbuild
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    90
102c9870ef63 initial import -- still incomplete
laca
parents:
diff changeset
    91
rm -f $ADMIN