Browse Source

Rename functions.

master
poikilos 4 years ago
parent
commit
cada3a8c50
  1. 12
      branch.sh
  2. 52
      build-MultiCraft.sh
  3. 8
      build-minetest-here.sh
  4. 4
      install-minetest.sh
  5. 5
      install-minimal.sh
  6. 6
      minetestmapper-deps.sh
  7. 18
      minetestmapper-web-install.sh
  8. 14
      patches/deprecated/merged-upstream/Bucket_Game/mods/codermobs/codermobs/install-to-HOME-Bucket_Game.sh
  9. 30
      patches/internal-prepatch.sh
  10. 42
      prepatch.sh
  11. 22
      reset-minetest-install-source.sh
  12. 20
      utilities/extra/install-ENLIVEN-minetest_game.sh
  13. 8
      utilities/extra/uninstall.sh
  14. 6
      utilities/generatemod.py
  15. 30
      versionize.sh

12
branch.sh

@ -4,11 +4,11 @@ exit 0
master=~/minetest/games/Bucket_Game master=~/minetest/games/Bucket_Game
branches=~/git/1.pull-requests/Bucket_Game-branches branches=~/git/1.pull-requests/Bucket_Game-branches
if [ ! -d "$branches" ]; then if [ ! -d "$branches" ]; then
mkdir -p "$branches" || customDie "Failed to mkdir -p '$branches'" mkdir -p "$branches" || customExit "Failed to mkdir -p '$branches'"
echo "Created '$branches'" echo "Created '$branches'"
fi fi
customDie() { customExit() {
errcode=1 errcode=1
echo echo
echo "ERROR:" echo "ERROR:"
@ -53,13 +53,13 @@ do
if [ "@$next" = "@branch" ]; then if [ "@$next" = "@branch" ]; then
# NOT -p on purpose--guarantee normal name (and no spaces) # NOT -p on purpose--guarantee normal name (and no spaces)
branch="$var" branch="$var"
mkdir "$branches/$branch" || customDie "The new branch name must be valid directory name--can't create '$branches/$var'" mkdir "$branches/$branch" || customExit "The new branch name must be valid directory name--can't create '$branches/$var'"
else else
tryPath="$master/$var" tryPath="$master/$var"
if [ -f "$tryPath" ]; then if [ -f "$tryPath" ]; then
partial=$var partial=$var
else else
customDie "File does not exist: '$tryPath'" customExit "File does not exist: '$tryPath'"
fi fi
fi fi
next= next=
@ -68,12 +68,12 @@ done
if [ -z "$branch" ]; then if [ -z "$branch" ]; then
usage usage
customDie "You must specify a branch name" customExit "You must specify a branch name"
fi fi
if [ -z "$partial" ]; then if [ -z "$partial" ]; then
usage usage
customDie "You must specify a file to fork" customExit "You must specify a file to fork"
fi fi
masterFile="$master/$partial" masterFile="$master/$partial"

52
build-MultiCraft.sh

@ -6,7 +6,7 @@
me="$0" me="$0"
RAN_FROM="`pwd`" RAN_FROM="`pwd`"
customDie() { customExit() {
echo echo
echo echo
echo "$me ERROR:" echo "$me ERROR:"
@ -44,7 +44,7 @@ END
usageDie() { usageDie() {
usage usage
customDie $1 customExit $1
} }
dieIfOnline() { dieIfOnline() {
@ -89,10 +89,10 @@ do
BUILD_WHAT="$var" BUILD_WHAT="$var"
USE_WHAT=true USE_WHAT=true
else else
customDie "'$var' is not a directory." customExit "'$var' is not a directory."
fi fi
else else
customDie "$var is not a valid option." customExit "$var is not a valid option."
fi fi
done done
@ -115,12 +115,12 @@ srcRepo="`pwd`/$BUILD_WHAT"
if [ ! -d "$srcRepo" ]; then if [ ! -d "$srcRepo" ]; then
srcRepo="$GIT_REPOS_DIR/$BUILD_WHAT" srcRepo="$GIT_REPOS_DIR/$BUILD_WHAT"
if [ ! -d "$GIT_REPOS_DIR" ]; then if [ ! -d "$GIT_REPOS_DIR" ]; then
mkdir -p "$GIT_REPOS_DIR" || customDie echo "mkdir -p '$GIT_REPOS_DIR' FAILED." mkdir -p "$GIT_REPOS_DIR" || customExit echo "mkdir -p '$GIT_REPOS_DIR' FAILED."
fi fi
fi fi
echo "* Using $srcRepo..." echo "* Using $srcRepo..."
if [ ! -d /tmp/MultiCraft ]; then if [ ! -d /tmp/MultiCraft ]; then
mkdir /tmp/MultiCraft || customDie echo "mkdir -p '/tmp/MultiCraft' FAILED." mkdir /tmp/MultiCraft || customExit echo "mkdir -p '/tmp/MultiCraft' FAILED."
fi fi
artifactsPath=/tmp/MultiCraft/src.txt artifactsPath=/tmp/MultiCraft/src.txt
cat > $artifactsPath <<END cat > $artifactsPath <<END
@ -174,9 +174,9 @@ if [ "@$UNINSTALL" = "@true" ]; then
echo echo
prevDir="`pwd`" prevDir="`pwd`"
echo "Uninstalling $DESTINATION..." echo "Uninstalling $DESTINATION..."
cd "$DESTINATION" || customDie echo "cd $DESTINATION FAILED." cd "$DESTINATION" || customExit echo "cd $DESTINATION FAILED."
if [ ! -d /tmp/MultiCraft ]; then if [ ! -d /tmp/MultiCraft ]; then
mkdir /tmp/MultiCraft || customDie echo "mkdir -p '/tmp/MultiCraft' FAILED." mkdir /tmp/MultiCraft || customExit echo "mkdir -p '/tmp/MultiCraft' FAILED."
fi fi
manifestPath=/tmp/MultiCraft/manifest.txt manifestPath=/tmp/MultiCraft/manifest.txt
cat > $manifestPath <<END cat > $manifestPath <<END
@ -1780,7 +1780,7 @@ bin
po po
END END
if [ -z "$DESTINATION" ]; then if [ -z "$DESTINATION" ]; then
customDie "DESTINATION is blank." customExit "DESTINATION is blank."
fi fi
while read p; do while read p; do
if [ -f "$DESTINATION/$p" ]; then if [ -f "$DESTINATION/$p" ]; then
@ -1803,16 +1803,16 @@ fi
if [ "@$INSTALL" = "@true" ]; then if [ "@$INSTALL" = "@true" ]; then
echo "* installing from '$srcRepo' to '$DESTINATION'..." echo "* installing from '$srcRepo' to '$DESTINATION'..."
if [ ! -f "`command -v rsync`" ]; then if [ ! -f "`command -v rsync`" ]; then
customDie "You must first install rsync to use the install option." customExit "You must first install rsync to use the install option."
fi fi
if [ ! -d "$DESTINATION" ]; then if [ ! -d "$DESTINATION" ]; then
mkdir -p "$DESTINATION" || customDie "mkdir -p '$DESTINATION' FAILED." mkdir -p "$DESTINATION" || customExit "mkdir -p '$DESTINATION' FAILED."
fi fi
if [ -f "$DESTINATION/multicraft.conf" ]; then if [ -f "$DESTINATION/multicraft.conf" ]; then
echo " - The existing multicraft.conf will not be overwritten." echo " - The existing multicraft.conf will not be overwritten."
rsync -rt --info=progress2 --exclude-from "$artifactsPath" --exclude 'multicraft.conf' "$srcRepo/" "$DESTINATION" || customDie "rsync failed." rsync -rt --info=progress2 --exclude-from "$artifactsPath" --exclude 'multicraft.conf' "$srcRepo/" "$DESTINATION" || customExit "rsync failed."
else else
rsync -rt --info=progress2 --exclude-from "$artifactsPath" "$srcRepo/" "$DESTINATION" || customDie "rsync failed." rsync -rt --info=progress2 --exclude-from "$artifactsPath" "$srcRepo/" "$DESTINATION" || customExit "rsync failed."
fi fi
rm $artifactsPath rm $artifactsPath
rmdir --ignore-fail-on-non-empty /tmp/MultiCraft rmdir --ignore-fail-on-non-empty /tmp/MultiCraft
@ -1825,10 +1825,10 @@ if [ "@$INSTALL" = "@true" ]; then
fi fi
if [ ! -f "$dstExe" ]; then if [ ! -f "$dstExe" ]; then
customDie "Install did not result in '$dstExe'." customExit "Install did not result in '$dstExe'."
fi fi
if [ ! -d "$dstShortcuts" ]; then if [ ! -d "$dstShortcuts" ]; then
mkdir -p "$dstShortcuts" || customDie echo "mkdir -p '$dstShortcuts' FAILED." mkdir -p "$dstShortcuts" || customExit echo "mkdir -p '$dstShortcuts' FAILED."
fi fi
cat > $dstShortcut <<END cat > $dstShortcut <<END
[Desktop Entry] [Desktop Entry]
@ -1861,7 +1861,7 @@ END
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "* Created $dstShortcut." echo "* Created $dstShortcut."
else else
customDie "Creating $dstShortcut FAILED." customExit "Creating $dstShortcut FAILED."
fi fi
echo echo
echo echo
@ -1882,25 +1882,25 @@ fi
fi fi
if [ ! -d "$srcRepo" ]; then if [ ! -d "$srcRepo" ]; then
cd "$GIT_REPOS_DIR" || customDie "cd '$GIT_REPOS_DIR' FAILED" cd "$GIT_REPOS_DIR" || customExit "cd '$GIT_REPOS_DIR' FAILED"
fi fi
goodFlagFile=MultiCraft/CMakeLists.txt goodFlagFile=MultiCraft/CMakeLists.txt
if [ -f "`command -v git`" ]; then if [ -f "`command -v git`" ]; then
echo "In `pwd`..." echo "In `pwd`..."
if [ ! -d "$BUILD_WHAT" ]; then if [ ! -d "$BUILD_WHAT" ]; then
if [ "@$OFFLINE" = "@false" ]; then if [ "@$OFFLINE" = "@false" ]; then
git clone https://github.com/MultiCraft/MultiCraft.git || customDie "Cannot clone MultiCraft from `pwd`" git clone https://github.com/MultiCraft/MultiCraft.git || customExit "Cannot clone MultiCraft from `pwd`"
fi fi
cd "$BUILD_WHAT" || customDie "Cannot cd '$BUILD_WHAT' from `pwd`" cd "$BUILD_WHAT" || customExit "Cannot cd '$BUILD_WHAT' from `pwd`"
else else
cd "$BUILD_WHAT" || customDie "Cannot cd '$BUILD_WHAT' from `pwd`" cd "$BUILD_WHAT" || customExit "Cannot cd '$BUILD_WHAT' from `pwd`"
if [ "@$OFFLINE" = "@false" ]; then if [ "@$OFFLINE" = "@false" ]; then
git pull || dieIfOnline "WARNING: Cannot pull '$BUILD_WHAT' from `pwd`" git pull || dieIfOnline "WARNING: Cannot pull '$BUILD_WHAT' from `pwd`"
fi fi
fi fi
else else
if [ ! -f "$goodFlagFile" ]; then if [ ! -f "$goodFlagFile" ]; then
customDie "You are missing git, and offline install is not possible without in current directory (`pwd`)" customExit "You are missing git, and offline install is not possible without in current directory (`pwd`)"
else else
cd "$BUILD_WHAT" || usageDie "Cannot cd '$BUILD_WHAT' from `pwd`" cd "$BUILD_WHAT" || usageDie "Cannot cd '$BUILD_WHAT' from `pwd`"
fi fi
@ -1909,7 +1909,7 @@ cd games || usageDie "cd games FAILED in `pwd`"
rmdir --ignore-fail-on-non-empty default rmdir --ignore-fail-on-non-empty default
if [ ! -d "default" ]; then if [ ! -d "default" ]; then
if [ "@$OFFLINE" = "@false" ]; then if [ "@$OFFLINE" = "@false" ]; then
git clone https://github.com/MultiCraft/MultiCraft_game default || customDie "git clone https://github.com/MultiCraft/MultiCraft_game FAILED" git clone https://github.com/MultiCraft/MultiCraft_game default || customExit "git clone https://github.com/MultiCraft/MultiCraft_game FAILED"
else else
echo echo
echo echo
@ -1921,9 +1921,9 @@ if [ ! -d "default" ]; then
fi fi
else else
if [ "@$OFFLINE" = "@false" ]; then if [ "@$OFFLINE" = "@false" ]; then
cd default || customDie "cd default FAILED in `pwd`" cd default || customExit "cd default FAILED in `pwd`"
git pull || customDie "git pull FAILED in `pwd`" git pull || customExit "git pull FAILED in `pwd`"
cd .. || customDie "cd .. FAILED in `pwd`" cd .. || customExit "cd .. FAILED in `pwd`"
fi fi
fi fi
cd .. || usageDie "cd .. FAILED in `pwd`" cd .. || usageDie "cd .. FAILED in `pwd`"
@ -1936,7 +1936,7 @@ echo "Running cmake srcPath..."
cmake $srcPath $flag1 -G"CodeBlocks - Unix Makefiles" -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 || usageDie "cmake failed in `pwd`. See any messages above for more information. Run ./install-minetest-build-deps.sh if you did not." cmake $srcPath $flag1 -G"CodeBlocks - Unix Makefiles" -DRUN_IN_PLACE=1 -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 || usageDie "cmake failed in `pwd`. See any messages above for more information. Run ./install-minetest-build-deps.sh if you did not."
echo echo
echo "Running make..." echo "Running make..."
make -j$(nproc) || customDie "make failed. See any messages above for more information. Run ./install-minetest-build-deps.sh if you did not." make -j$(nproc) || customExit "make failed. See any messages above for more information. Run ./install-minetest-build-deps.sh if you did not."
if [ -f "`pwd`/bin/MultiCraft" ]; then if [ -f "`pwd`/bin/MultiCraft" ]; then
echo "`pwd`/bin/MultiCraft" echo "`pwd`/bin/MultiCraft"
else else

8
build-minetest-here.sh

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
customDie(){ customExit(){
echo "$1" echo "$1"
exit 1 exit 1
} }
@ -8,14 +8,14 @@ if [ ! -d $mybuild ]; then
# mkdir $mybuild # mkdir $mybuild
echo echo
fi fi
# cd $mybuild || customDie "$0: cd build failed in '`pwd`'." # cd $mybuild || customExit "$0: cd build failed in '`pwd`'."
if [ -f bin/minetest ]; then if [ -f bin/minetest ]; then
make clean || customDie "$0: make clean failed in '`pwd`'." make clean || customExit "$0: make clean failed in '`pwd`'."
fi fi
if [ -z "$RUN_IN_PLACE" ]; then if [ -z "$RUN_IN_PLACE" ]; then
RUN_IN_PLACE=0 RUN_IN_PLACE=0
fi fi
cmake . -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DRUN_IN_PLACE=$RUN_IN_PLACE && make -j$(grep -c processor /proc/cpuinfo) || customDie "$0: Build failed in '`pwd`'." cmake . -DENABLE_GETTEXT=1 -DENABLE_FREETYPE=1 -DENABLE_LEVELDB=1 -DENABLE_REDIS=1 -DRUN_IN_PLACE=$RUN_IN_PLACE && make -j$(grep -c processor /proc/cpuinfo) || customExit "$0: Build failed in '`pwd`'."
echo echo
if [ "@$RUN_IN_PLACE" = "@1" ]; then if [ "@$RUN_IN_PLACE" = "@1" ]; then
echo "WARNING: do not do make install with -DRUN_IN_PLACE=$RUN_IN_PLACE!" echo "WARNING: do not do make install with -DRUN_IN_PLACE=$RUN_IN_PLACE!"

4
install-minetest.sh

@ -2,7 +2,7 @@
# The git repo ONLY includes the core engine: http://localhost:3000/minetest/minetest.git # The git repo ONLY includes the core engine: http://localhost:3000/minetest/minetest.git
# The build kit should be used, & has "patched Irrlicht, the new LuaJit, built-in LevelDB and Snappy support, Bucket Game, Bucket City, Wonder World, the schems collection, and other pieces" # The build kit should be used, & has "patched Irrlicht, the new LuaJit, built-in LevelDB and Snappy support, Bucket Game, Bucket City, Wonder World, the schems collection, and other pieces"
customDie() { customExit() {
echo echo
echo "ERROR:" echo "ERROR:"
echo "$1" echo "$1"
@ -10,7 +10,7 @@ customDie() {
echo echo
} }
cd webapp || customDie "You must run this script from the directory containing the webapp directory." cd webapp || customExit "You must run this script from the directory containing the webapp directory."
if [ ! -d linux-minetest-kit ]; then if [ ! -d linux-minetest-kit ]; then
bash reset-minetest-install-source.sh bash reset-minetest-install-source.sh
fi fi

5
install-minimal.sh

@ -25,8 +25,6 @@ countDown(){
echo "This will DELETE ~/minetest/games/minimal and remake it!" echo "This will DELETE ~/minetest/games/minimal and remake it!"
countDown countDown
#> You'll need minimum git 1.9 for this to work. Tested it myself only with 2.2.0 and 2.2.2.
#-<https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/52269934#52269934>
REPO_URL=https://github.com/minetest/minetest REPO_URL=https://github.com/minetest/minetest
# REPO_URL=http://git.minetest.org:3000/minetest/minetest.git # REPO_URL=http://git.minetest.org:3000/minetest/minetest.git
DEST_REPO=~/Downloads/git/minetest_minimal DEST_REPO=~/Downloads/git/minetest_minimal
@ -40,6 +38,9 @@ if [ -e $DEST_GAMES/minimal ]; then
fi fi
if [ ! -d "$DEST_REPO" ]; then if [ ! -d "$DEST_REPO" ]; then
# "You'll need minimum git 1.9 for this to work. Tested it myself
# only with 2.2.0 and 2.2.2."
# -<https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/52269934#52269934>
mkdir -p ~/Downloads/git \ mkdir -p ~/Downloads/git \
&& git init "$DEST_REPO" \ && git init "$DEST_REPO" \
&& cd "$DEST_REPO" \ && cd "$DEST_REPO" \

6
minetestmapper-deps.sh

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
customDie() { customExit() {
echo echo
echo echo
echo "ERROR:" echo "ERROR:"
@ -27,12 +27,12 @@ elif [ -f "`command -v yum`" ]; then
INSTALL_CMD="yum -y install" INSTALL_CMD="yum -y install"
PACKAGE_TYPE="rpm" PACKAGE_TYPE="rpm"
else else
customDie "Your package system is not implemented in this script." customExit "Your package system is not implemented in this script."
fi fi
if [ "@$PACKAGE_TYPE" = "@deb" ]; then if [ "@$PACKAGE_TYPE" = "@deb" ]; then
sudo $INSTALL_CMD libgd-dev libsqlite3-dev libleveldb-dev libhiredis-dev libpq-dev sudo $INSTALL_CMD libgd-dev libsqlite3-dev libleveldb-dev libhiredis-dev libpq-dev
elif [ "@$PACKAGE_TYPE" = "@rpm" ]; then elif [ "@$PACKAGE_TYPE" = "@rpm" ]; then
sudo $INSTALL_CMD gd-devel sqlite-devel leveldb-devel hiredis-devel libpq-devel sudo $INSTALL_CMD gd-devel sqlite-devel leveldb-devel hiredis-devel libpq-devel
else else
customDie "The package names for your OS are unknown." customExit "The package names for your OS are unknown."
fi fi

18
minetestmapper-web-install.sh

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
customDie() { customExit() {
echo echo
echo echo
echo "ERROR:" echo "ERROR:"
@ -24,19 +24,19 @@ mkdir -p $REPOS_PATH
REPO_PATH="$REPOS_PATH/$_REPO_NAME" REPO_PATH="$REPOS_PATH/$_REPO_NAME"
if [ ! -d "$REPOS_PATH" ]; then if [ ! -d "$REPOS_PATH" ]; then
mkdir -p "$REPOS_PATH" || customDie "mkdir -p \"$REPOS_PATH\" failed." mkdir -p "$REPOS_PATH" || customExit "mkdir -p \"$REPOS_PATH\" failed."
fi fi
cd "$REPOS_PATH" || customDie "cd \"$REPOS_PATH\" failed." cd "$REPOS_PATH" || customExit "cd \"$REPOS_PATH\" failed."
if [ -d "$REPO_PATH" ]; then if [ -d "$REPO_PATH" ]; then
cd "$REPO_PATH" || customDie "cd \"$REPO_PATH\" failed." cd "$REPO_PATH" || customExit "cd \"$REPO_PATH\" failed."
git pull || customDie "git pull failed in `pwd`." git pull || customExit "git pull failed in `pwd`."
else else
git clone "$_REPO_URL" "$REPO_PATH" || customDie "git clone \"$_REPO_URL\" \"$REPO_PATH\" failed." git clone "$_REPO_URL" "$REPO_PATH" || customExit "git clone \"$_REPO_URL\" \"$REPO_PATH\" failed."
fi fi
echo "* compiling in `pwd`..." echo "* compiling in `pwd`..."
cmake . -DENABLE_LEVELDB=1 -DENABLE_POSTGRES=1 -DENABLE_REDIS=1 || customDie "cmake . failed in `pwd`." cmake . -DENABLE_LEVELDB=1 -DENABLE_POSTGRES=1 -DENABLE_REDIS=1 || customExit "cmake . failed in `pwd`."
make -j$(nproc) || customDie "make failed in `pwd`." make -j$(nproc) || customExit "make failed in `pwd`."
_EXE_PATH="`pwd`/$_EXE_NAME" _EXE_PATH="`pwd`/$_EXE_NAME"
if [ -f "$_EXE_PATH" ]; then if [ -f "$_EXE_PATH" ]; then
echo "* finished compiling \"$_EXE_PATH\"" echo "* finished compiling \"$_EXE_PATH\""
@ -48,7 +48,7 @@ if [ -f "$_EXE_PATH" ]; then
if [ -f "$EXE_DEST_PATH" ]; then if [ -f "$EXE_DEST_PATH" ]; then
echo "* installed \"$EXE_DEST_PATH\"" echo "* installed \"$EXE_DEST_PATH\""
else else
customDie "* installing \"$EXE_DEST_PATH\" failed." customExit "* installing \"$EXE_DEST_PATH\" failed."
fi fi
else else
echo "* finished compiling in `pwd` (but $_EXE_PATH was not detected)" echo "* finished compiling in `pwd` (but $_EXE_PATH was not detected)"

14
patches/deprecated/merged-upstream/Bucket_Game/mods/codermobs/codermobs/install-to-HOME-Bucket_Game.sh

@ -2,7 +2,7 @@
echo echo
echo echo
customDie() { customExit() {
echo echo
echo "ERROR:" echo "ERROR:"
echo "$1" echo "$1"
@ -11,13 +11,13 @@ customDie() {
} }
if [ ! -f deer.lua ]; then if [ ! -f deer.lua ]; then
customDie "No deer.lua, so can't patch." customExit "No deer.lua, so can't patch."
fi fi
my_bucket_game=$HOME/minetest/games/Bucket_Game my_bucket_game=$HOME/minetest/games/Bucket_Game
my_codermobs_codermobs=$my_bucket_game/mods/codermobs/codermobs my_codermobs_codermobs=$my_bucket_game/mods/codermobs/codermobs
my_codermobs_init=$my_codermobs_codermobs/init.lua my_codermobs_init=$my_codermobs_codermobs/init.lua
if [ ! -f "$my_codermobs_init" ]; then if [ ! -f "$my_codermobs_init" ]; then
customDie "$my_codermobs_init does not exist." customExit "$my_codermobs_init does not exist."
fi fi
echo "* patching $my_codermobs_init..." echo "* patching $my_codermobs_init..."
if [ -z "`cat $my_codermobs_init | grep deer.lua`" ]; then if [ -z "`cat $my_codermobs_init | grep deer.lua`" ]; then
@ -27,14 +27,14 @@ else
fi fi
if [ -f "$my_codermobs_codermobs/deer.lua" ]; then if [ -f "$my_codermobs_codermobs/deer.lua" ]; then
echo "* removing old $my_codermobs_codermobs/deer.lua..." echo "* removing old $my_codermobs_codermobs/deer.lua..."
rm $my_codermobs_codermobs/deer.lua || customDie "Cannot remove old $my_codermobs_codermobs/deer.lua" rm $my_codermobs_codermobs/deer.lua || customExit "Cannot remove old $my_codermobs_codermobs/deer.lua"
fi fi
echo "* copying to $my_codermobs_codermobs/deer.lua..." echo "* copying to $my_codermobs_codermobs/deer.lua..."
cp deer.lua "$my_codermobs_codermobs/" || customDie "Cannot copy to $my_codermobs_codermobs/deer.lua" cp deer.lua "$my_codermobs_codermobs/" || customExit "Cannot copy to $my_codermobs_codermobs/deer.lua"
echo "* copying over $my_codermobs_codermobs/textures/..." echo "* copying over $my_codermobs_codermobs/textures/..."
cp textures/* "$my_codermobs_codermobs/textures/" || customDie "Cannot copy to $my_codermobs_codermobs/textures/" cp textures/* "$my_codermobs_codermobs/textures/" || customExit "Cannot copy to $my_codermobs_codermobs/textures/"
echo "* copying over $my_codermobs_codermobs/models/..." echo "* copying over $my_codermobs_codermobs/models/..."
cp models/* "$my_codermobs_codermobs/models/" || customDie "Cannot copy to $my_codermobs_codermobs/textures/" cp models/* "$my_codermobs_codermobs/models/" || customExit "Cannot copy to $my_codermobs_codermobs/textures/"
echo "Done." echo "Done."
echo echo
echo echo

30
patches/internal-prepatch.sh

@ -2,7 +2,7 @@
# such as meld /home/owner/minetest/games/ENLIVEN/ /home/owner/git/EnlivenMinetest/patches/Bucket_Game-patched/ # such as meld /home/owner/minetest/games/ENLIVEN/ /home/owner/git/EnlivenMinetest/patches/Bucket_Game-patched/
me=`basename "$0"` me=`basename "$0"`
customDie() { customExit() {
echo echo
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "Unknown error." echo "Unknown error."
@ -23,7 +23,7 @@ patches="$HOME/git/EnlivenMinetest/patches"
project1_path="$patches/$project1" project1_path="$patches/$project1"
project2_path="$patches/$project2" project2_path="$patches/$project2"
if [ ! -d "$patches" ]; then if [ ! -d "$patches" ]; then
customDie "You are missing $patches so a patch basis and patched target cannot be created there." customExit "You are missing $patches so a patch basis and patched target cannot be created there."
fi fi
licenses="license.txt LICENSE LICENSE.txt oldcoder.txt LICENSE.md license.md" licenses="license.txt LICENSE LICENSE.txt oldcoder.txt LICENSE.md license.md"
usage() { usage() {
@ -79,30 +79,30 @@ dir2_pp="$(dirname -- "$dir2_p")"
#echo "* checking $dir2_pp..." #echo "* checking $dir2_pp..."
if [ ! -d "$project0_path" ]; then if [ ! -d "$project0_path" ]; then
customDie "ERROR: You must have '$project0' installed as '$project0_path'" customExit "ERROR: You must have '$project0' installed as '$project0_path'"
fi fi
if [ ! -f "$file0_path" ]; then if [ ! -f "$file0_path" ]; then
customDie "ERROR: Missing '$file0_path')" customExit "ERROR: Missing '$file0_path')"
fi fi
if [ ! -d "$dir1" ]; then if [ ! -d "$dir1" ]; then
mkdir -p "$dir1" || customDie "Cannot mkdir $dir1" mkdir -p "$dir1" || customExit "Cannot mkdir $dir1"
fi fi
if [ ! -d "$dir2" ]; then if [ ! -d "$dir2" ]; then
mkdir -p "$dir2" || customDie "Cannot mkdir $dir2" mkdir -p "$dir2" || customExit "Cannot mkdir $dir2"
fi fi
# if file1 exists, overwriting is ok--update basis so diff will make patch correctly # if file1 exists, overwriting is ok--update basis so diff will make patch correctly
echo "* updating $file1_path" echo "* updating $file1_path"
cp -f "$file0_path" "$file1_path" || customDie "Cannot cp '$file0_path' '$file1_path'" cp -f "$file0_path" "$file1_path" || customExit "Cannot cp '$file0_path' '$file1_path'"
if [ -f "$file2_path" ]; then if [ -f "$file2_path" ]; then
customDie "Nothing done since '$file2_path' already exists." customExit "Nothing done since '$file2_path' already exists."
fi fi
echo "* creating $file2_path" echo "* creating $file2_path"
cp -f "$file0_path" "$file2_path" || customDie "Cannot cp '$file0_path' '$file2_path'" cp -f "$file0_path" "$file2_path" || customExit "Cannot cp '$file0_path' '$file2_path'"
if [ -f "`command -v geany`" ]; then if [ -f "`command -v geany`" ]; then
nohup geany "$file2_path" & nohup geany "$file2_path" &
fi fi
@ -119,10 +119,10 @@ for license in "${arr[@]}"; do
lic2="$dir2/$license" lic2="$dir2/$license"
if [ -f "$lic0" ]; then if [ -f "$lic0" ]; then
echo "* updating LICENSE '$lic1'..." echo "* updating LICENSE '$lic1'..."
cp -f "$lic0" "$lic1" || customDie "Cannot cp -f '$lic0' '$lic1'" cp -f "$lic0" "$lic1" || customExit "Cannot cp -f '$lic0' '$lic1'"
if [ ! -f "$lic2" ]; then if [ ! -f "$lic2" ]; then
echo " - also for $project2..." echo " - also for $project2..."
cp --no-clobber "$lic0" "$lic2" || customDie "Cannot cp -f '$lic0' '$lic2'" cp --no-clobber "$lic0" "$lic2" || customExit "Cannot cp -f '$lic0' '$lic2'"
fi fi
fi fi
lic0="$dir0_p/$license" lic0="$dir0_p/$license"
@ -130,10 +130,10 @@ for license in "${arr[@]}"; do
lic2="$dir2_p/$license" lic2="$dir2_p/$license"
if [ -f "$lic0" ]; then if [ -f "$lic0" ]; then
echo "* updating LICENSE '$lic1'..." echo "* updating LICENSE '$lic1'..."
cp -f "$lic0" "$lic1" || customDie "Cannot cp -f '$lic0' '$lic1'" cp -f "$lic0" "$lic1" || customExit "Cannot cp -f '$lic0' '$lic1'"
if [ ! -f "$lic2" ]; then if [ ! -f "$lic2" ]; then
echo " - also for $project2..." echo " - also for $project2..."
cp --no-clobber "$lic0" "$lic2" || customDie "Cannot cp -f '$lic0' '$lic2'" cp --no-clobber "$lic0" "$lic2" || customExit "Cannot cp -f '$lic0' '$lic2'"
fi fi
fi fi
lic0="$dir0_pp/$license" lic0="$dir0_pp/$license"
@ -141,10 +141,10 @@ for license in "${arr[@]}"; do
lic2="$dir2_pp/$license" lic2="$dir2_pp/$license"
if [ -f "$lic0" ]; then if [ -f "$lic0" ]; then
echo "* updating '$lic1'..." echo "* updating '$lic1'..."
cp -f "$lic0" "$lic1" || customDie "Cannot cp -f '$lic0' '$lic1'" cp -f "$lic0" "$lic1" || customExit "Cannot cp -f '$lic0' '$lic1'"
if [ ! -f "$lic2" ]; then if [ ! -f "$lic2" ]; then
echo " - also for $project2..." echo " - also for $project2..."
cp --no-clobber "$lic0" "$lic2" || customDie "Cannot cp -f '$lic0' '$lic2'" cp --no-clobber "$lic0" "$lic2" || customExit "Cannot cp -f '$lic0' '$lic2'"
fi fi
fi fi
done done

42
prepatch.sh

@ -6,7 +6,7 @@ me=`basename "$0"`
# expected) # expected)
# --install Install the specified patch. # --install Install the specified patch.
customDie() { customExit() {
echo echo
if [ -z "$1" ]; then if [ -z "$1" ]; then
echo "Unknown error." echo "Unknown error."
@ -66,7 +66,7 @@ project2_path="$repo/$project2/$branch"
if [ "@$enable_meld" = "@true" ]; then if [ "@$enable_meld" = "@true" ]; then
echo "meld..." echo "meld..."
if [ -z "$branch" ]; then if [ -z "$branch" ]; then
customDie "You must specify a branch name after --meld." customExit "You must specify a branch name after --meld."
fi fi
subgame= subgame=
patch_game_src= patch_game_src=
@ -76,7 +76,7 @@ if [ "@$enable_meld" = "@true" ]; then
if [ -d "$project2_path/mods" ]; then if [ -d "$project2_path/mods" ]; then
patch_game_src="$project2_path" patch_game_src="$project2_path"
else else
customDie "Cannot detect mods directory in $project2_path/mods" customExit "Cannot detect mods directory in $project2_path/mods"
fi fi
#below (commented part) should only happen if $project2_path already has been edited (diverged from $project1_path) #below (commented part) should only happen if $project2_path already has been edited (diverged from $project1_path)
#echo "meld $patch_game_src/ $HOME/minetest/games/ENLIVEN..." #echo "meld $patch_game_src/ $HOME/minetest/games/ENLIVEN..."
@ -98,7 +98,7 @@ if [ "@$enable_meld" = "@true" ]; then
echo "* install nohup to prevent programs from dumping output to console..." echo "* install nohup to prevent programs from dumping output to console..."
fi fi
else else
customDie "You do not have meld installed." customExit "You do not have meld installed."
fi fi
else else
echo "meld '$HOME/minetest/games/ENLIVEN' '$patch_game_src'..." echo "meld '$HOME/minetest/games/ENLIVEN' '$patch_game_src'..."
@ -110,7 +110,7 @@ if [ "@$enable_meld" = "@true" ]; then
echo "* install nohup to prevent programs from dumping output to console..." echo "* install nohup to prevent programs from dumping output to console..."
fi fi
else else
customDie "You do not have meld installed." customExit "You do not have meld installed."
fi fi
fi fi
echo echo
@ -118,7 +118,7 @@ if [ "@$enable_meld" = "@true" ]; then
exit 0 exit 0
elif [ "@$enable_install" = "@true" ]; then elif [ "@$enable_install" = "@true" ]; then
if [ -z "$branch" ]; then if [ -z "$branch" ]; then
customDie "You must specify a branch name after --install." customExit "You must specify a branch name after --install."
fi fi
echo "* installing $branch branch..." echo "* installing $branch branch..."
subgame= subgame=
@ -127,7 +127,7 @@ elif [ "@$enable_install" = "@true" ]; then
elif [ -d "$project2_path/patched/mods" ]; then elif [ -d "$project2_path/patched/mods" ]; then
patch_game_src="$project2_path/patched" patch_game_src="$project2_path/patched"
else else
customDie "Cannot detect mods directory in $project2_path/mods" customExit "Cannot detect mods directory in $project2_path/mods"
fi fi
echo "rsync -rt $patch_game_src/ $HOME/minetest/games/ENLIVEN..." echo "rsync -rt $patch_game_src/ $HOME/minetest/games/ENLIVEN..."
rsync -rt "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" rsync -rt "$patch_game_src/" "$HOME/minetest/games/ENLIVEN"
@ -139,7 +139,7 @@ elif [ "@$enable_install" = "@true" ]; then
exit 0 exit 0
fi fi
if [ ! -d "$patches" ]; then if [ ! -d "$patches" ]; then
customDie "You are missing $patches so a patch basis and patched target cannot be created there." customExit "You are missing $patches so a patch basis and patched target cannot be created there."
fi fi
licenses="license.txt LICENSE LICENSE.txt oldcoder.txt LICENSE.md license.md" licenses="license.txt LICENSE LICENSE.txt oldcoder.txt LICENSE.md license.md"
usage() { usage() {
@ -199,30 +199,30 @@ dir2_pp="$(dirname -- "$dir2_p")"
#echo "* checking $dir2_pp..." #echo "* checking $dir2_pp..."
if [ ! -d "$project0_path" ]; then if [ ! -d "$project0_path" ]; then
customDie "ERROR: You must have '$project0' installed as '$project0_path'" customExit "ERROR: You must have '$project0' installed as '$project0_path'"
fi fi
if [ ! -f "$file0_path" ]; then if [ ! -f "$file0_path" ]; then
customDie "ERROR: Missing '$file0_path')" customExit "ERROR: Missing '$file0_path')"
fi fi
if [ ! -d "$dir1" ]; then if [ ! -d "$dir1" ]; then
mkdir -p "$dir1" || customDie "Cannot mkdir $dir1" mkdir -p "$dir1" || customExit "Cannot mkdir $dir1"
fi fi
if [ ! -d "$dir2" ]; then if [ ! -d "$dir2" ]; then
mkdir -p "$dir2" || customDie "Cannot mkdir $dir2" mkdir -p "$dir2" || customExit "Cannot mkdir $dir2"
fi fi
# if file1 exists, overwriting is ok--update basis so diff will make patch correctly # if file1 exists, overwriting is ok--update basis so diff will make patch correctly
echo "* updating $file1_path" echo "* updating $file1_path"
cp -f "$file0_path" "$file1_path" || customDie "Cannot cp '$file0_path' '$file1_path'" cp -f "$file0_path" "$file1_path" || customExit "Cannot cp '$file0_path' '$file1_path'"
if [ -f "$file2_path" ]; then if [ -f "$file2_path" ]; then
customDie "Nothing done since '$file2_path' already exists." customExit "Nothing done since '$file2_path' already exists."
fi fi
echo "* creating $file2_path" echo "* creating $file2_path"
cp -f "$file0_path" "$file2_path" || customDie "Cannot cp '$file0_path' '$file2_path'" cp -f "$file0_path" "$file2_path" || customExit "Cannot cp '$file0_path' '$file2_path'"
if [ -f "`command -v zbstudio`" ]; then if [ -f "`command -v zbstudio`" ]; then
nohup zbstudio "$file2_path" & nohup zbstudio "$file2_path" &
else else
@ -243,10 +243,10 @@ for license in "${arr[@]}"; do
lic2="$dir2/$license" lic2="$dir2/$license"
if [ -f "$lic0" ]; then if [ -f "$lic0" ]; then
echo "* updating LICENSE '$lic1'..." echo "* updating LICENSE '$lic1'..."
cp -f "$lic0" "$lic1" || customDie "Cannot cp -f '$lic0' '$lic1'" cp -f "$lic0" "$lic1" || customExit "Cannot cp -f '$lic0' '$lic1'"
if [ ! -f "$lic2" ]; then if [ ! -f "$lic2" ]; then
echo " - also for $project2..." echo " - also for $project2..."
cp --no-clobber "$lic0" "$lic2" || customDie "Cannot cp -f '$lic0' '$lic2'" cp --no-clobber "$lic0" "$lic2" || customExit "Cannot cp -f '$lic0' '$lic2'"
fi fi
fi fi
lic0="$dir0_p/$license" lic0="$dir0_p/$license"
@ -254,10 +254,10 @@ for license in "${arr[@]}"; do
lic2="$dir2_p/$license" lic2="$dir2_p/$license"
if [ -f "$lic0" ]; then if [ -f "$lic0" ]; then
echo "* updating LICENSE '$lic1'..." echo "* updating LICENSE '$lic1'..."
cp -f "$lic0" "$lic1" || customDie "Cannot cp -f '$lic0' '$lic1'" cp -f "$lic0" "$lic1" || customExit "Cannot cp -f '$lic0' '$lic1'"
if [ ! -f "$lic2" ]; then if [ ! -f "$lic2" ]; then
echo " - also for $project2..." echo " - also for $project2..."
cp --no-clobber "$lic0" "$lic2" || customDie "Cannot cp -f '$lic0' '$lic2'" cp --no-clobber "$lic0" "$lic2" || customExit "Cannot cp -f '$lic0' '$lic2'"
fi fi
fi fi
lic0="$dir0_pp/$license" lic0="$dir0_pp/$license"
@ -265,10 +265,10 @@ for license in "${arr[@]}"; do
lic2="$dir2_pp/$license" lic2="$dir2_pp/$license"
if [ -f "$lic0" ]; then if [ -f "$lic0" ]; then
echo "* updating '$lic1'..." echo "* updating '$lic1'..."
cp -f "$lic0" "$lic1" || customDie "Cannot cp -f '$lic0' '$lic1'" cp -f "$lic0" "$lic1" || customExit "Cannot cp -f '$lic0' '$lic1'"
if [ ! -f "$lic2" ]; then if [ ! -f "$lic2" ]; then
echo " - also for $project2..." echo " - also for $project2..."
cp --no-clobber "$lic0" "$lic2" || customDie "Cannot cp -f '$lic0' '$lic2'" cp --no-clobber "$lic0" "$lic2" || customExit "Cannot cp -f '$lic0' '$lic2'"
fi fi
fi fi
done done

22
reset-minetest-install-source.sh

@ -46,7 +46,7 @@ END
sleep 1 sleep 1
} }
customDie () { customExit () {
echo "ERROR: Cannot continue since" echo "ERROR: Cannot continue since"
echo "$1" echo "$1"
exit 1 exit 1
@ -57,7 +57,7 @@ available_release_line=`curl http://downloads.minetest.org/release.txt | head -n
available_version=$(echo $available_release_line | awk '{print $2}') available_version=$(echo $available_release_line | awk '{print $2}')
# OR: available_version="${available_release_line##* }" # get second word # OR: available_version="${available_release_line##* }" # get second word
if [ ${#available_version} -ne 6 ]; then if [ ${#available_version} -ne 6 ]; then
customDie "The available version is not recognized: $available_version" customExit "The available version is not recognized: $available_version"
fi fi
installed_release_line=`head -n 1 ~/minetest/release.txt` installed_release_line=`head -n 1 ~/minetest/release.txt`
installed_version=$(echo $installed_release_line | awk '{print $2}') installed_version=$(echo $installed_release_line | awk '{print $2}')
@ -81,10 +81,10 @@ do
if [ "@$var" = "@--offline" ]; then if [ "@$var" = "@--offline" ]; then
enable_offline=true enable_offline=true
else else
customDie "Invalid argument: $var" customExit "Invalid argument: $var"
fi fi
done done
cd "$EM_CONFIG_PATH" || customDie "[$MY_NAME] cd \"$EM_CONFIG_PATH\" failed." cd "$EM_CONFIG_PATH" || customExit "[$MY_NAME] cd \"$EM_CONFIG_PATH\" failed."
if [ -d "$extracted_path" ]; then if [ -d "$extracted_path" ]; then
# NOTE: ls -lR provides a count, so it is not suitable unless output # NOTE: ls -lR provides a count, so it is not suitable unless output
# is parsed. `| wc -l` is easier (word count). # is parsed. `| wc -l` is easier (word count).
@ -93,26 +93,26 @@ if [ -d "$extracted_path" ]; then
screenshot_count=`ls $extracted_path/screenshots/*.png | wc -l` screenshot_count=`ls $extracted_path/screenshots/*.png | wc -l`
fi fi
if [ $screenshot_count -gt 0 ]; then if [ $screenshot_count -gt 0 ]; then
mv $extracted_path/screenshots/*.png ~/ || customDie "can't move screenshots from $extracted_path/screenshots/*.png" mv $extracted_path/screenshots/*.png ~/ || customExit "can't move screenshots from $extracted_path/screenshots/*.png"
rmdir --ignore-fail-on-non-empty "$extracted_path/screenshots" rmdir --ignore-fail-on-non-empty "$extracted_path/screenshots"
fi fi
if [ `ls $extracted_path/minetest/bin/*.png | wc -l` -gt 0 ]; then if [ `ls $extracted_path/minetest/bin/*.png | wc -l` -gt 0 ]; then
# if [ ! -d screenshots ]; then mkdir screenshots; fi # if [ ! -d screenshots ]; then mkdir screenshots; fi
# NOTE: system-wide install of minetest puts screenshots in ~/ (cwd) # NOTE: system-wide install of minetest puts screenshots in ~/ (cwd)
mv $extracted_path/minetest/bin/*.png ~/ || customDie "can't move screenshots from $extracted_path/minetest/bin/*.png" mv $extracted_path/minetest/bin/*.png ~/ || customExit "can't move screenshots from $extracted_path/minetest/bin/*.png"
fi fi
rm -Rf "$extracted_path" || customDie "can't remove $extracted_name" rm -Rf "$extracted_path" || customExit "can't remove $extracted_name"
fi fi
if [ "@$enable_offline" = "@true" ]; then if [ "@$enable_offline" = "@true" ]; then
if [ ! -f "$zip_name" ]; then if [ ! -f "$zip_name" ]; then
customDie "* Offline install is impossible without '`pwd`/$zip_name'." customExit "* Offline install is impossible without '`pwd`/$zip_name'."
fi fi
else else
wget -O "$EM_CONFIG_PATH/$zip_name" $url/$zip_name || customDie "no $zip_name at $url" wget -O "$EM_CONFIG_PATH/$zip_name" $url/$zip_name || customExit "no $zip_name at $url"
fi fi
unzip -u $zip_name || customDie "Can't unzip $zip_name" unzip -u $zip_name || customExit "Can't unzip $zip_name"
cd "$extracted_name" || customDie "Unzipping \"$zip_name\" in \"`pwd`\" did not result in a readable directory named \"$extracted_name\" there." cd "$extracted_name" || customExit "Unzipping \"$zip_name\" in \"`pwd`\" did not result in a readable directory named \"$extracted_name\" there."
cat "$extracted_path/release.txt" cat "$extracted_path/release.txt"
echo "compiling libraries..." echo "compiling libraries..."
date date

20
utilities/extra/install-ENLIVEN-minetest_game.sh

@ -49,7 +49,7 @@ if [ ! -f minetestenv.rc ]; then
fi fi
EnlivenMinetest_dir="`pwd`" EnlivenMinetest_dir="`pwd`"
if [ ! -f minetestenv.rc ]; then if [ ! -f minetestenv.rc ]; then
# NOTE: customDie is not defined until after this clause. # NOTE: customExit is not defined until after this clause.
echo "ERROR: Nothing done since missing minetestenv.rc (must be in same directory or '$HOME/git/EnlivenMinetest' or '`pwd`')." echo "ERROR: Nothing done since missing minetestenv.rc (must be in same directory or '$HOME/git/EnlivenMinetest' or '`pwd`')."
echo "This session will exit unless you press Ctrl-C to cancel script..." echo "This session will exit unless you press Ctrl-C to cancel script..."
sleep 1 sleep 1
@ -137,7 +137,7 @@ BUILD_DATE=`date '+%Y-%m-%d'`
# BACKUP world.mt: # BACKUP world.mt:
if [ ! -d "$MT_MYGAME_DIR" ]; then if [ ! -d "$MT_MYGAME_DIR" ]; then
mkdir "$MT_MYGAME_DIR" || customDie "$USER cannot mkdir '$MT_MYGAME_DIR' (make sure the directory containing it exists)" mkdir "$MT_MYGAME_DIR" || customExit "$USER cannot mkdir '$MT_MYGAME_DIR' (make sure the directory containing it exists)"
show_changes="false" show_changes="false"
# else # else
# # workaround bug in earlier version of installer # # workaround bug in earlier version of installer
@ -226,7 +226,7 @@ fi
#sudo mkdir "$MT_MYGAME_DIR" #sudo mkdir "$MT_MYGAME_DIR"
#sudo mkdir "$MT_MYGAME_MODS_PATH" #sudo mkdir "$MT_MYGAME_MODS_PATH"
if [ ! -d "$MT_MYGAME_DIR/" ]; then if [ ! -d "$MT_MYGAME_DIR/" ]; then
customDie "ERROR: failed to create $MT_MYGAME_DIR, so cannot continue." customExit "ERROR: failed to create $MT_MYGAME_DIR, so cannot continue."
fi fi
#sudo cp -R $USR_SHARE_MINETEST/games/$mtgame_name/mods/* "$MT_MYGAME_DIR/mods/" #sudo cp -R $USR_SHARE_MINETEST/games/$mtgame_name/mods/* "$MT_MYGAME_DIR/mods/"
echo "Copying $MT_MINETEST_GAME_PATH to $MT_MYGAME_DIR" echo "Copying $MT_MINETEST_GAME_PATH to $MT_MYGAME_DIR"
@ -393,10 +393,10 @@ if [ "$enable_spawners" = "true" ]; then
echo "removing $MTMOD_DEST_NAME..." echo "removing $MTMOD_DEST_NAME..."
rm -Rf "$MTMOD_DEST_PATH" rm -Rf "$MTMOD_DEST_PATH"
else else
customDie "ERROR: could not find $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install" customExit "ERROR: could not find $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install"
fi fi
if [ -d "$MTMOD_DEST_PATH" ]; then if [ -d "$MTMOD_DEST_PATH" ]; then
customDie "ERROR: could not remove $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install" customExit "ERROR: could not remove $MTMOD_DEST_PATH for removal, so cancelling ENLIVEN install"
fi fi
#defaults are: #defaults are:
@ -557,7 +557,7 @@ add_git_mod lapis LapisLazuli https://github.com/Napiophelios/LapisLazuli.git
# echo "WARNING: not enabling columns in $MTMOD_DEST_PATH/init.lua since already patched as indicated by the presence of '$MTMOD_DEST_PATH/columns_enabled' flag file." # echo "WARNING: not enabling columns in $MTMOD_DEST_PATH/init.lua since already patched as indicated by the presence of '$MTMOD_DEST_PATH/columns_enabled' flag file."
# fi # fi
#else #else
# customDie "FAILED to patch lapis since no $MTMOD_DEST_PATH/init.lua" # customExit "FAILED to patch lapis since no $MTMOD_DEST_PATH/init.lua"
#fi #fi
echo "not installing helicopter--crashes 0.4.14-git, but was updated on 2017-06-08 and was not tested since then" echo "not installing helicopter--crashes 0.4.14-git, but was updated on 2017-06-08 and was not tested since then"
@ -708,7 +708,7 @@ else
if [ -d "$MT_MYGAME_MODS_PATH/farming" ]; then if [ -d "$MT_MYGAME_MODS_PATH/farming" ]; then
echo " [ + ] reinstalled minetest_game farming." echo " [ + ] reinstalled minetest_game farming."
else else
customDie "ERROR: failed to install $USR_SHARE_MINETEST/games/$mtgame_name/mods/farming to $MT_MYGAME_MODS_PATH/farming, so cannot continue." customExit "ERROR: failed to install $USR_SHARE_MINETEST/games/$mtgame_name/mods/farming to $MT_MYGAME_MODS_PATH/farming, so cannot continue."
fi fi
add_git_mod crops crops https://github.com/minetest-mods/crops add_git_mod crops crops https://github.com/minetest-mods/crops
fi fi
@ -894,7 +894,7 @@ if [ -d "$PATCHES_PATH" ]; then
fi fi
cp -f $PATCHES_PATH/deprecated/mods-multiplayer-minetest_game/$PATCH_SKINS_MOD_NAME/$SUB_NAME/* "$SUB_PATH" cp -f $PATCHES_PATH/deprecated/mods-multiplayer-minetest_game/$PATCH_SKINS_MOD_NAME/$SUB_NAME/* "$SUB_PATH"
if [ ! -d "$SUB_PATH" ]; then if [ ! -d "$SUB_PATH" ]; then
customDie "ERROR: failed to install poikilos's skins to $SUB_PATH, so cannot continue." customExit "ERROR: failed to install poikilos's skins to $SUB_PATH, so cannot continue."
else else
echo "installed poikilos's skins to $SUB_PATH" echo "installed poikilos's skins to $SUB_PATH"
fi fi
@ -906,7 +906,7 @@ if [ -d "$PATCHES_PATH" ]; then
fi fi
cp -f $PATCHES_PATH/deprecated/mods-multiplayer-minetest_game/$PATCH_SKINS_MOD_NAME/$SUB_NAME/* "$SUB_PATH" cp -f $PATCHES_PATH/deprecated/mods-multiplayer-minetest_game/$PATCH_SKINS_MOD_NAME/$SUB_NAME/* "$SUB_PATH"
if [ ! -d "$SUB_PATH" ]; then if [ ! -d "$SUB_PATH" ]; then
customDie "ERROR: failed to install poikilos's skins to $SUB_PATH, so cannot continue." customExit "ERROR: failed to install poikilos's skins to $SUB_PATH, so cannot continue."
else else
echo "installed metadata for poikilos's skins to $SUB_PATH" echo "installed metadata for poikilos's skins to $SUB_PATH"
fi fi
@ -981,7 +981,7 @@ if [ -d "$PATCHES_PATH" ]; then
echo "# cp -Rf $PATCHES_PATH/mods-stopgap-minetest_game/* $MT_MYGAME_MODS_PATH/" echo "# cp -Rf $PATCHES_PATH/mods-stopgap-minetest_game/* $MT_MYGAME_MODS_PATH/"
#echo "rm -Rf $MT_MYGAME_MODS_PATH/1.nonworking # leftovers from deprecated ENLIVEN installer" #echo "rm -Rf $MT_MYGAME_MODS_PATH/1.nonworking # leftovers from deprecated ENLIVEN installer"
else else
customDie "did not find $PATCHES_PATH" customExit "did not find $PATCHES_PATH"
fi fi
echo echo
if [ "$enable_version_0_5" != "true" ]; then if [ "$enable_version_0_5" != "true" ]; then

8
utilities/extra/uninstall.sh

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
extracted_path=$HOME/Downloads/minetest extracted_path=$HOME/Downloads/minetest
mnf_name=install_manifest.txt mnf_name=install_manifest.txt
customDie() { customExit() {
echo echo
echo "ERROR:" echo "ERROR:"
echo "$1" echo "$1"
@ -10,14 +10,14 @@ customDie() {
exit 1 exit 1
} }
if [ ! -f "$extracted_path/$mnf_name" ]; then if [ ! -f "$extracted_path/$mnf_name" ]; then
customDie "$extracted_path/$mnf_name is missing, so $0 cannot continue." customExit "$extracted_path/$mnf_name is missing, so $0 cannot continue."
fi fi
if [ ! -f "`command -v xargs`" ]; then if [ ! -f "`command -v xargs`" ]; then
customDie "This script cannot work without xargs. Try uninstall.py." customExit "This script cannot work without xargs. Try uninstall.py."
fi fi
cd $extracted_path || customDie "* cannot cd $extracted_path." cd $extracted_path || customExit "* cannot cd $extracted_path."
echo "- about to run 'sudo xargs rm < $mnf_name'..." echo "- about to run 'sudo xargs rm < $mnf_name'..."
xargs rm < $mnf_name xargs rm < $mnf_name
echo "- about to run 'sudo xargs rmdir --ignore-fail-on-non-empty < $mnf_name'..." echo "- about to run 'sudo xargs rmdir --ignore-fail-on-non-empty < $mnf_name'..."

6
utilities/generatemod.py

@ -7,7 +7,7 @@ myPath = os.path.realpath(__file__)
myDir = os.path.dirname(myPath) myDir = os.path.dirname(myPath)
def customDie(msg, code=1): def customExit(msg, code=1):
print("") print("")
print("ERROR:") print("ERROR:")
print(msg) print(msg)
@ -67,7 +67,7 @@ for i in range(1, len(sys.argv)):
else: else:
if (len(sys.argv[i]) >= 2) and (sys.argv[i][:2] == "--"): if (len(sys.argv[i]) >= 2) and (sys.argv[i][:2] == "--"):
usage() usage()
customDie("Invalid option: " + sys.argv[i]) customExit("Invalid option: " + sys.argv[i])
options.append(sys.argv[i]) options.append(sys.argv[i])
if (len(options) != 1) and (len(options) != 3): if (len(options) != 1) and (len(options) != 3):
usage() usage()
@ -90,7 +90,7 @@ if (len(options) == 3):
toMod = toName[:delimI] toMod = toName[:delimI]
if toMod.find(":") > -1: if toMod.find(":") > -1:
usage() usage()
customDie("Your modname contains too many colons.") customExit("Your modname contains too many colons.")
exit(1) exit(1)
else: else:
toMod = "default" toMod = "default"

30
versionize.sh

@ -3,7 +3,7 @@ echo
echo "Collecting version..." echo "Collecting version..."
MY_NAME="versionize.sh" MY_NAME="versionize.sh"
EM_CONFIG_PATH=$HOME/.config/EnlivenMinetest EM_CONFIG_PATH=$HOME/.config/EnlivenMinetest
cd "$EM_CONFIG_PATH" || customDie "[$MY_NAME] cd \"$EM_CONFIG_PATH\" failed." cd "$EM_CONFIG_PATH" || customExit "[$MY_NAME] cd \"$EM_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
@ -40,7 +40,7 @@ END
echo "1..." echo "1..."
sleep 1 sleep 1
} }
customDie() { customExit() {
echo echo
echo "ERROR:" echo "ERROR:"
echo " $1" echo " $1"
@ -54,7 +54,7 @@ destroy_msg=""
src_path="$EM_CONFIG_PATH/linux-minetest-kit" src_path="$EM_CONFIG_PATH/linux-minetest-kit"
versions_path="$EM_CONFIG_PATH/minetest-versions" versions_path="$EM_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" || customExit "mkdir $versions_path FAILED"
fi fi
src_name="" src_name=""
try_path="$EM_CONFIG_PATH/$original_src_path" try_path="$EM_CONFIG_PATH/$original_src_path"
@ -63,14 +63,14 @@ if [ -f "$original_src_path" ]; then
elif [ -d "$original_src_path" ]; then elif [ -d "$original_src_path" ]; then
echo "* detected directory param..." echo "* detected directory param..."
else else
customDie "$original_src_path is not a file or directory." customExit "$original_src_path is not a file or directory."
fi fi
cd /tmp || customDie "cannot cd to /tmp" cd /tmp || customExit "cannot cd to /tmp"
if [ -d versionize ]; then if [ -d versionize ]; then
rm -Rf versionize || customDie "cannot remove /tmp/versionize" rm -Rf versionize || customExit "cannot remove /tmp/versionize"
fi fi
mkdir versionize || customDie "cannot create /tmp/versionize" mkdir versionize || customExit "cannot create /tmp/versionize"
cd /tmp/versionize || customDie "cannot cd /tmp/versionize" cd /tmp/versionize || customExit "cannot cd /tmp/versionize"
if [ -f "$original_src_path" ]; then if [ -f "$original_src_path" ]; then
echo "* detected archive file full path..." echo "* detected archive file full path..."
try_path="$original_src_path" try_path="$original_src_path"
@ -86,18 +86,18 @@ if [ -f "$try_path" ]; then
unzip "$try_path" unzip "$try_path"
src_name="`ls`" src_name="`ls`"
if [ ! -d "$src_name" ]; then if [ ! -d "$src_name" ]; then
customDie "unzip $try_path did not result in a directory!" customExit "unzip $try_path did not result in a directory!"
fi fi
src_path="`pwd`/$src_name" src_path="`pwd`/$src_name"
destroy_msg=" (but will be destroyed on next run)" destroy_msg=" (but will be destroyed on next run)"
if [ ! -d "$src_path" ]; then if [ ! -d "$src_path" ]; then
customDie "$src_path from unzip $try_path is not a directory!" customExit "$src_path from unzip $try_path is not a directory!"
fi fi
elif [ -d "$try_path" ]; then elif [ -d "$try_path" ]; then
src_path="$try_path" src_path="$try_path"
src_name="`basename $src_path`" src_name="`basename $src_path`"
else else
customDie "$try_path is not a file or directory." customExit "$try_path is not a file or directory."
fi fi
release_txt_path="$src_path/minetest/release.txt" release_txt_path="$src_path/minetest/release.txt"
if [ ! -f "$release_txt_path" ]; then if [ ! -f "$release_txt_path" ]; then
@ -106,7 +106,7 @@ if [ ! -f "$release_txt_path" ]; then
echo echo
echo echo
echo "* '$src_path' remains$destroy_msg." echo "* '$src_path' remains$destroy_msg."
customDie "Missing $release_txt_path (or $src_path/release.txt)" customExit "Missing $release_txt_path (or $src_path/release.txt)"
else else
echo "Missing $release_txt_path (usually copied from $try_release_txt_path by EnlivenMinetest compille script(s)); reverting to $try_release_txt_path" echo "Missing $release_txt_path (usually copied from $try_release_txt_path by EnlivenMinetest compille script(s)); reverting to $try_release_txt_path"
release_txt_path="$try_release_txt_path" release_txt_path="$try_release_txt_path"
@ -116,7 +116,7 @@ release_line="`head -n 1 $release_txt_path`"
version="${release_line##* }" # get second word version="${release_line##* }" # get second word
version_len=${#version} version_len=${#version}
if [ "$version_len" -ne "6" ]; then if [ "$version_len" -ne "6" ]; then
customDie "Unexpected version scheme (not 6 characters): '$version' near '$release_line' in file $release_txt_path" customExit "Unexpected version scheme (not 6 characters): '$version' near '$release_line' in file $release_txt_path"
fi fi
echo "src_name=$src_name" echo "src_name=$src_name"
echo "src_path=$src_path" echo "src_path=$src_path"
@ -138,7 +138,7 @@ if [ ! -z "$src_archive" ]; then
customWarn "This will overwrite '$dst_archive' with '$src_archive'." customWarn "This will overwrite '$dst_archive' with '$src_archive'."
fi fi
if [ -f "$src_archive" ]; then if [ -f "$src_archive" ]; then
mv "$src_archive" "$dst_archive" || customDie "Cannot mv '$src_archive' '$dst_archive'" mv "$src_archive" "$dst_archive" || customExit "Cannot mv '$src_archive' '$dst_archive'"
echo "* moved archive to '$dst_archive'" echo "* moved archive to '$dst_archive'"
echo echo
echo echo
@ -160,7 +160,7 @@ if [ -d "$dest_path" ]; then
echo echo
exit 0 exit 0
fi fi
mv "$src_path" "$dest_path" || customDie "Failed to move to 'dest_path'" mv "$src_path" "$dest_path" || customExit "Failed to move to 'dest_path'"
echo echo
echo "Done $0." echo "Done $0."
echo echo

Loading…
Cancel
Save