From 15e6d041a4f170e1638a9c9a10a2a655a31c1abf Mon Sep 17 00:00:00 2001 From: poikilos <7557867+poikilos@users.noreply.github.com> Date: Tue, 31 Mar 2020 16:54:07 -0400 Subject: [PATCH] Fix pathing for flag directories and clarify path variable names. --- install-mts.sh | 74 ++++++++++++++++++++++++++------------------------ 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/install-mts.sh b/install-mts.sh index 7cd8285..7f6a5eb 100755 --- a/install-mts.sh +++ b/install-mts.sh @@ -66,7 +66,7 @@ extracted_name="linux-minetest-kit" extracted_path="$EM_CONFIG_PATH/$extracted_name" cd "$EM_CONFIG_PATH" || customDie "[$MY_NAME] cd \"$EM_CONFIG_PATH\" failed." flag_dir_rel="$extracted_name/mtsrc" -flag_dir="$extracted_path/mtsrc" +code_flag_dir_path="$extracted_path/mtsrc" if [ -z "$CUSTOM_SCRIPTS_PATH" ]; then CUSTOM_SCRIPTS_PATH="$HOME" fi @@ -130,57 +130,60 @@ fi echo "enable_clean=\"$enable_clean\"..." # flag_icon="$HOME/Desktop/org.minetest.minetest.desktop" -good_mts="$extracted_path/minetest/bin/minetestserver" -good_mt="$extracted_path/minetest/bin/minetest" -flag_client_dest_file="$dest_programs/minetest/bin/minetest" -flag_file="$good_mts" -if [ -f "$flag_client_dest_file" ]; then +good_src_mts="$extracted_path/minetest/bin/minetestserver" +good_src_mt="$extracted_path/minetest/bin/minetest" +this_src_flag_path="$good_src_mts" +good_dst_mts="$dest_programs/minetest/bin/minetestserver" +good_dst_mt="$dest_programs/minetest/bin/minetest" +this_dst_flag_path="$good_dst_mts" +if [ -f "$good_dst_mt" ]; then ENABLE_CLIENT=true echo "* automatically adding --client to compile since detected" - echo " '$flag_client_dest_file'" + echo " '$good_dst_mt'" # echo "--press Ctrl C to cancel..." # sleep 2 fi if [ "@$ENABLE_CLIENT" = "@true" ]; then - flag_file="$good_mt" + this_src_flag_path="$good_src_mt" + this_dst_flag_path="$good_dst_mt" extra_options="--client" fi -#if [ -f "$flag_file" ]; then - #rm -f "$flag_file" +#if [ -f "$this_src_flag_path" ]; then + #rm -f "$this_src_flag_path" #fi -#if [ -f "$flag_file" ]; then - #echo "ERROR: Nothing done since can't remove old '$flag_file'" +#if [ -f "$this_src_flag_path" ]; then + #echo "ERROR: Nothing done since can't remove old '$this_src_flag_path'" #exit 1 #fi enable_compile=true has_any_binary=false -if [ -f "$good_mts" ]; then +if [ -f "$good_src_mts" ]; then has_any_binary=true fi -if [ -f "$good_mt" ]; then +if [ -f "$good_src_mt" ]; then has_any_binary=true fi if [ "@$has_any_binary" == "@true" ]; then enable_compile=false if [ "@$ENABLE_CLIENT" = "@true" ]; then - if [ ! -f "$good_mt" ]; then + if [ ! -f "$good_src_mt" ]; then enable_compile=true echo "* enabling compile (since no `pwd`/minetest/bin/minetest but client install is enabled)" fi fi if [ "@$enable_server" = "@true" ]; then - if [ ! -f "$good_mts" ]; then + if [ ! -f "$good_src_mts" ]; then enable_compile=true echo "* enabling compile (since no `pwd`/minetest/bin/minetestserver)" fi fi else - echo "* enabling compile since neither \"$good_mts\" nor \"$good_mt\" are present." + echo "* enabling compile since neither \"$good_src_mts\" nor \"$good_src_mt\" are present." fi if [ "@$enable_compile" = "@true" ]; then - echo "* checking if the compile library script extracted the program source yet ($flag_dir)..." - if [ ! -d "$flag_dir" ]; then + echo "* checking if the compile library script extracted the program source yet ($code_flag_dir_path)..." + if [ ! -d "$code_flag_dir_path" ]; then cat < "$dest_programs/minetest/games/ENLIVEN/game.conf" else for mod_name in $official_game_mod_list do - echo " - updating $mod_name from '$flag_dir/mods/$mod_name' to '$dest_programs/minetest/games/ENLIVEN/mods'..." - rsync -rt --delete "$flag_dir/mods/$mod_name" "$dest_programs/minetest/games/ENLIVEN/mods" + echo " - updating $mod_name from '$dst_game_flag_dir_path/mods/$mod_name' to '$dest_programs/minetest/games/ENLIVEN/mods'..." + rsync -rt --delete "$dst_game_flag_dir_path/mods/$mod_name" "$dest_programs/minetest/games/ENLIVEN/mods" done - # cp -f "$flag_dir/mods/LICENSE" "$dest_programs/minetest/games/ENLIVEN/mods/LICENSE" + # cp -f "$dst_game_flag_dir_path/mods/LICENSE" "$dest_programs/minetest/games/ENLIVEN/mods/LICENSE" if [ -d "$skins_bak" ]; then echo " - restoring skins from '$skins_bak'..." rsync -rt "$skins_bak/" "$skins_dst"