merge the formfield patch from ooo-build
[ooovba.git] / setup_native / scripts / deregister_extensions
blob4a8f91de41f059d39781cfc85ea420c48358e7ca
1 #!/bin/bash
3 USAGE="Usage: $0"
5 SCRIPTNAME=`basename "$0"`
6 PROGRAMDIR=`dirname "$0"`
7 OFFICEDIR="$PROGRAMDIR/.."
8 EXTENSIONDIR=$OFFICEDIR/share/extension/install
9 UNOPKG=$PROGRAMDIR/unopkg
11 help()
13 echo
14 echo "Uninstallation script for office extensions located in <office>/share/extension/install"
15 echo
16 echo "This uninstallation script can be executed after successful installation of packages."
17 echo "Please execute this script, before uninstallation of packages."
18 echo "Usage: $0"
19 echo "No parameter required."
20 echo
24 # This script is only for root installations
25 # (How about installations done with user privileges?)
28 # if [ $UID -ne 0 ]
29 # then
30 # printf "\nThis script is for installation only wiht administrative rights only\n"
31 # help
32 # exit 2
33 # fi
36 # Checking existence of unopkg in program directory
39 if [ ! -f "$UNOPKG" ]; then
40 echo "Error: File $UNOPKG does not exist"
41 exit 1
44 if [ ! -x "$UNOPKG" ]; then
45 echo "Error: File $UNOPKG is not an executable file"
46 exit 1
50 # Collecting all files located in share/install/extensions
53 FILELIST=`find $EXTENSIONDIR -type f -name "*.oxt" -print`
55 if [ -z "$FILELIST" ]
56 then
57 printf "\n$0: No extensions found in $EXTENSIONDIR\n"
58 exit 2
61 echo
62 echo "Uninstalling:"
63 for i in $FILELIST; do
64 echo `basename $i`
65 done
66 echo
68 for i in $FILELIST; do
69 COMMAND="$UNOPKG remove --shared `basename $i`"
70 echo $COMMAND
71 $COMMAND
72 done
74 echo
75 echo "Uninstallation done ..."
76 echo
78 exit 0