..and another packaging typo
[ardour.git] / tools / linux_packaging / uninstall.sh.in
index 795c5d317db03c10baaf94687a67534951545999..20aa1b688de399e278406fd612179b57a6b12f0d 100644 (file)
@@ -7,6 +7,7 @@
 #
 #####################################
 
+MAJOR_VERSION="%REPLACE_MAJOR_VERSION%"
 
 PGM_NAME="%REPLACE_PGM%"
 PGM_VENDOR="%REPLACE_VENDOR%"
@@ -67,6 +68,8 @@ if [ "$(id -u)" != "0" ]; then
                        exit 1
                fi
                exit
+       else
+               sudo -k # make sudo forget about cached credentials
        fi
 
        if ! sudo date;
@@ -158,14 +161,14 @@ then
        fi
 
        # delete the bin link if it is linked to this version
-       if [ -e "${USER_BIN_DIR}/${PGM_NAME}3" ]; 
+       if [ -e "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}" ]; 
        then
-               BIN_LINK_TARGET=$(readlink "${USER_BIN_DIR}/${PGM_NAME}3")
+               BIN_LINK_TARGET=$(readlink "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}")
                BIN_LINK_TARGET_DIR=$(dirname "${BIN_LINK_TARGET}")
 
                if [ "${BIN_LINK_TARGET_DIR}" = "${PGM_PATH}/bin" ];
                then
-                       ${SUPER} rm -f "${USER_BIN_DIR}/${PGM_NAME}3"
+                       ${SUPER} rm -f "${USER_BIN_DIR}/${PGM_NAME}${MAJOR_VERSION}"
                fi
        fi