summaryrefslogtreecommitdiff
path: root/tools/linux_packaging/uninstall.sh.in
diff options
context:
space:
mode:
authorTodd Naugle <toddn@glw.com>2011-11-08 18:07:29 +0000
committerTodd Naugle <toddn@glw.com>2011-11-08 18:07:29 +0000
commit07ff18db2a0c8454f9d2535cad4efbf940d16aa9 (patch)
tree0a5d7e5db18c4f499856f0f2a79e54b11dc4ad9b /tools/linux_packaging/uninstall.sh.in
parentc8921ea277ad6321ed4c699e5106fc53fbcdad71 (diff)
Installer now handles i18n of the Desktop folder. Running the installer or uninstaller as root work correctly and does not invalidate the sanity checks. Corrected method used to detect if the installer is already running in a visable terminal.
git-svn-id: svn://localhost/ardour2/branches/3.0@10502 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'tools/linux_packaging/uninstall.sh.in')
-rw-r--r--tools/linux_packaging/uninstall.sh.in19
1 files changed, 17 insertions, 2 deletions
diff --git a/tools/linux_packaging/uninstall.sh.in b/tools/linux_packaging/uninstall.sh.in
index 7e86b2bc11..de0bf1ae4f 100644
--- a/tools/linux_packaging/uninstall.sh.in
+++ b/tools/linux_packaging/uninstall.sh.in
@@ -16,6 +16,8 @@ PGM_BUILDTYPE="%REPLACE_TYPE%"
INSTALL_DEST_BASE=/opt
+USER_NAME=$(logname)
+
#### Derived Variables ####
if [ -z "${PGM_BUILDTYPE}" ]; then
@@ -76,6 +78,19 @@ fi
#######################
HAS_XDG="T"
+#load the file that contains the translated names of the users directories
+if [ -e /home/${USER_NAME}/.config/user-dirs.dirs ]; then
+ . /home/${USER_NAME}/.config/user-dirs.dirs
+fi
+
+if [ "$(id -u)" != "0" ]; then
+ USER_DESKTOP_DIR=${XDG_DESKTOP_DIR:-$HOME/Desktop}
+else
+ #running as root with su makes this more difficult
+ DESKTOP_FOLDER=$(echo ${XDG_DESKTOP_DIR:-$HOME/Desktop} | awk -F/ '{print $NF}')
+ USER_DESKTOP_DIR="/home/${USER_NAME}/${DESKTOP_FOLDER}"
+fi
+
XDG_MENU_VER=$(xdg-desktop-menu --version 2> /dev/null)
if [ -z "$XDG_MENU_VER" ];
then
@@ -115,9 +130,9 @@ then
fi
fi
- if [ -e ~/Desktop/${DESKTOP_LINK_FILE} ];
+ if [ -e ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE} ];
then
- ${SUPER} rm -f ~/Desktop/${DESKTOP_LINK_FILE}
+ ${SUPER} rm -f ${USER_DESKTOP_DIR}/${DESKTOP_LINK_FILE}
fi
# delete the old package