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 # Linux deinstallation
21 # No parameter required, all RPMs listed in $HOME/.RPM_OFFICEDATABASE
27 echo "Usage:" $0 "<office-installation-dir>"
28 echo " <inst-destination-dir>: directory where the office to be removed is installed"
35 # Check for old style .RPM_OFFICEDATABASE first
36 if [ -d ${INSTALLDIR}/.RPM_OFFICEDATABASE
]; then
37 RPM_DB_PATH
=${INSTALLDIR}/.RPM_OFFICEDATABASE
39 RPM_DB_PATH
=${INSTALLDIR}/.RPM_DATABASE
42 # the RPM_DB_PATH must be absolute
43 if [ ! "${RPM_DB_PATH:0:1}" = "/" ]; then
44 RPM_DB_PATH
=`cd ${RPM_DB_PATH}; pwd`
47 RPMLIST
=`rpm --dbpath $RPM_DB_PATH --query --all`
51 echo "#########################################"
52 echo "# Deinstallation of Office RPMs #"
53 echo "#########################################"
55 echo "Path to the RPM database: " $RPM_DB_PATH
56 echo "RPMs to deinstall:"
58 echo "===================================================================="
61 # Restore original bootstraprc
62 mv -f $1/program
/bootstraprc.orig
$1/program
/bootstraprc
64 rpm
--dbpath $RPM_DB_PATH --erase $RPMLIST ||
exit 2
66 echo "Removing RPM database ..."
70 echo "Deinstallation done."