Browse Source

Separate client & server build caches since content (not just binary) may differ.

master
poikilos 2 years ago
parent
commit
d085dfb889
  1. 52
      utilities/lmk-run

52
utilities/lmk-run

@ -168,56 +168,62 @@ fi
if [ ! -f minetest/bin/$EXE_NAME ]; then if [ ! -f minetest/bin/$EXE_NAME ]; then
if [ -d minetest ]; then if [ -d minetest ]; then
OLD_MODE= OLD_MODE=
OLD_EXE_NAME=
if [ -f minetest/bin/finetestserver ]; then if [ -f minetest/bin/finetestserver ]; then
OLD_MODE=finetest OLD_MODE=finetest
OLD_EXE_NAME=finetestserver
elif [ -f minetest/bin/finetest ]; then elif [ -f minetest/bin/finetest ]; then
OLD_MODE=finetest OLD_MODE=finetest
OLD_EXE_NAME=finetest
elif [ -f minetest/bin/minetestserver ]; then elif [ -f minetest/bin/minetestserver ]; then
OLD_MODE=minetest OLD_MODE=minetest
OLD_EXE_NAME=minetestserver
elif [ -f minetest/bin/minetest ]; then elif [ -f minetest/bin/minetest ]; then
OLD_MODE=minetest OLD_MODE=minetest
OLD_EXE_NAME=minetest
elif [ -f minetest/bin/trolltestserver ]; then elif [ -f minetest/bin/trolltestserver ]; then
OLD_MODE=trolltest OLD_MODE=trolltest
OLD_EXE_NAME=trolltestserver
elif [ -f minetest/bin/trolltest ]; then elif [ -f minetest/bin/trolltest ]; then
OLD_MODE=trolltest OLD_MODE=trolltest
OLD_EXE_NAME=trolltest
else else
>&2 echo "[lmk-run] Error: mode couldn't be detected for the old minetest directory, so it will become minetest-. Its bin dir contains: `ls minetest/bin` one of the following was expected: minetest minetestserver finetest finetestserver trolltest trolltestserver" >&2 echo "[lmk-run] Error: mode couldn't be detected for the old minetest directory, so it will become minetest-. Its bin dir contains: `ls minetest/bin` one of the following was expected: minetest minetestserver finetest finetestserver trolltest trolltestserver"
fi fi
if [ ! -d minetest-$OLD_MODE ]; then if [ ! -d minetest-$OLD_EXE_NAME ]; then
mv minetest minetest-$OLD_MODE mv minetest minetest-$OLD_EXE_NAME
else else
if [ ! -d minetest-$LMK_MODE/games/bucket_game ]; then if [ ! -d minetest-$EXE_NAME/games/bucket_game ]; then
if [ -d minetest/games/bucket_game ]; then if [ -d minetest/games/bucket_game ]; then
mkdir -p minetest-$LMK_MODE/games/ mkdir -p minetest-$EXE_NAME/games/
echo "[lmk-run] mv minetest/games/bucket_game minetest-$LMK_MODE/games/" echo "[lmk-run] mv minetest/games/bucket_game minetest-$EXE_NAME/games/"
mv minetest/games/bucket_game minetest-$LMK_MODE/games/ mv minetest/games/bucket_game minetest-$EXE_NAME/games/
else else
echo "[lmk-run] There is no minetest/games/bucket_game to back up." echo "[lmk-run] There is no minetest/games/bucket_game to back up."
fi fi
else else
echo "[lmk-run] There is already a backup minetest-$LMK_MODE/games/bucket_game" echo "[lmk-run] There is already a backup minetest-$EXE_NAME/games/bucket_game"
fi fi
echo "[lmk-run] removing `pwd`/minetest!" echo "[lmk-run] removing `pwd`/minetest!"
rm -rf minetest rm -rf minetest
fi fi
fi fi
if [ -f minetest-$LMK_MODE/bin/$EXE_NAME ]; then if [ -f minetest-$EXE_NAME/bin/$EXE_NAME ]; then
echo "[lmk-run] reusing minetest-$LMK_MODE..." echo "[lmk-run] reusing minetest-$EXE_NAME..."
mv minetest-$LMK_MODE minetest mv minetest-$EXE_NAME minetest
else else
echo "[lmk-run] there is no file minetest-$LMK_MODE/bin/$EXE_NAME so compiling to minetest/bin..." echo "[lmk-run] there is no file minetest-$EXE_NAME/bin/$EXE_NAME so compiling to minetest/bin..."
$PRE_CMD perl mtcompile-program.pl build --$LMK_MODE $APP_ARG --safe $PRE_CMD perl mtcompile-program.pl build --$LMK_MODE $APP_ARG --safe
if [ -f "minetest-$LMK_MODE/bin/$OTHER_EXE_NAME" ]; then # if [ -f "minetest-$EXE_NAME/bin/$OTHER_EXE_NAME" ]; then
echo "[lmk-run] mv minetest-$LMK_MODE/bin/$OTHER_EXE_NAME minetest/bin/" # echo "[lmk-run] mv minetest-$EXE_NAME/bin/$OTHER_EXE_NAME minetest/bin/"
mv "minetest-$LMK_MODE/bin/$OTHER_EXE_NAME" "minetest/bin/" # mv "minetest-$EXE_NAME/bin/$OTHER_EXE_NAME" "minetest/bin/"
fi # fi
fi fi
if [ ! -d minetest/games/bucket_game ]; then if [ ! -d minetest/games/bucket_game ]; then
if [ -d minetest-$LMK_MODE/games/bucket_game ]; then if [ -d minetest-$EXE_NAME/games/bucket_game ]; then
mkdir -p minetest/games/ mkdir -p minetest/games/
echo "[lmk-run] rsync -rt minetest-$LMK_MODE/games/bucket_game/ minetest/games/bucket_game" echo "[lmk-run] rsync -rt minetest-$EXE_NAME/games/bucket_game/ minetest/games/bucket_game"
rsync -rt minetest-$LMK_MODE/games/bucket_game/ minetest/games/bucket_game rsync -rt minetest-$EXE_NAME/games/bucket_game/ minetest/games/bucket_game
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi
@ -274,11 +280,11 @@ dst_world="$LMK_DIR/minetest/worlds/${world_name}-$EXE_NAME"
echo "[lmk-run] syncing to $dst_world destructively..." echo "[lmk-run] syncing to $dst_world destructively..."
rsync -rt --delete $SRC_WORLD/ $dst_world rsync -rt --delete $SRC_WORLD/ $dst_world
if [ ! -d "$LMK_DIR/minetest/games/bucket_game" ]; then if [ ! -d "$LMK_DIR/minetest/games/bucket_game" ]; then
if [ -d "$LMK_DIR/minetest-$LMK_MODE/games/bucket_game" ]; then if [ -d "$LMK_DIR/minetest-$EXE_NAME/games/bucket_game" ]; then
mkdir -p $LMK_DIR/minetest/games/ mkdir -p $LMK_DIR/minetest/games/
# echo "[lmk-run] rsync -rt $LMK_DIR/minetest-$LMK_MODE/games/bucket_game/ minetest/games/bucket_game" # echo "[lmk-run] rsync -rt $LMK_DIR/minetest-$EXE_NAME/games/bucket_game/ minetest/games/bucket_game"
echo "[lmk-run] mv $LMK_DIR/minetest-$LMK_MODE/games/bucket_game $LMK_DIR/minetest/games/" echo "[lmk-run] mv $LMK_DIR/minetest-$EXE_NAME/games/bucket_game $LMK_DIR/minetest/games/"
mv $LMK_DIR/minetest-$LMK_MODE/games/bucket_game $LMK_DIR/minetest/games/ mv $LMK_DIR/minetest-$EXE_NAME/games/bucket_game $LMK_DIR/minetest/games/
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
exit 1 exit 1
fi fi

Loading…
Cancel
Save