Browse Source

shared minetest.rc functions, cache repos for install as update

fix: shouldn't assume in subdir, fedora deps for minetestmapper, pathing
variable naming, mod listing logic, use updated travelnet; fix
install-subgametest.py
master
poikilos 6 years ago
committed by Jacob Gustafson
parent
commit
bb0cf35306
  1. 97
      install-ENLIVEN.sh
  2. 88
      install-subgametest.py
  3. 0
      minetest.conf.server
  4. 252
      minetestenv.rc
  5. 0
      patches/mods-integration - debug (various warnings on each startup, Mar 8, 2017).txt
  6. 1
      patches/mods-multiplayer/bones_log/init.lua

97
install-ENLIVEN.sh

@ -44,15 +44,18 @@ if [ ! -f minetestenv.rc ]; then
fi
fi
if [ ! -f minetestenv.rc ]; then
echo "ERROR: Nothing done since missing minetestenv.rc (must be in same directory)"
sleep 1
echo "ERROR: Nothing done since missing minetestenv.rc (must be in same directory). Press Ctrl-C or allow this session to exit."
sleep 5
exit 1
fi
source minetestenv.rc
#endregion paste this part into terminal to get some great environment variables
if [ -f "$MOD_LIST" ]; then
rm -f "$MOD_LIST"
fi
ls "$MT_MINETEST_GAME_PATH/mods" > "$MOD_LIST"
@ -63,11 +66,20 @@ source minetestenv.rc
if [ ! -f "`command -v minetestmapper`" ]; then
echo "getting minetestmapper..."
if [ -f "`command -v apt`" ]; then
sudo apt -y install libgd-dev libsqlite3-dev libleveldb-dev libhiredis-dev libpq-dev
else
if [ -f "`command -v pacman`" ]; then
pacman -Syyu --noconfirm gd sqlite leveldb hiredis postgresql #postgresql-libs
if [ -f "`command -v dnf`" ]; then
echo "installing deps for minetestmapper via dnf..."
sudo dnf -y install gd-devel sqlite-devel leveldb-devel hiredis-devel postgresql-devel
else
if [ -f "`command -v pacman`" ]; then
echo "installing deps for minetestmapper via pacman..."
sudo pacman -Syyu --noconfirm gd sqlite leveldb hiredis postgresql #postgresql-libs
else
echo "ERROR: packager is unknown--manually get deps (gd-devel sqlite-devel leveldb-devel hiredis-devel postgresql-devel) then run again."
fi
fi
fi
cd ~/Downloads
@ -99,6 +111,7 @@ if [ -f "$MT_MYWORLD_DIR/world.mt.1st" ]; then
fi
if [ ! -d "$MT_MYGAME_DIR" ]; then
sudo mkdir "$MT_MYGAME_DIR"
show_changes="false"
else
# workaround bug in earlier version of installer
sudo chown -R `cat /tmp/local_mts_user` "$MT_MYGAME_DIR"
@ -152,11 +165,15 @@ if [ -z "$world_mt_var_player_backend" ]; then
echo "has no player_backend, setting sqlite3..."
echo "player_backend = sqlite3" >> "$WORLD_MT_PATH"
fi
echo "teleport_perms_to_build = false" >> "$WORLD_MT_PATH"
echo "teleport_perms_to_configure = false" >> "$WORLD_MT_PATH"
echo "teleport_requires_pairing = true" >> "$WORLD_MT_PATH"
echo "teleport_pairing_check_radius = 2" >> "$WORLD_MT_PATH"
echo "teleport_default_coordinates = 0,0,0" >> "$WORLD_MT_PATH"
#only for BadCommand's teleporter mod https://forum.minetest.net/viewtopic.php?id=2149 (NOT for travelnet) but probably should go in minetest.conf in subgame's directory, not in world.mt
#if [ -d "$MT_MYGAME_MODS_PATH" ]; then
# echo "teleport_perms_to_build = false" >> "$WORLD_MT_PATH"
# echo "teleport_perms_to_configure = false" >> "$WORLD_MT_PATH"
# echo "teleport_requires_pairing = true" >> "$WORLD_MT_PATH"
# echo "teleport_pairing_check_radius = 2" >> "$WORLD_MT_PATH"
# echo "teleport_default_coordinates = 0,0,0" >> "$WORLD_MT_PATH"
#fi
#MT_MYGAME_DIR (a Minetest "game") is the equivalent of a Minecraft modpack, however, in this case it is actually a collection of mods and modpacks, either of which can be in the mods folder
@ -225,9 +242,19 @@ echo "disallow_empty_passwords = true" >> "$WRITEABLE_MINETEST_CONF"
echo "secure.trusted_mods = advanced_npc" >> "$WRITEABLE_MINETEST_CONF"
echo "server_dedicated = false" >> "$WRITEABLE_MINETEST_CONF"
#echo "hudbars_bar_type = statbar_modern" >> "$WRITEABLE_MINETEST_CONF" #TODO: remove this after fully deprecated
#region sprint settings only for hbsprint (NOT GunshipPenguin sprint)
echo "sprint_speed = 2.25" >> "$WRITEABLE_MINETEST_CONF" # default is 1.3
echo "sprint_jump = 1.25" >> "$WRITEABLE_MINETEST_CONF" # default is 1.1
echo "sprint_stamina_drain = .5" >> "$WRITEABLE_MINETEST_CONF" # default is 2
#endregion sprint settings only for hbsprint (NOT GunshipPenguin sprint)
#TODO: possibly fork and do pull request for configuring GunshipPenguin sprint's hard-coded variables in init.lua:
#SPRINT_METHOD = 1
#SPRINT_SPEED = 1.8
#SPRINT_JUMP = 1.1
#SPRINT_STAMINA = 20
#SPRINT_TIMEOUT = 0.5 --Only used if SPRINT_METHOD = 0
echo "bones_position_message = true" >> "$WRITEABLE_MINETEST_CONF" # default is false--this is for client-side chat message (server-side logging always on though)
#no longer needed since these mods check for player_api to determine whether v3 model is used:
if [ "$version_0_5_enable" = "true" ]; then
@ -450,17 +477,18 @@ add_git_mod treasurer minetest_treasurer http://repo.or.cz/minetest_treasurer.gi
cd "$HOME/Downloads"
MTMOD_DEST_NAME=trm_pyramids
MTMOD_UNZ_NAME=trm_pyramids
MTMOD_GOT_NAME=trm_pyramids
MTMOD_DEST_PATH=$MT_MYGAME_MODS_PATH/$MTMOD_DEST_NAME
if [ ! -z "`ls | grep $MTMOD_UNZ_NAME`" ]; then # works with wildcard in variable
rm -Rf "$MTMOD_UNZ_NAME"
if [ ! -z "`ls | grep $MTMOD_GOT_NAME`" ]; then # works with wildcard in variable
rm -Rf "$MTMOD_GOT_NAME"
fi
mkdir "$MTMOD_UNZ_NAME"
cd "$MTMOD_UNZ_NAME"
mkdir "$MTMOD_GOT_NAME"
cd "$MTMOD_GOT_NAME"
wget https://github.com/MinetestForFun/server-minetestforfun/raw/master/mods/trm_pyramids/depends.txt
wget https://github.com/MinetestForFun/server-minetestforfun/raw/master/mods/trm_pyramids/init.lua
wget https://github.com/MinetestForFun/server-minetestforfun/raw/master/mods/trm_pyramids/more_trms.lua
wget https://github.com/MinetestForFun/server-minetestforfun/blob/master/LICENSE
echo "trm_pyramids" >> "$MOD_LIST"
if [ -d "$MTMOD_DEST_PATH" ]; then
sudo rm -Rf "$MTMOD_DEST_PATH"
fi
@ -470,7 +498,7 @@ sudo mv -f init.lua "$MTMOD_DEST_PATH/"
sudo mv -f more_trms.lua "$MTMOD_DEST_PATH/"
sudo mv -f LICENSE "$MTMOD_DEST_PATH/"
cd ..
rmdir "$MTMOD_UNZ_NAME"
rmdir "$MTMOD_GOT_NAME"
if [ ! -z "`ls "$MTMOD_DEST_PATH"`" ]; then
echo " [ + ] added as $MTMOD_DEST_PATH"
else
@ -634,7 +662,9 @@ add_git_mod homedecor_modpack homedecor_modpack https://github.com/minetest-mods
add_git_mod unifieddyes unifieddyes https://github.com/minetest-mods/unifieddyes.git
#Sokomine's original version has no security ( https://forum.minetest.net/viewtopic.php?id=4877 )
# https://github.com/Sokomine/travelnet/archive/master.zip
add_git_mod travelnet travelnet https://github.com/poikilos/travelnet.git
# add_git_mod travelnet travelnet https://github.com/poikilos/travelnet.git
# for now, manually get branch with sound (until Sokomine merges it--in addition, also check what else I may have manually merged thats not yet in his):
add_git_mod travelnet travelnet https://github.com/poikilos/travelnet restore_sound
add_git_mod anvil anvil https://github.com/minetest-mods/anvil.git
add_git_mod sling sling https://github.com/minetest-mods/sling.git
#REPLACES PilzAdam's, modified by kaeza, maintained by VenessaE; FORMERLY in homedecor_modpack
@ -801,10 +831,12 @@ echo
if [ -d "$PATCHES_PATH" ]; then
echo "adding the following necessary integration mods:"
ls $PATCHES_PATH/mods-integration/
ls $PATCHES_PATH/mods-integration | grep -v debug >> "$MOD_LIST"
sudo cp -R $PATCHES_PATH/mods-integration/* "$MT_MYGAME_MODS_PATH/"
echo
echo "adding the following multiplayer mods:"
ls $PATCHES_PATH/mods-multiplayer/
ls $PATCHES_PATH/mods-multiplayer/ | grep -v skinsdb >> "$MOD_LIST"
sudo cp -R $PATCHES_PATH/mods-multiplayer/* "$MT_MYGAME_MODS_PATH/"
echo "adding non-manual patches to subgame (vs minetest_game and downloaded mods):"
echo "patching $MT_MYGAME_DIR (files only, so 'omitting directory' warnings are ok)..."
@ -934,6 +966,14 @@ fi
#echo "sudo rm -Rf $MT_MYGAME_MODS_PATH/1.nonworking # leftovers from deprecated ENLIVEN installer"
else
echo "did not find $PATCHES_PATH, so skipped automatic patching which is partially implemented"
echo "continuing anyway unless Ctrl-C is pressed..."
echo 1
echo "3..."
echo 1
echo "2..."
echo 1
echo "1..."
echo 1
fi
echo
if [ "$version_0_5_enable" != "true" ]; then
@ -1010,9 +1050,28 @@ if [ -f "`command -v blender`" ]; then
mkdir Downloads
fi
cd Downloads
git clone https://github.com/minetest/B3DExport.git
echo "WARNING: you have to manually install $HOME/Downloads/B3DExport/B3DExport.py using Blender's File Menu, User Preferences, Add-ons, 'Install Add-on from File...', press OK, then check the 'Import-Export B3D' box in the Add-ons list, then Save User Settings"
if [ ! -d "B3DExport" ]; then
git clone https://github.com/minetest/B3DExport.git
else
cd "B3DExport"
git pull
cd ..
fi
echo "NOTICE: For B3DExport from Blender you must manually install $HOME/Downloads/B3DExport/B3DExport.py using Blender's File Menu, User Preferences, Add-ons, 'Install Add-on from File...', press OK, then check the 'Import-Export B3D' box in the Add-ons list, then Save User Settings"
sleep 3
cd
fi
fi
echo "Hopefully <https://github.com/minetest-mods/technic/issues/448> is fixed by the time you try this, otherwise you'll have to patch /usr/local/share/minetest/games/ENLIVEN/mods/technic/technic/machines/register/extractor_recipes.lua manually using workaround at <https://github.com/minetest/minetest/issues/6513>."
echo
ls $MT_MYGAME_MODS_PATH > "$CONFIG_PATH/actual_mod_list.txt"
sort "$MOD_LIST" > "$CONFIG_PATH/mod_list_sorted.txt"
if [ ! -z "`diff "$CONFIG_PATH/mod_list_sorted.txt" "$CONFIG_PATH/actual_mod_list.txt"`" ]; then
echo "Any failures to install will be listed below."
diff "$CONFIG_PATH/mod_list_sorted.txt" "$CONFIG_PATH/actual_mod_list.txt"
fi
if [ ! -d "$MT_MYGAME_MODS_PATH/dungeon_loot" ]; then
echo "No mod loot for dungeon_loot (nor forks of worldgen mods which should use it) are in ENLIVEN, so dungeon_loot from $mtgame_name is removed by this script for now (treasurer and relevant trm_* mods are used instead)."
fi
echo
echo

88
install-subgametest.py

@ -21,9 +21,9 @@ except:
" but if in *nix-like environment first 'su -', and if no\n"
" pip, use your software manager to install:\n"
" python-pip or python2-pip or python3-pip)\n"
"sudo python2 -m pip install --upgrade pip\n"
"sudo python2 -m pip install --upgrade pip wheel"
"sudo python -m pip install gitpython\n")
"sudo python3 -m pip install --upgrade pip\n"
"sudo python3 -m pip install --upgrade pip wheel\n"
"sudo python3 -m pip install gitpython\n")
#Possible commands:
# pkg install -y python3-pip python2-pip
# apt-get install -y python3-pip python2-pip
@ -39,14 +39,16 @@ except:
import os
import shutil
import sys
from winclient.forwardfilesync import *
from forwardfilesync import *
profile_path = None
if 'HOME' in os.environ: # if os_name=="windows":
if 'HOME' in os.environ: # if os.name=="windows":
profile_path = os.environ['HOME']
else:
profile_path = os.environ['USERPROFILE']
if not os.path.isdir(profile_path):
print("")
print("Failed to get existing home path--tried HOME & USERPROFILE")
@ -54,7 +56,31 @@ if not os.path.isdir(profile_path):
input("press enter to close")
exit(2)
USR_SHARE_MINETEST="/usr/share/games/minetest"
configs_path = os.path.join(profile_path, ".config")
if os.name == "windows":
base_path = os.path.join(profile_path, "AppData")
configs_path = os.path.join(base_path, "Local")
CONFIG_PATH = os.path.join(configs_path, "EnlivenMinetest")
if not os.path.isdir(CONFIG_PATH):
os.makedirs(CONFIG_PATH)
#NOTE: not using /var/cache
caches_path = os.path.join(CONFIG_PATH, "cache")
RELEASES_PATH = os.path.join(caches_path, "releases")
GIT_REPOS_PATH = os.path.join(caches_path, "git")
GIT_BRANCHES_PATH = os.path.join(caches_path, "git-branches")
if not os.path.isdir(RELEASES_PATH):
os.makedirs(RELEASES_PATH)
if not os.path.isdir(GIT_REPOS_PATH):
os.makedirs(GIT_REPOS_PATH)
if not os.path.isdir(GIT_BRANCHES_PATH):
os.makedirs(GIT_BRANCHES_PATH)
USR_SHARE_MINETEST = "/usr/share/games/minetest"
if not os.path.isdir(USR_SHARE_MINETEST):
if os.path.isdir("/usr/local/share/minetest"):
#IF git version is installed:
@ -72,7 +98,10 @@ MT_GAMES_DIR = os.path.join(USR_SHARE_MINETEST,"games")
MT_MYGAME_NAME = "subgametest"
MT_MYGAME_DIR=os.path.join(MT_GAMES_DIR,MT_MYGAME_NAME)
folder_path = os.path.join(MT_GAMES_DIR, "minetest_game")
mtg_game_name = "minetest_game"
MTG_PATH = os.path.join(MT_GAMES_DIR, mtg_game_name)
folder_path = MTG_PATH
MTG_MODS_PATH = os.path.join(MTG_PATH, "mods")
if not os.path.isdir(folder_path):
print("Could not find \"" + folder_path + "\". Script ended early.")
@ -136,30 +165,43 @@ MTMOD_DEST_PATH = os.path.join(MT_MYGAME_MODS_PATH, MTMOD_DEST_NAME)
# shutil.rmtree(dst_path)
if not os.path.isdir(os.path.join(profile_path,"Downloads")):
os.makedirs(os.path.join(profile_path,"Downloads"))
if not os.path.isdir(os.path.join(profile_path,"Downloads")):
print("Cannot create " + os.path.join(profile_path,"Downloads") + " so cannot continue.")
if not os.path.isdir(GIT_REPOS_PATH):
print("Cannot create " + GIT_REPOS_PATH + " so cannot continue.")
input("press enter to close...")
exit(8)
mods_installed_list = list()
TMP_DIR=os.path.join(os.path.join(profile_path,"Downloads"),"minetest-mods")
# TODO: actually install something (from spreadsheet maybe)
if not os.path.isdir(TMP_DIR):
os.makedirs(TMP_DIR)
if not os.path.isdir(TMP_DIR):
print("Cannot create " + TMP_DIR + " so cannot continue.")
input("press enter to close...")
exit(9)
mtg_mods_list = list()
folder_path = MTG_MODS_PATH
if os.path.isdir(folder_path):
for sub_name in os.listdir(folder_path):
sub_path = os.path.join(folder_path, sub_name)
if sub_name[:1]!="." and os.path.isdir(sub_path):
mtg_mods_list.append(sub_name)
mods_installed_list = list()
mods_added_list = list()
folder_path = MT_MYGAME_MODS_PATH
if os.path.isdir(folder_path):
for sub_name in os.listdir(folder_path):
sub_path = os.path.join(folder_path, sub_name)
if sub_name[:1]!="." and os.path.isdir(sub_path):
mods_installed_list.append(sub_name)
if sub_name not in mtg_mods_list:
mods_added_list.append(sub_name)
else:
print("Missing '" + folder_path + "'")
print("")
print("")
print("Installed " + str(len(mods_installed_list)) + " mod(s).")
print("Installed " + str(len(mods_installed_list)) + " mod(s)" +
" (" + str(len(mtg_mods_list)) + " from " + mtg_game_name + ").")
if len(mods_added_list) > 0:
print("Added:")
for mod_name in mods_added_list:
print(" - " + mod_name)
print("")
input("press enter to close...")
#cd $TMP_DIR

0
mintest.conf.server → minetest.conf.server

252
minetestenv.rc

@ -1,8 +1,23 @@
CONFIGS_PATH="$HOME/.config/EnlivenMinetest"
if [ ! -d "$CONFIGS_PATH" ]; then
mkdir -p "$CONFIGS_PATH"
CONFIG_PATH="$HOME/.config/EnlivenMinetest"
if [ ! -d "$CONFIG_PATH" ]; then
mkdir -p "$CONFIG_PATH"
fi
RELEASES_PATH="$CONFIG_PATH/cache/releases"
if [ ! -d "$RELEASES_PATH" ]; then
mkdir -p "$RELEASES_PATH"
fi
GIT_REPOS_PATH="$CONFIG_PATH/cache/git"
if [ ! -d "$GIT_REPOS_PATH" ]; then
mkdir -p "$GIT_REPOS_PATH"
fi
GIT_BRANCHES_PATH="$CONFIG_PATH/cache/git-branches"
if [ ! -d "$GIT_BRANCHES_PATH" ]; then
mkdir -p "$GIT_BRANCHES_PATH"
fi
MOD_LIST="$CONFIG_PATH/mod_list.txt"
# * Git version uses /home/*/minetest/games and /usr/local/share/minetest/games but the latter is used for minetestserver (minetest-server package)
# * Arch stable version uses /usr/share/minetest/
if [ "$1" = "--help" ]; then
@ -49,6 +64,7 @@ err_txt=$HOME/err-enliven.txt
# could be -bash or bash
#if [ "$0" = "-bash" ]; then
#'[[' doesn't work in debian
show_changes="true"
if [[ $0 == *"$shell_name"* ]]; then
REPO_PATH="$HOME/GitHub/EnlivenMinetest"
echo "You must have pasted this into terminal, so assuming REPO_PATH:"
@ -57,10 +73,14 @@ else
SCRIPT=$(readlink -f "$0")
# Absolute path this script is in, thus /home/user/bin
SCRIPTPATH=$(dirname "$SCRIPT")
REPO_PATH=$(dirname "$SCRIPTPATH")
REPO_PATH="$SCRIPTPATH"
#formerly, this script was in a subdir:
#REPO_PATH=$(dirname "$SCRIPTPATH")
fi
PATCHES_PATH="$REPO_PATH/patches"
echo "PATCHES_PATH: $PATCHES_PATH"
sleep 10
if [ ! -d "$PATCHES_PATH" ]; then
# maybe moved somewhere or this code was pasted
@ -109,17 +129,17 @@ version_0_5_enable="false"
if [ -d "$USR_SHARE_MINETEST/games/minetest_game/mods/player_api" ]; then
version_0_5_enable="true"
fi
if [ -f "$CONFIGS_PATH/local_enable" ]; then
local_enable=$(head -n 1 $CONFIGS_PATH/local_enable)
if [ -f "$CONFIG_PATH/local_enable" ]; then
local_enable=$(head -n 1 $CONFIG_PATH/local_enable)
fi
#if [ -f "$CONFIGS_PATH/version_0_5_enable" ]; then
# version_0_5_enable=$(head -n 1 $CONFIGS_PATH/version_0_5_enable)
#if [ -f "$CONFIG_PATH/version_0_5_enable" ]; then
# version_0_5_enable=$(head -n 1 $CONFIG_PATH/version_0_5_enable)
#fi
if [ -z "$local_enable" ]; then
echo "$local_enable" > "$CONFIGS_PATH/local_enable"
echo "$local_enable" > "$CONFIG_PATH/local_enable"
fi
#if [ -z "$version_0_5_enable" ]; then
# echo "$version_0_5_enable" > "$CONFIGS_PATH/version_0_5_enable"
# echo "$version_0_5_enable" > "$CONFIG_PATH/version_0_5_enable"
#fi
mtgame_name="minetest_game"
@ -136,6 +156,7 @@ MT_BACKUP_GAMES_DIR=$HOME/Backup$USR_SHARE_MINETEST/games
MT_GAMES_DIR=$USR_SHARE_MINETEST/games
MT_MYGAME_BAK=$USR_SHARE_MINETEST/ENLIVEN_BAK
MT_MYGAME_NAME=ENLIVEN
#$PREFIX/minetest/games/ENLIVEN:
MT_MYGAME_DIR="$MT_GAMES_DIR/$MT_MYGAME_NAME"
# formerly MT_MYGAME_MODDIR:
MT_MYGAME_MODS_PATH="$MT_MYGAME_DIR/mods"
@ -143,11 +164,18 @@ MT_WORLDS_DIR="$HOME/.minetest/worlds"
MT_DEFAULT_WORLD_NAME="`ls $MT_WORLDS_DIR | grep -v tar.gz | grep --max-count=1 -v world`" # aka -m 1 (no '=' sign in that case)
MT_MYWORLD_NAME="$MT_DEFAULT_WORLD_NAME"
if [ -z "$MT_DEFAULT_WORLD_NAME" ]; then
if [ ! -z "`ls $MT_WORLDS_DIR | grep --max-count=1 -v world`" ]; then
MT_MYWORLD_NAME=world
echo "Could not find any worlds other than $MT_MYWORLD_NAME"
#if [ -z "`ls $MT_WORLDS_DIR | grep --max-count=1 -v world`" ]; then
new_worlds="`ls $MT_WORLDS_DIR | grep --max-count=1 -v '^world$'`"
if [ ! -z "$new_worlds" ]; then
# anchors (`^` and `$`) ensure only exact match, so name containing world is not counted as a match
# see also <https://stackoverflow.com/questions/4709912/how-to-make-grep-only-match-if-the-entire-line-matches>
MT_MYWORLD_NAME="$new_worlds"
else
echo "Could not find any worlds"
if [ -d "$MT_WORLDS_DIR/world" ]; then
echo "Could not find any new worlds in $MT_WORLDS_DIR so using '$MT_MYWORLD_NAME'"
else
echo "Could not find any worlds in $MT_WORLDS_DIR"
fi
fi
#if [ "$0" = "-bash" ]; then
#'[[' doesn't work in debian:
@ -165,7 +193,7 @@ if [ -z "$MT_DEFAULT_WORLD_NAME" ]; then
echo " 1..."
sleep 1
else
read -p "Please enter a world (name only--must be in $MT_WORLDS_DIR): " MT_MYWORLD_NAME
read -e -p "Please enter a world (name only--must be in $MT_WORLDS_DIR): " -i "$MT_MYWORLD_NAME" MT_MYWORLD_NAME
#$MT_DEFAULT_WORLD_NAME
echo using "$MT_MYWORLD_NAME"
#echo " 3..."
@ -257,106 +285,153 @@ reinstall_mt_game() {
add_zip_mod()
{
cd $HOME/Downloads
cd $RELEASES_PATH
MTMOD_DEST_NAME=$1
MTMOD_UNZ_NAME=$2
MTMOD_GOT_NAME=$2
URL=$3
MTMOD_SRC_ZIP=$MTMOD_DEST_NAME.zip
MTMOD_DEST_PATH=$MT_MYGAME_MODS_PATH/$MTMOD_DEST_NAME
if [ ! -z "`ls | grep $MTMOD_UNZ_NAME`" ]; then # works with wildcard in variable
rm -Rf $MTMOD_UNZ_NAME
if [ ! -z "`ls | grep $MTMOD_GOT_NAME`" ]; then # works with wildcard in variable
rm -Rf $MTMOD_GOT_NAME
fi
if [ -f $MTMOD_SRC_ZIP ]; then
rm -f $MTMOD_SRC_ZIP
fi
if [ -d "$MTMOD_DEST_PATH" ]; then
sudo rm -Rf "$MTMOD_DEST_PATH"
fi
wget -O $MTMOD_SRC_ZIP $URL
unzip -q "$MTMOD_SRC_ZIP"
#-q: quiet
if [ -d "$MTMOD_UNZ_NAME" ]; then
# outer case is for safety in case variable is blank or something
if [ -d "$MTMOD_UNZ_NAME/.git" ]; then
rm -Rf "$MTMOD_UNZ_NAME/.git"
fi
if [ -f "$MTMOD_UNZ_NAME/.gitignore" ]; then
rm -Rf "$MTMOD_UNZ_NAME/.gitignore"
fi
# remove etc to make users downloading mods faster:
if [ -d "$MTMOD_UNZ_NAME/etc" ]; then
rm -Rf "$MTMOD_UNZ_NAME/etc"
fi
if [ -f "$MTMOD_UNZ_NAME/screenshot.png" ]; then
rm -f "$MTMOD_UNZ_NAME/screenshot.png"
add_mod_from_here $MTMOD_DEST_NAME $MTMOD_GOT_NAME
}
add_git_mod()
{
cd $GIT_REPOS_PATH
MTMOD_DEST_NAME=$1
MTMOD_GOT_NAME=$2
URL=$3
BRANCH=$4
if [ ! -z "$BRANCH" ]; then
cd $GIT_BRANCHES_PATH
if [ ! -d "$BRANCH" ]; then
mkdir "$BRANCH"
fi
sudo mv $MTMOD_UNZ_NAME "$MTMOD_DEST_PATH"
cd "$BRANCH"
fi
if [ ! -d "$MTMOD_DEST_PATH" ]; then
echo " ERROR: failed to unzip $MTMOD_DEST_PATH, so cannot continue." > $err_txt
cat $err_txt
echo " press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
echo " 3..."
sleep 1
echo " 2..."
sleep 1
echo " 1..."
sleep 1
exit 1
if [ ! -d "$MTMOD_GOT_NAME" ]; then
if [ ! -z "$BRANCH" ]; then
echo "BRANCH: Cloning $BRANCH branch..."
echo "git clone -b $BRANCH --single-branch $URL"
git clone -b $BRANCH --single-branch $URL
else
#echo "Cloning main branch since no branch specified: $BRANCH"
echo "git clone $URL"
git clone $URL
fi
else
echo " added as $MTMOD_DEST_PATH"
cd $MTMOD_GOT_NAME
git pull
cd ..
fi
cd
#if [ -d GitHub/EnlivenMinetest ]; then
# cd GitHub/EnlivenMinetest
#fi
add_mod_from_here $MTMOD_DEST_NAME $MTMOD_GOT_NAME
}
add_git_mod()
add_mod_from_here()
{
cd $HOME/Downloads
MTMOD_DEST_NAME=$1
MTMOD_UNZ_NAME=$2
URL=$3
BRANCH=$4
MTMOD_GOT_NAME=$2
if [ ! -f "$MOD_LIST" ]; then touch "$MOD_LIST"; fi
echo "$MTMOD_DEST_NAME" >> "$MOD_LIST"
MTMOD_DEST_PATH=$MT_MYGAME_MODS_PATH/$MTMOD_DEST_NAME
if [ -z "$MTMOD_DEST_NAME" ]; then
echo "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_DEST_NAME' (1st param)--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
fi
if [ -z "$MTMOD_GOT_NAME" ]; then
echo "ERROR: nothing done since add_mod_from_here FAILED to receive 'MTMOD_GOT_NAME' which is the exact downloaded or unzipped folder name (2nd param)--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
fi
if [ ! -d "$MTMOD_DEST_PATH" ] || [ "$update_enable" = "true" ]; then
if [ ! -z "`ls | grep $MTMOD_UNZ_NAME`" ]; then # works with wildcard in variable
rm -Rf $MTMOD_UNZ_NAME
if [ ! -d "$MTMOD_GOT_NAME" ]; then
echo "ERROR: nothing done since add_mod_from_here FAILED to find '$MTMOD_GOT_NAME'--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
fi
if [ -d "$MTMOD_DEST_PATH" ]; then
echo "removing old $MTMOD_DEST_PATH"
sudo rm -Rf "$MTMOD_DEST_PATH"
fi
if [ ! -z "$BRANCH" ]; then
echo "BRANCH: Cloning $BRANCH branch..."
echo "git clone -b $BRANCH --single-branch $URL"
git clone -b $BRANCH --single-branch $URL
else
#echo "Cloning main branch since no branch specified: $BRANCH"
echo "git clone $URL"
git clone $URL
if [ ! -f "`command -v rsync`" ]; then
echo "removing old $MTMOD_DEST_PATH"
sudo rm -Rf "$MTMOD_DEST_PATH"
if [ -d "$MTMOD_DEST_PATH" ]; then
echo "FAILED to remove '$MTMOD_DEST_PATH'--this session will exit unless you press Ctrl-C to cancel script..."
sleep 1
echo "4..."
sleep 1
echo "3..."
sleep 1
echo "2..."
sleep 1
echo "1..."
sleep 1
exit 1
fi
fi
fi
if [ -d "$MTMOD_UNZ_NAME" ]; then
if [ -d "$MTMOD_GOT_NAME" ]; then
# outer case is for safety in case variable is blank or something
if [ -d "$MTMOD_UNZ_NAME/.git" ]; then
rm -Rf "$MTMOD_UNZ_NAME/.git"
if [ ! -f "`command -v rsync`" ]; then
sudo cp -R $MTMOD_GOT_NAME "$MTMOD_DEST_PATH"
if [ "$show_changes" != "false" ]; then
echo "$MTMOD_DEST_PATH"
fi
else
if [ ! -d "$MTMOD_DEST_PATH" ]; then
sudo mkdir -p "$MTMOD_DEST_PATH"
fi
if [ "$show_changes" != "false" ]; then
#sudo rsync -rtv "$MTMOD_GOT_NAME/" "$MTMOD_DEST_PATH"
sudo rsync -zvc "$MTMOD_GOT_NAME/" "$MTMOD_DEST_PATH" --dry-run | grep -v '\.git' | grep -v '\./' | grep -v 'screenshot\.png' | grep -v received | grep -v 'DRY RUN'
fi
sudo rsync -rt "$MTMOD_GOT_NAME/" "$MTMOD_DEST_PATH"
fi
if [ -d "$MTMOD_DEST_PATH/.git" ]; then
sudo rm -Rf "$MTMOD_DEST_PATH/.git"
fi
if [ -f "$MTMOD_UNZ_NAME/.gitignore" ]; then
rm -Rf "$MTMOD_UNZ_NAME/.gitignore"
if [ -f "$MTMOD_DEST_PATH/.gitignore" ]; then
sudo rm -Rf "$MTMOD_DEST_PATH/.gitignore"
fi
# remove etc to make users downloading mods faster:
if [ -d "$MTMOD_UNZ_NAME/etc" ]; then
rm -Rf "$MTMOD_UNZ_NAME/etc"
if [ -d "$MTMOD_DEST_PATH/etc" ]; then
sudo rm -Rf "$MTMOD_DEST_PATH/etc"
fi
if [ -f "$MTMOD_UNZ_NAME/screenshot.png" ]; then
rm -f "$MTMOD_UNZ_NAME/screenshot.png"
if [ -f "$MTMOD_DEST_PATH/screenshot.png" ]; then
sudo rm -f "$MTMOD_DEST_PATH/screenshot.png"
fi
sudo mv $MTMOD_UNZ_NAME "$MTMOD_DEST_PATH"
fi
if [ ! -d "$MTMOD_DEST_PATH" ]; then
echo " ERROR: failed to unzip $MTMOD_DEST_PATH, so cannot continue." > $err_txt
echo " ERROR: failed to get $MTMOD_DEST_PATH, so cannot continue." > $err_txt
cat $err_txt
echo " press Ctrl C to cancel ENLIVEN install or this terminal will close..."
sleep 1
@ -412,7 +487,7 @@ remove_mod()
#echo "MT_MYGAME_MODS_PATH: $MT_MYGAME_MODS_PATH"
echo
echo
echo "To preconfigure, write true or false to files in $CONFIGS_PATH named:"
echo "To preconfigure, write true or false to files in $CONFIG_PATH named:"
echo " local_enable"
#echo " version_0_5_enable"
echo
@ -432,3 +507,8 @@ echo " MT_MYGAME_DIR: $MT_MYGAME_DIR"
echo " MT_WORLDS_DIR: $MT_WORLDS_DIR"
echo " MT_MYWORLD_NAME: $MT_MYWORLD_NAME"
echo " MT_MINETEST_GAME_PATH: $MT_MINETEST_GAME_PATH"
if [ ! -f "`command -v rsync`" ]; then
echo
echo "The 'rsync' command was not found. Installing rsync will reduce writes to drive if you run install methods (as all use add_mod_from_here) more than once for the same mod."
echo
fi

0
patches/mods-integration/debug (various warnings on each startup, Mar 8, 2017).txt → patches/mods-integration - debug (various warnings on each startup, Mar 8, 2017).txt

1
patches/mods-multiplayer/bones_log/init.lua

@ -1 +0,0 @@
Loading…
Cancel
Save