Update ooo320-m1
[ooovba.git] / setup_native / scripts / uninstall_solaris.sh
blob970191f0842150e411abeb43225e8bc9335f748b
1 #!/bin/bash
3 # First parameter: Root path that will be removed
4 # MY_ROOT=/export/home/is/root
6 if [ $# -ne 1 -o -z "$1" ]
7 then
8 echo "One parameter required"
9 echo "Usage:"
10 echo "1. parameter: Path to the local root directory"
11 echo "All packages in local database will be removed!"
12 exit 2
15 MY_ROOT=$1
17 cd `dirname $0`
18 DIRECTORY=`pwd`
20 GETUID_SO=/tmp/getuid.so.$$
21 linenum=???
22 tail +$linenum `basename $0` > $GETUID_SO
24 PKGLIST=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep -v core`
25 COREPKG=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep core`
26 COREPKG01=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep core01`
28 echo "#############################################"
29 echo "# Deinstallation of Office packages #"
30 echo "#############################################"
31 echo
32 echo "Path to the root directory : " $MY_ROOT
33 echo
34 echo "Packages to deinstall:"
35 for i in $PKGLIST $COREPKG; do
36 echo $i
37 done
39 INSTALL_DIR=$MY_ROOT`pkginfo -R $MY_ROOT -r $COREPKG01`
41 # Restore original bootstraprc
42 mv -f $INSTALL_DIR/program/bootstraprc.orig $INSTALL_DIR/program/bootstraprc
44 for i in $PKGLIST $COREPKG; do
45 LD_PRELOAD=$GETUID_SO /usr/sbin/pkgrm -n -R $MY_ROOT $i
46 done
48 # Removing old root directory, very dangerous!
49 # rm -rf $MY_ROOT
51 # removing library in temp directory
52 rm -f $GETUID_SO
54 echo
55 echo "Deinstallation done..."
57 exit 0