Browse Source

make prepatch.sh use my virtual repo format 4.c.1.

master
poikilos 5 years ago
committed by Jacob Gustafson
parent
commit
f6dadfc954
  1. 76
      prepatch.sh

76
prepatch.sh

@ -50,41 +50,42 @@ if [ "@$enable_bare_param" = "@true" ]; then
branch="$2" branch="$2"
fi fi
project0=Bucket_Game project0=Bucket_Game
project1=basis project1=Bucket_Game-base
project2=patched project2=Bucket_Game-branches
project0_path="$HOME/git/EnlivenMinetest/webapp/linux-minetest-kit/minetest/games/$project0" project0_path="$HOME/git/EnlivenMinetest/webapp/linux-minetest-kit/minetest/games/$project0"
#patches="$HOME/git/EnlivenMinetest/patches" #patches="$HOME/git/EnlivenMinetest/patches"
patches="$HOME/git/1.pull-requests/Bucket_Game-branches" #patches="$HOME/git/1.pull-requests/Bucket_Game-branches"
project1_path="$patches/$branch/$project1" repo="$HOME/git/EnlivenMinetest"
project2_path="$patches/$branch/$project2" patches="$HOME/git/EnlivenMinetest"
project1_path="$repo/$project1/$branch"
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." customDie "You must specify a branch name after --meld."
fi fi
subgame= subgame=
branch_basis= patch_game_src=
if [ -d "$patches/$branch/basis/mods" ]; then if [ -d "$project1_path/mods" ]; then
branch_basis="$patches/$branch/basis" branch_basis="$project1_path"
fi fi
if [ -d "$patches/$branch/mods" ]; then if [ -d "$project2_path/mods" ]; then
patch_game_src="$patches/$branch" patch_game_src="$project2_path"
elif [ -d "$patches/$branch/patched/mods" ]; then
patch_game_src="$patches/$branch/patched"
else else
customDie "Cannot detect mods directory in $patches/$branch" customDie "Cannot detect mods directory in $project2_path/mods"
fi
echo "meld $patch_game_src/ $HOME/minetest/games/ENLIVEN..."
if [ -f "`command -v meld`" ]; then
if [ -f "`command -v nohup`" ]; then
nohup meld "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" &
else
meld "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" &
echo "* install nohup to prevent programs from dumping output to console..."
fi
fi fi
#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..."
#if [ -f "`command -v meld`" ]; then
#if [ -f "`command -v nohup`" ]; then
#nohup meld "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" &
#else
#meld "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" &
#echo "* install nohup to prevent programs from dumping output to console..."
#fi
#fi
if [ ! -z "$branch_basis" ]; then if [ ! -z "$branch_basis" ]; then
echo "meld $branch_basis $patch_game_src/..." echo "meld '$branch_basis' '$patch_game_src'..."
if [ -f "`command -v meld`" ]; then if [ -f "`command -v meld`" ]; then
if [ -f "`command -v nohup`" ]; then if [ -f "`command -v nohup`" ]; then
nohup meld "$branch_basis" "$patch_game_src" & nohup meld "$branch_basis" "$patch_game_src" &
@ -92,9 +93,22 @@ if [ "@$enable_meld" = "@true" ]; then
meld "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" & meld "$patch_game_src/" "$HOME/minetest/games/ENLIVEN" &
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
customDie "You do not have meld installed."
fi
else
echo "meld '$HOME/minetest/games/ENLIVEN' '$patch_game_src'..."
if [ -f "`command -v meld`" ]; then
if [ -f "`command -v nohup`" ]; then
nohup meld "$HOME/minetest/games/ENLIVEN" "$patch_game_src" &
else
meld "$$HOME/minetest/games/ENLIVEN" "$patch_game_src" &
echo "* install nohup to prevent programs from dumping output to console..."
fi
else
customDie "You do not have meld installed."
fi fi
fi fi
echo echo
echo echo
exit 0 exit 0
@ -104,17 +118,17 @@ elif [ "@$enable_install" = "@true" ]; then
fi fi
echo "* installing $branch branch..." echo "* installing $branch branch..."
subgame= subgame=
if [ -d "$patches/$branch/mods" ]; then if [ -d "$project2_path/mods" ]; then
patch_game_src="$patches/$branch" patch_game_src="$project2_path"
elif [ -d "$patches/$branch/patched/mods" ]; then elif [ -d "$project2_path/patched/mods" ]; then
patch_game_src="$patches/$branch/patched" patch_game_src="$project2_path/patched"
else else
customDie "Cannot detect mods directory in $patches/$branch" customDie "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"
#echo "#patches:$patches" # echo "#patches:$patches"
#echo "#branch:$branch" # echo "#branch:$branch"
echo "Done." echo "Done."
echo echo
echo echo

Loading…
Cancel
Save