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" ]
25 echo "One parameter required"
27 echo "1. parameter: Path to the local root directory"
28 echo "All packages in local database will be removed!"
37 GETUID_SO
=/tmp
/getuid.so.$$
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 "#############################################"
49 echo "Path to the root directory : " $MY_ROOT
51 echo "Packages to deinstall:"
52 for i
in $PKGLIST $COREPKG; do
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
65 # Removing old root directory, very dangerous!
68 # removing library in temp directory
72 echo "Deinstallation done..."