Yatopia/scripts/applyUpstream.sh
budgidiere ff560e687c
[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' 👀

* 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 11:48:42 -05:00

55 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
searchtxts=(Server API)
gpgsign="$(git config commit.gpgsign || echo "false")"
scriptdir=$1/scripts
function enableCommitSigningIfNeeded {
if [[ "$gpgsign" == "true" ]]; then
git config commit.gpgsign true
fi
}
# Disable GPG signing before AM, slows things down and doesn't play nicely.
# There is also zero rational or logical reason to do so for these sub-repo AMs.
# Calm down kids, it's re-enabled (if needed) immediately after, pass or fail.
git config commit.gpgsign false
cd $1/patches/$2
for D in ${searchtxts[@]}; do
echo "IMPORTANT:!!! $D"
if [ true ]; then
echo $D
dnoslash=$D
echo "DnoS: $dnoslash"
echo "$1/Yatopia-$dnoslash"
cd $1/Yatopia-$dnoslash
echo "Appyling $2 $dnoslash files!"
dnoslashlower="${dnoslash,,}"
#git branch $2-upstream
#git checkout $2-upstream
if [ $dnoslashlower != "api" ]; then
echo "$"
echo "Import new introduced NMS files.. test"
$scriptdir/importSources.sh $1 $2 || exit 1
fi
for filename in $1/patches/$2/$dnoslashlower/*.patch; do
# Abort previous applying operation
git am --abort >/dev/null 2>&1
# Apply our patches on top Paper in our dirs
git am --reject --whitespace=fix --no-utf8 --3way --ignore-whitespace $filename || (
#files=`$gitcmd diff --name-only | grep -E '.rej$' `
#if [[ files != null ]]; then
# for filerej in files; do
# echo "Error found .rej file! Deleting. This might have unforseen consqunces!"
# rm -f filerej
# done
#fi
filenamend="${filename##*/}"
filenamens=${filenamend%/*}
filenameedited=${filenamens%.*} # retain the part before the period
filenameedited=${filenameedited:5} # retain the part after the frist slash
git add .
git commit -m $filenameedited
)
done
fi
done
#git am --no-utf8 --3way --ignore-whitespace "$basedir/patches/$patch_folder/"*.patch
enableCommitSigningIfNeeded