Browse Source

Make prepatch output more verbose. Try to build MultiCraft 2 with the --2 option. Fix a bash function call.

master
poikilos 2 years ago
parent
commit
b4477aba97
  1. 47
      build-MultiCraft.sh
  2. 2
      build-minetest-here.sh
  3. 6
      prepatch.sh

47
build-MultiCraft.sh

@ -72,6 +72,7 @@ UNINSTALL=false
CLEAN=false CLEAN=false
GET_WHAT=false GET_WHAT=false
USE_WHAT=false USE_WHAT=false
USE_2=false
for var in "$@" for var in "$@"
do do
if [ "@$var" = "@--offline" ]; then if [ "@$var" = "@--offline" ]; then
@ -84,6 +85,8 @@ do
CLEAN=true CLEAN=true
elif [ "@$var" = "@--what" ]; then elif [ "@$var" = "@--what" ]; then
GET_WHAT=true GET_WHAT=true
elif [ "@$var" = "@--2" ]; then
USE_2=true
elif [ "@$GET_WHAT" = "@true" ]; then elif [ "@$GET_WHAT" = "@true" ]; then
if [ -d "$var" ]; then if [ -d "$var" ]; then
BUILD_WHAT="$var" BUILD_WHAT="$var"
@ -101,10 +104,16 @@ if [ "@$USE_WHAT" = "@true" ]; then
fi fi
BUILD_WHAT_DEFAULT=MultiCraft BUILD_WHAT_DEFAULT=MultiCraft
REPO_NAME=MultiCraft
if [ "@$USE_2" = "@true" ]; then
BUILD_WHAT_DEFAULT=MultiCraft2
REPO_NAME=MultiCraft2
fi
# This is NOT a mistake (MultiCraft is the git username)... # This is NOT a mistake (MultiCraft is the git username)...
GIT_REPOS_DIR="$HOME/Downloads/git/MultiCraft" GIT_REPOS_DIR="$HOME/Downloads/git/MultiCraft"
# ...so srcRepo should be MultiCraft/MultiCraft in this case # ...so srcRepo should be MultiCraft/$REPO_NAME in this case
# (unless user ran script from a directory containing their own # (unless user ran script from a directory containing their own
# MultiCraft directory). # MultiCraft directory).
@ -119,10 +128,10 @@ if [ ! -d "$srcRepo" ]; then
fi fi
fi fi
echo "* Using $srcRepo..." echo "* Using $srcRepo..."
if [ ! -d /tmp/MultiCraft ]; then if [ ! -d /tmp/$REPO_NAME ]; then
mkdir /tmp/MultiCraft || customExit echo "mkdir -p '/tmp/MultiCraft' FAILED." mkdir /tmp/$REPO_NAME || customExit echo "mkdir -p '/tmp/$REPO_NAME' FAILED."
fi fi
artifactsPath=/tmp/MultiCraft/src.txt artifactsPath=/tmp/$REPO_NAME/src.txt
cat > $artifactsPath <<END cat > $artifactsPath <<END
.git .git
.clang-format .clang-format
@ -151,15 +160,15 @@ END
srcBin=$srcRepo/bin srcBin=$srcRepo/bin
srcExe=$srcBin/MultiCraft srcExe=$srcBin/MultiCraft
iconCaption=MultiCraft iconCaption=$REPO_NAME
dstShortcuts=$PREFIX/share/applications dstShortcuts=$PREFIX/share/applications
dstShortcut=$dstShortcuts/MultiCraft.desktop dstShortcut=$dstShortcuts/$REPO_NAME.desktop
#dstPrograms="$HOME" #dstPrograms="$HOME"
#DESTINATION="$dstPrograms/MultiCraft" #DESTINATION="$dstPrograms/$REPO_NAME"
DESTINATION="$HOME/MultiCraft" DESTINATION="$HOME/$REPO_NAME"
dstIcon=minetest dstIcon=minetest
#tryIcon="$HOME/minetest/misc/minetest-xorg-icon-128.png" #tryIcon="$HOME/minetest/misc/minetest-xorg-icon-128.png"
tryIcon="$DESTINATION/misc/MultiCraft-xorg-icon-128.png" tryIcon="$DESTINATION/misc/$REPO_NAME-xorg-icon-128.png"
dstBin=$DESTINATION/bin dstBin=$DESTINATION/bin
dstExe=$dstBin/MultiCraft dstExe=$dstBin/MultiCraft
@ -175,10 +184,10 @@ if [ "@$UNINSTALL" = "@true" ]; then
prevDir="`pwd`" prevDir="`pwd`"
echo "Uninstalling $DESTINATION..." echo "Uninstalling $DESTINATION..."
cd "$DESTINATION" || customExit echo "cd $DESTINATION FAILED." cd "$DESTINATION" || customExit echo "cd $DESTINATION FAILED."
if [ ! -d /tmp/MultiCraft ]; then if [ ! -d /tmp/$REPO_NAME ]; then
mkdir /tmp/MultiCraft || customExit echo "mkdir -p '/tmp/MultiCraft' FAILED." mkdir /tmp/$REPO_NAME || customExit echo "mkdir -p '/tmp/MultiCraft' FAILED."
fi fi
manifestPath=/tmp/MultiCraft/manifest.txt manifestPath=/tmp/$REPO_NAME/manifest.txt
cat > $manifestPath <<END cat > $manifestPath <<END
games/default/files/bluestone/mesecons_pistons/textures/mesecons_piston_pusher_front_sticky.png games/default/files/bluestone/mesecons_pistons/textures/mesecons_piston_pusher_front_sticky.png
games/default/files/bluestone/mesecons_pistons/textures/mesecons_piston_pusher_front.png games/default/files/bluestone/mesecons_pistons/textures/mesecons_piston_pusher_front.png
@ -1815,7 +1824,7 @@ if [ "@$INSTALL" = "@true" ]; then
rsync -rt --info=progress2 --exclude-from "$artifactsPath" "$srcRepo/" "$DESTINATION" || customExit "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/$REPO_NAME
if [ -f "$tryIcon" ]; then if [ -f "$tryIcon" ]; then
dstIcon="$tryIcon" dstIcon="$tryIcon"
@ -1884,18 +1893,20 @@ fi
if [ ! -d "$srcRepo" ]; then if [ ! -d "$srcRepo" ]; then
cd "$GIT_REPOS_DIR" || customExit "cd '$GIT_REPOS_DIR' FAILED" cd "$GIT_REPOS_DIR" || customExit "cd '$GIT_REPOS_DIR' FAILED"
fi fi
goodFlagFile=MultiCraft/CMakeLists.txt goodFlagFile=$REPO_NAME/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 || customExit "Cannot clone MultiCraft from `pwd`" git clone https://github.com/MultiCraft/$REPO_NAME.git || customExit "Cannot clone $REPO_NAME from `pwd`"
fi fi
cd "$BUILD_WHAT" || customExit "Cannot cd '$BUILD_WHAT' from `pwd`" cd "$BUILD_WHAT" || customExit "Cannot cd '$BUILD_WHAT' from `pwd`"
else else
cd "$BUILD_WHAT" || customExit "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`" echo "* origin of `pwd`:"
git remote show origin
git pull --verbose --ff-only || dieIfOnline "WARNING: Cannot pull '$BUILD_WHAT' from `pwd`"
fi fi
fi fi
else else
@ -1922,7 +1933,9 @@ if [ ! -d "default" ]; then
else else
if [ "@$OFFLINE" = "@false" ]; then if [ "@$OFFLINE" = "@false" ]; then
cd default || customExit "cd default FAILED in `pwd`" cd default || customExit "cd default FAILED in `pwd`"
git pull || customExit "git pull FAILED in `pwd`" echo "* origin of `pwd`:"
git remote show origin
git pull --verbose --ff-only || customExit "git pull FAILED in `pwd`"
cd .. || customExit "cd .. FAILED in `pwd`" cd .. || customExit "cd .. FAILED in `pwd`"
fi fi
fi fi

