Browse Source

Separate warnings from errors to allow installing to complete reliably.

master
poikilos 5 years ago
parent
commit
6612b16083
  1. 8
      minetestenv-in-place.rc
  2. 29
      update-minetest-linux64.sh

8
minetestenv-in-place.rc

@ -326,6 +326,8 @@ deleteIfExists(){
fi fi
} }
installOrUpgradeMinetest(){ installOrUpgradeMinetest(){
# You must set the following variables or sequential parameters: # You must set the following variables or sequential parameters:
# 1. NEW_VERSION_PATH # 1. NEW_VERSION_PATH
@ -397,7 +399,8 @@ installOrUpgradeMinetest(){
fi fi
if [ -d "$VERSIONED_MT_PATH" ]; then if [ -d "$VERSIONED_MT_PATH" ]; then
customExit "You already have an old copy of \"$VERSIONED_MT_PATH\". You must rename it or backup your world and other data then remove it before proceeding." echo "You already have an old copy of \"$VERSIONED_MT_PATH\". You must rename it if you want to reinstall without losing any extra files you may have put there before upgrading to the current version."
return 2
fi fi
if [ ! -f "`command -v basename`" ]; then if [ ! -f "`command -v basename`" ]; then
customExit "Install cannot continue because the basename command is not present." customExit "Install cannot continue because the basename command is not present."
@ -740,7 +743,8 @@ installOrUpgradeENLIVEN() {
customExit "[installOrUpgradeENLIVEN] The REPO_PATH is not set." customExit "[installOrUpgradeENLIVEN] The REPO_PATH is not set."
fi fi
if [ ! -d "$REPO_PATH" ]; then if [ ! -d "$REPO_PATH" ]; then
customExit "[installOrUpgradeENLIVEN] The REPO_PATH does not exist: \"$REPO_PATH\"" echo " * INFO: [installOrUpgradeENLIVEN] Installing ENLIVEN to games will be skipped since you are not using \"$REPO_PATH\""
return 2
fi fi
if [ ! -z "$1" ]; then if [ ! -z "$1" ]; then
install_dest="$1" install_dest="$1"

29
update-minetest-linux64.sh

@ -20,9 +20,14 @@ TRY_MT_BASH_RC_PATH="$TRY_CURRENT_MT_SCRIPTS_DIR/$MT_BASH_RC_NAME"
if [ -f "$TRY_MT_BASH_RC_PATH" ]; then if [ -f "$TRY_MT_BASH_RC_PATH" ]; then
CURRENT_MT_SCRIPTS_DIR="$TRY_CURRENT_MT_SCRIPTS_DIR" CURRENT_MT_SCRIPTS_DIR="$TRY_CURRENT_MT_SCRIPTS_DIR"
MT_BASH_RC_PATH="$TRY_MT_BASH_RC_PATH" MT_BASH_RC_PATH="$TRY_MT_BASH_RC_PATH"
#fi fi
#if [ ! -f "$MT_BASH_RC_PATH" ]; then #if [ ! -f "$MT_BASH_RC_PATH" ]; then
else if [ ! -d "$REPO_PATH" ]; then
if [ -f "$MT_BASH_RC_PATH" ]; then
echo "* updating \"$MT_BASH_RC_PATH\"..."
rm $MT_BASH_RC_PATH
fi
# ^ Always upgrade the rc file manually if it is not in the repo.
if [ ! -d "$CURRENT_MT_SCRIPTS_DIR" ]; then if [ ! -d "$CURRENT_MT_SCRIPTS_DIR" ]; then
mkdir -p "$CURRENT_MT_SCRIPTS_DIR" mkdir -p "$CURRENT_MT_SCRIPTS_DIR"
fi fi
@ -157,7 +162,9 @@ if [ "@$old_release_version" = "@$new_release_version" ]; then
#show_os_release #show_os_release
echo echo
echo echo
echo "Version $new_release_version is already installed at $INSTALL_PATH. There is nothing to do." echo "* Adding the icon is complete. See the Desktop or applications (under Games usually--otherwise, search for Final Minetest in the Activities menu if in GNOME or GNOME-based Ubuntu versions 18.04 or later and you do not have a desktop icons extension enabled)."
echo
echo "Version $new_release_version is already installed at $INSTALL_PATH. There is nothing more to do."
echo echo
exit 0 exit 0
fi fi
@ -181,9 +188,23 @@ unzip "$DL_PATH" > /dev/null || customExit "Extracting $DL_PATH failed."
UNUSED_MT_PATH="$INSTALL_PATH.$old_release_version" UNUSED_MT_PATH="$INSTALL_PATH.$old_release_version"
installOrUpgradeMinetest "$EXTRACTED_PATH" "$INSTALL_PATH" "$UNUSED_MT_PATH" installOrUpgradeMinetest "$EXTRACTED_PATH" "$INSTALL_PATH" "$UNUSED_MT_PATH"
echo "Installing Final Minetest $new_release_version to $INSTALL_PATH is complete." if [ $? -eq 2 ]; then
echo "Final Minetest wasn't upgraded. See the message above."
elif [ $? -eq 0 ]; then
echo "Installing Final Minetest $new_release_version to $INSTALL_PATH is complete."
else
echo "(installOrUpgradeMinetest failed with error code $?)"
fi
echo " - old:$old_release_version; new:$new_release_version" echo " - old:$old_release_version; new:$new_release_version"
echo "* installing ENLIVEN..." echo "* installing ENLIVEN..."
installOrUpgradeENLIVEN "$INSTALL_PATH" installOrUpgradeENLIVEN "$INSTALL_PATH"
if [ $? -eq 2 ]; then
echo " * skipped"
elif [ $? -eq 0 ]; then
echo " * Installing ENLIVEN to $INSTALL_PATH/games is complete."
else
echo "(installOrUpgradeMinetest failed with error code $?)"
fi
install_mt_in_place_shortcut "$SHORTCUT_PATH" "$INSTALL_PATH" install_mt_in_place_shortcut "$SHORTCUT_PATH" "$INSTALL_PATH"
echo echo

Loading…
Cancel
Save