summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup_native/scripts/uninstall_linux.sh38
-rw-r--r--setup_native/scripts/uninstall_solaris.sh56
2 files changed, 94 insertions, 0 deletions
diff --git a/setup_native/scripts/uninstall_linux.sh b/setup_native/scripts/uninstall_linux.sh
new file mode 100644
index 000000000000..a7e139aaf708
--- /dev/null
+++ b/setup_native/scripts/uninstall_linux.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+# Linux deinstallation
+# No parameter required, all RPMs listed in $HOME/.RPM_OFFICEDATABASE
+# will be removed.
+
+if [ $# -ne 0 ]
+then
+ echo "No parameters required"
+ echo "All RPMs listed in $HOME/.RPM_OFFICEDATABASE will be removed"
+ exit 2
+fi
+
+USER_DIR=~/.StarOffice8
+RPM_DB_PATH=$HOME/.RPM_OFFICEDATABASE
+
+# Output ...
+clear
+echo "###################################################################"
+echo "# Deinstallation of StarOffice RPMs #"
+echo "###################################################################"
+echo
+echo "Path to the RPM database: " $RPM_DB_PATH
+echo "RPMs to deinstall:"
+echo "`rpm --dbpath $RPM_DB_PATH --query --all`"
+echo "===================================================================="
+echo
+rpm --dbpath $RPM_DB_PATH --erase `rpm --dbpath $RPM_DB_PATH --query --all`
+
+echo
+echo "Deleting directories"
+rm -rf $RPM_DB_PATH
+rm -rf $USER_DIR
+
+echo
+echo "Deinstallation done ..."
+
+exit 0 \ No newline at end of file
diff --git a/setup_native/scripts/uninstall_solaris.sh b/setup_native/scripts/uninstall_solaris.sh
new file mode 100644
index 000000000000..9b72a301efcc
--- /dev/null
+++ b/setup_native/scripts/uninstall_solaris.sh
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# First parameter: Root path that will be removed
+# MY_ROOT=/export/home/is/root
+
+if [ $# -ne 1 -o -z "$1" ]
+then
+ echo "One parameter required"
+ echo "Usage:"
+ echo "1. parameter: Path to the local root directory"
+ echo "All packages in local database will be removed!"
+ exit 2
+fi
+
+MY_ROOT=$1
+
+cd `dirname $0`
+DIRECTORY=`pwd`
+
+ADMINFILE=$DIRECTORY/admin
+GETUID_SO=/tmp/libgetuid.so.$$
+linenum=???
+tail +$linenum $0 > $GETUID_SO
+
+PKGLIST=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep -v core`
+COREPKG=`pkginfo -R $MY_ROOT | cut -f 2 -d ' ' | grep core`
+
+echo "####################################################################"
+echo "# Deinstallation of StarOffice packages #"
+echo "####################################################################"
+echo
+echo "Path to the root directory : " $MY_ROOT
+echo
+echo "Packages to deinstall:"
+for i in $PKGLIST $COREPKG; do
+ echo $i
+done
+
+LD_PRELOAD=$GETUID_SO
+export LD_PRELOAD
+
+for i in $PKGLIST $COREPKG; do
+ echo /usr/sbin/pkgrm -a $ADMINFILE -R $MY_ROOT $i
+ /usr/sbin/pkgrm -a $ADMINFILE -R $MY_ROOT $i
+done
+
+# Removing old root directory, very dangerous!
+# rm -rf $MY_ROOT
+
+# removing library in temp directory
+rm -f $GETUID_SO
+
+echo
+echo "Deinstallation done..."
+
+exit 0