2
build-minetest-here.sh

@ -118,7 +118,7 @@ echo
echo "RUN_IN_PLACE=$RUN_IN_PLACE" echo "RUN_IN_PLACE=$RUN_IN_PLACE"
if [ "$RUN_IN_PLACE" = "0" ]; then if [ "$RUN_IN_PLACE" = "0" ]; then
echo "^ To change this, press Ctrl+C and use:" echo "^ To change this, press Ctrl+C and use:"
usage() usage
echo echo
echo "3..." echo "3..."
sleep 1 sleep 1

6
prepatch.sh

@ -143,8 +143,8 @@ elif [ "@$enable_install" = "@true" ]; then
else else
customExit "Cannot detect mods directory in $branchHeadPath/mods" customExit "Cannot detect mods directory in $branchHeadPath/mods"
fi fi
echo "rsync -rt $patch_game_src/ $HOME/minetest/games/ENLIVEN..." echo "rsync -rtv $patch_game_src/ $HOME/minetest/games/ENLIVEN..."
rsync -rt "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" rsync -rtv "$patch_game_src/" "$HOME/minetest/games/ENLIVEN"
# echo "#patches:$patches" # echo "#patches:$patches"
# echo "#branch:$branch" # echo "#branch:$branch"
echo "Done." echo "Done."
@ -316,5 +316,5 @@ done
echo "Done." echo "Done."
echo "To apply, set BUCKET_GAME then:" echo "To apply, set BUCKET_GAME then:"
echo "cd EnlivenMinetest && git pull && rsync -rt Bucket_Game-branches/$branch/ \$BUCKET_GAME" echo "cd EnlivenMinetest && git pull && rsync -rtv Bucket_Game-branches/$branch/ \$BUCKET_GAME"
echo echo

Loading…
Cancel
Save