Browse Source

Use .config/EnlivenMinetest. Change -ne to != for text.

master
poikilos 5 years ago
parent
commit
6cc15212e2
  1. 8
      changelog.md
  2. 40
      install-mts.sh
  3. 13
      reset-minetest-install-source.sh
  4. 9
      versionize.sh

8
changelog.md

@ -5,6 +5,14 @@ The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/). Changelog](https://keepachangelog.com/en/1.0.0/).
## [git] - 2020-03-11
### Changed
- Use $HOME/.config/EnlivenMinetest to store downloads.
### Fixed
- Use instead of `-ne` for comparing strings.
## [git] - 2020-03-11 ## [git] - 2020-03-11
### Changed ### Changed
- Generate readme-ENLIVEN.md `game-release.rc` when building ENLIVEN-mtg - Generate readme-ENLIVEN.md `game-release.rc` when building ENLIVEN-mtg

40
install-mts.sh

@ -4,6 +4,9 @@ echo
echo echo
echo echo
echo "Starting install..." echo "Starting install..."
MY_NAME="install-mts.sh"
config_path="$HOME/.config/EnlivenMinetest"
date date
customDie() { customDie() {
cat <<END cat <<END
@ -59,9 +62,11 @@ enable_server=true
dest_programs="$HOME" dest_programs="$HOME"
#NOTE: $HOME is still used further down, for $HOME/.* and $HOME/i_am_dedicated_minetest_server flag file (which can be empty) #NOTE: $HOME is still used further down, for $HOME/.* and $HOME/i_am_dedicated_minetest_server flag file (which can be empty)
#TODO: change $HOME/i_am_dedicated_minetest_server to $HOME/.config/EnlivenMinetest/i_am_dedicated_minetest_server or rc file #TODO: change $HOME/i_am_dedicated_minetest_server to $HOME/.config/EnlivenMinetest/i_am_dedicated_minetest_server or rc file
extracted_name=linux-minetest-kit extracted_name="linux-minetest-kit"
extracted_path="$config_path/$extracted_name"
cd "$config_path" || customDie "[$MY_NAME] cd \"$config_path\" failed."
flag_dir_rel="$extracted_name/mtsrc" flag_dir_rel="$extracted_name/mtsrc"
flag_dir="`pwd`/$flag_dir_rel" flag_dir="$extracted_path/mtsrc"
enable_client=false enable_client=false
custom_scripts_dir="$HOME" custom_scripts_dir="$HOME"
custom_script_name="mts.sh" custom_script_name="mts.sh"
@ -82,9 +87,7 @@ else
echo " (can contain settings such as enable_run_after_compile)" echo " (can contain settings such as enable_run_after_compile)"
fi fi
pushd "$extracted_name" pushd "$extracted_path" || customDie "pushd \"$extracted_path\" failed in \"`pwd`\""
extracted_dir="`pwd`"
extra_options="" extra_options=""
for var in "$@" for var in "$@"
@ -183,12 +186,12 @@ END
end=`date +%s` end=`date +%s`
compile_time=$((end-start)) compile_time=$((end-start))
echo "Compiling the program finished in $compile_time seconds." echo "Compiling the program finished in $compile_time seconds."
cp release.txt minetest/ || customWarn "Cannot copy `pwd`/release.txt to `pwd`/minetest/" cp $extracted_path/release.txt $extracted_path/minetest/ || customWarn "Cannot copy $extracted_path/release.txt to $extracted_path/minetest/"
else else
echo "* using existing minetest..." echo "* using existing minetest..."
fi fi
if [ ! -f "$flag_file" ]; then if [ ! -f "$flag_file" ]; then
customDie "The build did not complete since '$flag_file' is missing." customDie "The build did not complete since '$flag_file' is missing. Maybe you didn't compile the libraries. Running reset-minetest-install-source.sh should do that automatically, but you can also do: cd $extracted_path && ./mtcompile-libraries.sh build"
fi fi
dest_flag_file="$dest_programs/$flag_file" dest_flag_file="$dest_programs/$flag_file"
if [ -f "$dest_flag_file" ]; then if [ -f "$dest_flag_file" ]; then
@ -292,7 +295,15 @@ else
fi fi
popd popd
pushd .. # pushd .. # go from EnlivenMinetest/webapp to EnlivenMinetest
PATCHES_DIR="patches"
if [ -z "$REPO_PATH" ]; then
REPO_PATH="$HOME/git/EnlivenMinetest"
fi
PATCHES_PATH="$REPO_PATH/patches"
if [ -d "$PATCHES_PATH" ]; then
pushd "$REPO_PATH"
src="patches/subgame/menu" src="patches/subgame/menu"
dst="$dest_programs/minetest/games/ENLIVEN/menu" dst="$dest_programs/minetest/games/ENLIVEN/menu"
echo "updating '$dst' from '$src/'..." echo "updating '$dst' from '$src/'..."
@ -473,6 +484,15 @@ else
fi fi
popd popd
else
cat <<END
$PATCHES_PATH is missing. To fix this, set the REPO_PATH environment variable like:
REPO_PATH=$HOME/git/EnlivenMinetest $MY_NAME
# (where $HOME/git/EnlivenMinetest is the actual repo path).
END
fi
settings_dump="`pwd`/settings-dump.txt" settings_dump="`pwd`/settings-dump.txt"
settings_types_list="`pwd`/settingtypes-list.txt" settings_types_list="`pwd`/settingtypes-list.txt"
# grep -r `pwd`/linux-minetest-kit/minetest/games/Bucket_Game -e "setting_get" > $settings_dump # grep -r `pwd`/linux-minetest-kit/minetest/games/Bucket_Game -e "setting_get" > $settings_dump
@ -492,8 +512,8 @@ else
fi fi
popd popd
echo "* finished compiling." echo "* finished compiling."
if [ -f "$extracted_dir/release.txt" ]; then if [ -f "$extracted_path/release.txt" ]; then
versionLine=`cat $extracted_dir/release.txt` versionLine=`cat $extracted_path/release.txt | grep Release`
echo " - version: $versionLine" echo " - version: $versionLine"
fi fi
if [ "@$enable_run_after_compile" = "@true" ]; then if [ "@$enable_run_after_compile" = "@true" ]; then

13
reset-minetest-install-source.sh

@ -4,8 +4,16 @@ echo
echo echo
echo "Starting cleanup and library rebuild..." echo "Starting cleanup and library rebuild..."
date date
MY_NAME="reset-minetest-install-source.sh"
config_path=$HOME/.config/EnlivenMinetest
zip_name=linux-minetest-kit.zip zip_name=linux-minetest-kit.zip
extracted_name=linux-minetest-kit extracted_name=linux-minetest-kit
config_path=~/.config/EnlivenMinetest
if [ ! -d "$config_path" ]; then
mkdir -p "$config_path"
fi
in_use_name=minetest in_use_name=minetest
#not reliable with bash -e (if not running, check throws error): #not reliable with bash -e (if not running, check throws error):
#running=`ps ax | grep -v grep | grep $in_use_name | wc -l` #running=`ps ax | grep -v grep | grep $in_use_name | wc -l`
@ -61,7 +69,7 @@ if [ "@$installed_version" = "@$available_version" ]; then
echo "You already have the latest version installed." echo "You already have the latest version installed."
exit 1 exit 1
fi fi
if [ "@$compiled_version" -ne "@$installed_version" ]; then if [ "@$compiled_version" != "@$installed_version" ]; then
echo "ERROR: You have not yet installed version $compiled_version which you already compiled (you have installed $installed_version)." echo "ERROR: You have not yet installed version $compiled_version which you already compiled (you have installed $installed_version)."
echo "You should run ./install-mts.sh instead (with --client option if you want more than minetestserver)" echo "You should run ./install-mts.sh instead (with --client option if you want more than minetestserver)"
exit 2 exit 2
@ -75,6 +83,7 @@ do
customDie "Invalid argument: $var" customDie "Invalid argument: $var"
fi fi
done done
cd "$config_path" || customDie "[$MY_NAME] cd \"$config_path\" failed."
if [ -d "$extracted_name" ]; then if [ -d "$extracted_name" ]; then
if [ "`ls -lR screenshots/*.png | wc -l`" -gt 0 ]; then if [ "`ls -lR screenshots/*.png | wc -l`" -gt 0 ]; then
mv screenshots/*.png ~/ || customDie "can't move screenshots from $extracted_name/minetest/bin/*.png" mv screenshots/*.png ~/ || customDie "can't move screenshots from $extracted_name/minetest/bin/*.png"
@ -116,7 +125,7 @@ echo
echo echo
cd .. cd ..
echo "Check libraries.log for errors, then..." echo "Check libraries.log for errors, then..."
echo "- Run the following manually for SERVER only (no graphical client):" echo "- Run the following manually for SERVER only (no graphical client unless an old copy of ~/minetest/bin/minetest is detected):"
echo " bash install-mts.sh" echo " bash install-mts.sh"
echo "- Run the following manually for both minetestserver and minetest:" echo "- Run the following manually for both minetestserver and minetest:"
echo " bash install-mts.sh --client" echo " bash install-mts.sh --client"

9
versionize.sh

@ -1,6 +1,9 @@
#!/bin/bash #!/bin/bash
echo echo
echo "Collecting version..." echo "Collecting version..."
MY_NAME="versionize.sh"
config_path=$HOME/.config/EnlivenMinetest
cd "$config_path" || customDie "[$MY_NAME] cd \"$config_path\" failed."
if [ -z "$original_src_path" ]; then if [ -z "$original_src_path" ]; then
original_src_path="$1" original_src_path="$1"
fi fi
@ -48,13 +51,13 @@ customDie() {
destroy_msg="" destroy_msg=""
# src_path: extracted name (always linux-mintetest-kit unless source is # src_path: extracted name (always linux-mintetest-kit unless source is
# archive, in which case src_path is detected) # archive, in which case src_path is detected)
src_path="linux-minetest-kit" src_path="$config_path/linux-minetest-kit"
versions_path="$HOME/git/EnlivenMinetest/webapp/minetest-versions" versions_path="$config_path/minetest-versions"
if [ ! -d "$versions_path" ]; then if [ ! -d "$versions_path" ]; then
mkdir -p "$versions_path" || customDie "mkdir $versions_path FAILED" mkdir -p "$versions_path" || customDie "mkdir $versions_path FAILED"
fi fi
src_name="" src_name=""
try_path="`pwd`/$original_src_path" try_path="$config_path/$original_src_path"
if [ -f "$original_src_path" ]; then if [ -f "$original_src_path" ]; then
echo "* detected file param..." echo "* detected file param..."
elif [ -d "$original_src_path" ]; then elif [ -d "$original_src_path" ]; then

Loading…
Cancel
Save