Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / setup_native / scripts / uninstall_solaris.sh
blob899c66559ff26416e5e5703e6e7fc380d527d1bf
1 #!/bin/sh
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 # This file incorporates work covered by the following license notice:
11 # Licensed to the Apache Software Foundation (ASF) under one or more
12 # contributor license agreements. See the NOTICE file distributed
13 # with this work for additional information regarding copyright
14 # ownership. The ASF licenses this file to you under the Apache
15 # License, Version 2.0 (the "License"); you may not use this file
16 # except in compliance with the License. You may obtain a copy of
17 # the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 # First parameter: Root path that will be removed
21 # MY_ROOT=/export/home/is/root
23 if [ $# -ne 1 -o -z "$1" ]
24 then
25 echo "One parameter required"
26 echo "Usage:"
27 echo "1. parameter: Path to the local root directory"
28 echo "All packages in local database will be removed!"
29 exit 2
32 MY_ROOT=$1
34 cd `dirname $0`
35 DIRECTORY=`pwd`
37 GETUID_SO=/tmp/getuid.so.$$
38 linenum=???
39 tail +$linenum `basename $0` > $GETUID_SO
41 PKGLIST=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep -v core`
42 COREPKG=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep core`
43 COREPKG01=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep core01`
45 echo "#############################################"
46 echo "# Deinstallation of Office packages #"
47 echo "#############################################"
48 echo
49 echo "Path to the root directory : " $MY_ROOT
50 echo
51 echo "Packages to deinstall:"
52 for i in $PKGLIST $COREPKG; do
53 echo $i
54 done
56 INSTALL_DIR=$MY_ROOT`pkginfo -R $MY_ROOT -r $COREPKG01`
58 # Restore original bootstraprc
59 mv -f $INSTALL_DIR/program/bootstraprc.orig $INSTALL_DIR/program/bootstraprc
61 for i in $PKGLIST $COREPKG; do
62 LD_PRELOAD=$GETUID_SO /usr/sbin/pkgrm -n -R $MY_ROOT $i
63 done
65 # Removing old root directory, very dangerous!
66 # rm -rf $MY_ROOT
68 # removing library in temp directory
69 rm -f $GETUID_SO
71 echo
72 echo "Deinstallation done..."
74 exit 0