Linux installer (issue #300): Install/Uninstall scripts updated
to handle the case where another systemwide installation is deployed to a different directory than the one that we are trying to install/uninstall.
This commit is contained in:
parent
2de1aea173
commit
6174e69955
@ -114,11 +114,21 @@ SELF_FILENAME=$(basename $0)
|
|||||||
# if there is an Oolite installation in any
|
# if there is an Oolite installation in any
|
||||||
# user home directory.
|
# user home directory.
|
||||||
|
|
||||||
# Uninstall if possible the system-wide installation
|
# Uninstall, if possible, the current active system-wide installation
|
||||||
${INSTALL_ROOT_SYSTEMWIDE}/${OOLITE_ROOT_NAME}/uninstall 2> /dev/null
|
if [ ${USER_IS_ROOT} ]
|
||||||
if [ $? -eq ${ERROR_CODE_UNINSTALL_FAILED} ]
|
|
||||||
then
|
then
|
||||||
exit ${ERROR_CODE_UNINSTALL_FAILED}
|
OOLITE_SHORTCUT=${STARTUP_SCRIPTS_PATH}/oolite${TRUNK}
|
||||||
|
if [ -e ${OOLITE_SHORTCUT} ]
|
||||||
|
then
|
||||||
|
INSTALL_ROOT_SYSTEMWIDE_ACTIVE=`cat ${OOLITE_SHORTCUT} | head -2 | tail -1`
|
||||||
|
INSTALL_ROOT_SYSTEMWIDE_ACTIVE=${INSTALL_ROOT_SYSTEMWIDE_ACTIVE%%/Oolite*}
|
||||||
|
|
||||||
|
${INSTALL_ROOT_SYSTEMWIDE_ACTIVE}/${OOLITE_ROOT_NAME}/uninstall 2> /dev/null
|
||||||
|
if [ $? -eq ${ERROR_CODE_UNINSTALL_FAILED} ]
|
||||||
|
then
|
||||||
|
exit ${ERROR_CODE_UNINSTALL_FAILED}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Uninstall user's instalation
|
# Uninstall user's instalation
|
||||||
|
@ -74,6 +74,23 @@ else
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Check if this is not the active Oolite systemwide installation
|
||||||
|
if [ ${USER_IS_ROOT} ]
|
||||||
|
then
|
||||||
|
OOLITE_SHORTCUT=${STARTUP_SCRIPTS_PATH}/oolite${TRUNK}
|
||||||
|
if [ -e ${OOLITE_SHORTCUT} ]
|
||||||
|
then
|
||||||
|
INSTALL_ROOT_SYSTEMWIDE_ACTIVE=`cat ${OOLITE_SHORTCUT} | head -2 | tail -1`
|
||||||
|
INSTALL_ROOT_SYSTEMWIDE_ACTIVE=${INSTALL_ROOT_SYSTEMWIDE_ACTIVE%%/Oolite*}
|
||||||
|
if [ "${INSTALL_ROOT_SYSTEMWIDE}" != "${INSTALL_ROOT_SYSTEMWIDE_ACTIVE}" ]
|
||||||
|
then
|
||||||
|
echo
|
||||||
|
echo "Error: The Oolite${TRUNK} startup scripts indicate another systemwide installation is active. Automatic uninstall will now exit to avoid impairing the active installation."
|
||||||
|
exit ${ERROR_CODE_UNINSTALL_FAILED}
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Remove Oolite
|
# Remove Oolite
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user