Yatopia/scripts/updateUpstream.sh

90 lines
3.5 KiB
Bash
Raw Normal View History

2020-07-15 20:49:36 +02:00
#!/usr/bin/env bash
# SCRIPT HEADER start
basedir=$1
source "$basedir/scripts/functions.sh"
echo "----------------------------------------"
echo " $(bashcolor 1 32)Task$(bashcolorend) - Update Upstream"
echo " This will update and patch Paper, importing necessary sources for patching."
#echo " "
#echo " $(bashcolor 1 32)Subtask:$(bashcolorend)"
#echo " - Import Sources"
echo " "
echo " $(bashcolor 1 32)Projects:$(bashcolorend)"
echo " - $(bashcolor 1 32)1$(bashcolorend) : Paper"
[WIP] Better Patch System (#18) * Update build.yml * Remove 3rd party patches * Add Upsteam Submodules * Fix patches * ? * Fix patches * Add Fast Init script * Lots of stuff also it's broke * more broken * fixes * mor stuff * gfhfgh hg * fix patch * fix up script * update submodule * add papercut * update tuinity * update gitmodules * fix var name * fix more var stuff * some how it's not deleting shit anymore * should now use the branch it just made why are we doing this again? * now it does thing thing * return previous so YAPFA can use it * ok now it really does the thing * for REAL it does the thing * don't do the thing because it causes too many problems * fix api * work * use better patching for YAPFA patches * fix better patching * more fixes * new patches stuff * remove old 3rd parry patches add removed akarin patches * make new branch for making patches * hopefully build patches correctly * fix gitignore and add config patches * remove papercut files * fix some weirdness * fix bug * time to do some fixin' :eyes: * New Patch System Rebased Patches * fix full build * exit 1 * fix * Remove patch * Hopefully fix compile errors * fixes * this might work * don't use rej for our patches * tmp disable cache * some times case sensitivity is dumb * my sanity is at an all time low :) * dfg * readd cahce * fix? * Update Upstream * fix perms * fix * fix api * Redo API * rm folders * fix villager brain patch * emc explosion pref * fixed aikar's shit * betterfix * fix lagggg * Origami * Origami Fixes * Update readme * test async path finding * WIP Async Path Finding * WIP fix async path finding * same as bellow * same * update to newer funcs * fix newer funcs * fix author * Updates, Fixes, and new patches * fixes * possibly async flying path finding * minor asnyc pathfinding fix * test remove non asnyc path finder * WIP make all path finding async * Rename everything * Exec flag * Rebuild hashes * remove dupe patch * fix? * Fix packages, redirect config * old nav class is now async and back * add getchatcolor.getbyid and handle patches with a . in them better Co-authored-by: tr7zw <tr7zw@live.de> Co-authored-by: Unknown <unknown@example.com> Co-authored-by: Ovydux <68059159+Ovydux@users.noreply.github.com>
2020-08-03 18:48:42 +02:00
echo " - $(bashcolor 1 32)2$(bashcolorend) : Yatopia"
2020-07-15 20:49:36 +02:00
echo "----------------------------------------"
# SCRIPT HEADER end
# This script are capable of patching paper which have the same effect with renewing the source codes of paper to its corresponding remote/official state, and also are able to reset the patches of paper to its head commit to override dirty changes which needs a argument with --resetPaper.
[WIP] Better Patch System (#18) * Update build.yml * Remove 3rd party patches * Add Upsteam Submodules * Fix patches * ? * Fix patches * Add Fast Init script * Lots of stuff also it's broke * more broken * fixes * mor stuff * gfhfgh hg * fix patch * fix up script * update submodule * add papercut * update tuinity * update gitmodules * fix var name * fix more var stuff * some how it's not deleting shit anymore * should now use the branch it just made why are we doing this again? * now it does thing thing * return previous so YAPFA can use it * ok now it really does the thing * for REAL it does the thing * don't do the thing because it causes too many problems * fix api * work * use better patching for YAPFA patches * fix better patching * more fixes * new patches stuff * remove old 3rd parry patches add removed akarin patches * make new branch for making patches * hopefully build patches correctly * fix gitignore and add config patches * remove papercut files * fix some weirdness * fix bug * time to do some fixin' :eyes: * New Patch System Rebased Patches * fix full build * exit 1 * fix * Remove patch * Hopefully fix compile errors * fixes * this might work * don't use rej for our patches * tmp disable cache * some times case sensitivity is dumb * my sanity is at an all time low :) * dfg * readd cahce * fix? * Update Upstream * fix perms * fix * fix api * Redo API * rm folders * fix villager brain patch * emc explosion pref * fixed aikar's shit * betterfix * fix lagggg * Origami * Origami Fixes * Update readme * test async path finding * WIP Async Path Finding * WIP fix async path finding * same as bellow * same * update to newer funcs * fix newer funcs * fix author * Updates, Fixes, and new patches * fixes * possibly async flying path finding * minor asnyc pathfinding fix * test remove non asnyc path finder * WIP make all path finding async * Rename everything * Exec flag * Rebuild hashes * remove dupe patch * fix? * Fix packages, redirect config * old nav class is now async and back * add getchatcolor.getbyid and handle patches with a . in them better Co-authored-by: tr7zw <tr7zw@live.de> Co-authored-by: Unknown <unknown@example.com> Co-authored-by: Ovydux <68059159+Ovydux@users.noreply.github.com>
2020-08-03 18:48:42 +02:00
# After the patching, it will copying sources that do no exist in the Yatopia workspace but referenced in Yatopia patches into our workspace, depending on the content of our patches, this will be addressed by calling importSources.sh.
2020-07-15 20:49:36 +02:00
# Following by invoking generateImports.sh, it will generate new added/imported files of paper compared to the original decompiled sources into mc-dev folder under the root dir of the project, whose intention is unclear yet.
# exit immediately if a command exits with a non-zero status
set -e
subtasks=1
updatepaper=$2
[WIP] Better Patch System (#18) * Update build.yml * Remove 3rd party patches * Add Upsteam Submodules * Fix patches * ? * Fix patches * Add Fast Init script * Lots of stuff also it's broke * more broken * fixes * mor stuff * gfhfgh hg * fix patch * fix up script * update submodule * add papercut * update tuinity * update gitmodules * fix var name * fix more var stuff * some how it's not deleting shit anymore * should now use the branch it just made why are we doing this again? * now it does thing thing * return previous so YAPFA can use it * ok now it really does the thing * for REAL it does the thing * don't do the thing because it causes too many problems * fix api * work * use better patching for YAPFA patches * fix better patching * more fixes * new patches stuff * remove old 3rd parry patches add removed akarin patches * make new branch for making patches * hopefully build patches correctly * fix gitignore and add config patches * remove papercut files * fix some weirdness * fix bug * time to do some fixin' :eyes: * New Patch System Rebased Patches * fix full build * exit 1 * fix * Remove patch * Hopefully fix compile errors * fixes * this might work * don't use rej for our patches * tmp disable cache * some times case sensitivity is dumb * my sanity is at an all time low :) * dfg * readd cahce * fix? * Update Upstream * fix perms * fix * fix api * Redo API * rm folders * fix villager brain patch * emc explosion pref * fixed aikar's shit * betterfix * fix lagggg * Origami * Origami Fixes * Update readme * test async path finding * WIP Async Path Finding * WIP fix async path finding * same as bellow * same * update to newer funcs * fix newer funcs * fix author * Updates, Fixes, and new patches * fixes * possibly async flying path finding * minor asnyc pathfinding fix * test remove non asnyc path finder * WIP make all path finding async * Rename everything * Exec flag * Rebuild hashes * remove dupe patch * fix? * Fix packages, redirect config * old nav class is now async and back * add getchatcolor.getbyid and handle patches with a . in them better Co-authored-by: tr7zw <tr7zw@live.de> Co-authored-by: Unknown <unknown@example.com> Co-authored-by: Ovydux <68059159+Ovydux@users.noreply.github.com>
2020-08-03 18:48:42 +02:00
#if [ "$updatepaper" == "1" ]; then
#echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Update Git submodules.."
#$gitcmd submodule update --init --remote
#fi
#if [[ "$2" == "--resetPaper" ]]; then
#echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Reset Paper submodule.."
#paperdir
#$gitcmd fetch && $gitcmd reset --hard origin/master
#basedir
#$gitcmd add Paper
#fi
$basedir/scripts/fetchUpstream.sh $basedir
2020-07-15 20:49:36 +02:00
# patch paper
echo " $(bashcolor 1 32)(0/$subtasks)$(bashcolorend) - Apply patches of Tuinity.."
echo " "
paperVer=$(gethead Tuinity)
paperdir
./tuinity patch
#cd "Paper-Server"
#mcVer=$($mvncmd -o org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=minecraft_version | sed -n -e '/^\[.*\]/ !{ /^[0-9]/ { p; q } }')
#echo " $(bashcolor 1 32)(1/$subtasks)$(bashcolorend) - Import necessary sources.."
#basedir
#"$basedir"/scripts/importSources.sh $1
#minecraftversion=$(cat "$basedir"/Paper/work/BuildData/info.json | grep minecraftVersion | cut -d '"' -f 4)
#version=$(echo -e "Paper: $paperVer\nmc-dev:$importedmcdev")
#tag="${minecraftversion}-${mcVer}-$(echo -e $version | shasum | awk '{print $2}')"
#echo "$tag" > "$basedir"/current-paper
# "$basedir"/scripts/generateImports.sh $1 # unused
#echo " $(bashcolor 1 32)(1/$subtasks)$(bashcolorend) - Tagging Paper submodules.."
#function tag {
# paperdir && cd $1
# if [ "$3" == "1" ]; then
# git tag -d "$tag" 2>/dev/null
# fi
# echo -e "$(date)\n\n$version" | git tag -a "$tag" -F - 2>/dev/null
#}
#echo -e "$version"
#forcetag=0
#if [ "$(cat "$basedir"/current-paper)" != "$tag" ]; then
# forcetag=1
#fi
#tag Paper-API $forcetag
#tag Paper-Server $forcetag
[WIP] Better Patch System (#18) * Update build.yml * Remove 3rd party patches * Add Upsteam Submodules * Fix patches * ? * Fix patches * Add Fast Init script * Lots of stuff also it's broke * more broken * fixes * mor stuff * gfhfgh hg * fix patch * fix up script * update submodule * add papercut * update tuinity * update gitmodules * fix var name * fix more var stuff * some how it's not deleting shit anymore * should now use the branch it just made why are we doing this again? * now it does thing thing * return previous so YAPFA can use it * ok now it really does the thing * for REAL it does the thing * don't do the thing because it causes too many problems * fix api * work * use better patching for YAPFA patches * fix better patching * more fixes * new patches stuff * remove old 3rd parry patches add removed akarin patches * make new branch for making patches * hopefully build patches correctly * fix gitignore and add config patches * remove papercut files * fix some weirdness * fix bug * time to do some fixin' :eyes: * New Patch System Rebased Patches * fix full build * exit 1 * fix * Remove patch * Hopefully fix compile errors * fixes * this might work * don't use rej for our patches * tmp disable cache * some times case sensitivity is dumb * my sanity is at an all time low :) * dfg * readd cahce * fix? * Update Upstream * fix perms * fix * fix api * Redo API * rm folders * fix villager brain patch * emc explosion pref * fixed aikar's shit * betterfix * fix lagggg * Origami * Origami Fixes * Update readme * test async path finding * WIP Async Path Finding * WIP fix async path finding * same as bellow * same * update to newer funcs * fix newer funcs * fix author * Updates, Fixes, and new patches * fixes * possibly async flying path finding * minor asnyc pathfinding fix * test remove non asnyc path finder * WIP make all path finding async * Rename everything * Exec flag * Rebuild hashes * remove dupe patch * fix? * Fix packages, redirect config * old nav class is now async and back * add getchatcolor.getbyid and handle patches with a . in them better Co-authored-by: tr7zw <tr7zw@live.de> Co-authored-by: Unknown <unknown@example.com> Co-authored-by: Ovydux <68059159+Ovydux@users.noreply.github.com>
2020-08-03 18:48:42 +02:00
echo " $(bashcolor 1 32)($subtasks/$subtasks) Succeed$(bashcolorend) - Submodules have been updated, regenerated and imported, run 'Yatopia patch' to test/fix patches, and by 'Yatopia rbp' to rebuild patches that fixed with the updated upstream."
2020-07-15 20:49:36 +02:00
echo " "
# gitpush Paper-API $PAPER_API_REPO $tag
# gitpush Paper-Server $PAPER_SERVER_REPO $tag