update dev300-m57
[ooovba.git] / setup_native / scripts / uninstall_linux.sh
blob4bd4e1853083073175c2290416ceb1fb72a2ed5b
1 #!/bin/bash
3 # Linux deinstallation
4 # No parameter required, all RPMs listed in $HOME/.RPM_OFFICEDATABASE
5 # will be removed.
7 if [ $# -ne 1 ]
8 then
9 echo
10 echo "Usage:" $0 "<office-installation-dir>"
11 echo " <inst-destination-dir>: directory where the office to be removed is installed"
12 echo
13 exit 2
16 INSTALLDIR=$1
18 # Check for old style .RPM_OFFICEDATABASE first
19 if [ -d ${INSTALLDIR}/.RPM_OFFICEDATABASE ]; then
20 RPM_DB_PATH=${INSTALLDIR}/.RPM_OFFICEDATABASE
21 else
22 RPM_DB_PATH=${INSTALLDIR}/.RPM_DATABASE
25 # the RPM_DB_PATH must be absolute
26 if [ ! "${RPM_DB_PATH:0:1}" = "/" ]; then
27 RPM_DB_PATH=`cd ${RPM_DB_PATH}; pwd`
30 RPMLIST=`rpm --dbpath $RPM_DB_PATH --query --all`
32 # Output ...
33 clear
34 echo "#########################################"
35 echo "# Deinstallation of Office RPMs #"
36 echo "#########################################"
37 echo
38 echo "Path to the RPM database: " $RPM_DB_PATH
39 echo "RPMs to deinstall:"
40 echo "$RPMLIST"
41 echo "===================================================================="
42 echo
44 # Restore original bootstraprc
45 mv -f $1/program/bootstraprc.orig $1/program/bootstraprc
47 rpm --dbpath $RPM_DB_PATH --erase $RPMLIST || exit 2
49 echo "Removing RPM database ..."
50 rm -rf $RPM_DB_PATH
52 echo
53 echo "Deinstallation done."
55 exit 0