This repository has been archived by the owner on May 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upstream has released updates that appear to apply and compile correctly
- Loading branch information
NCT-skyouo
committed
Oct 1, 2022
1 parent
4690bff
commit d17a3f9
Showing
6 changed files
with
124 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
org.gradle.caching=true | ||
org.gradle.parallel=true | ||
org.gradle.vfs.watch=false | ||
org.gradle.parallel.threads=8 | ||
org.gradle.daemon=true | ||
|
||
group=engineer.skyouo.core | ||
version=1.19.2-R0.1-SNAPSHOT | ||
mcVersion=1.19.2 | ||
pufferfishRef=4b26a0baf6c780a22d93f93022617cc43294ac04 | ||
pufferfishRef=58865aa0d59aa6f459d4256f78917e97428a6124 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/usr/bin/env bash | ||
|
||
gitcmd="git -c commit.gpgsign=false" | ||
|
||
noapply=1 | ||
isreject=0 | ||
if [[ $1 == "--noapplied" ]]; then | ||
noapply=1 | ||
shift | ||
fi | ||
|
||
if [ ! -z "$1" ]; then | ||
file="$1" | ||
elif [ -z "$1" ] && [ -f .git/rebase-apply/patch ]; then | ||
file=".git/rebase-apply/patch" | ||
noapply=1 | ||
isreject=1 | ||
else | ||
echo "Please specify a file" | ||
exit 1 | ||
fi | ||
applied=$(echo $file | sed 's/.patch$/-applied\.patch/g') | ||
if [ "$1" == "--reset" ]; then | ||
$gitcmd am --abort | ||
$gitcmd reset --hard | ||
$gitcmd clean -f | ||
exit 0 | ||
fi | ||
|
||
|
||
(test "$isreject" != "1" && $gitcmd am -3 $file) || ( | ||
echo "Failures - Wiggling" | ||
$gitcmd reset --hard | ||
$gitcmd clean -f | ||
errors=$($gitcmd apply --rej $file 2>&1) | ||
echo "$errors" >> ~/patch.log | ||
export missingfiles="" | ||
export summaryfail="" | ||
export summarygood="" | ||
for i in $(find . -name \*.rej); do | ||
base=$(echo "$i" | sed 's/.rej//g') | ||
if [ -f "$i" ]; then | ||
sed -e 's/^diff a\/\(.*\) b\/\(.*\)[[:space:]].*rejected.*$/--- \1\n+++ \2/' -i $i && wiggle -v -l --replace "$base" "$i" | ||
rm "$base.porig" "$i" | ||
else | ||
echo "No such file: $base" | ||
missingfiles="$missingfiles\n$base" | ||
fi | ||
done | ||
for i in $($gitcmd status --porcelain | awk '{print $2}'); do | ||
filedata=$(cat "$i") | ||
if [ -f "$file" ] && [[ "$filedata" == *"<<<<<"* ]]; then | ||
export summaryfail="$summaryfail\nFAILED TO APPLY: $i" | ||
else | ||
$gitcmd add --force "$i" | ||
export summarygood="$summarygood\nAPPLIED CLEAN: $i" | ||
fi | ||
done | ||
echo -e "$summarygood" | ||
echo -e "$summaryfail" | ||
if [[ "$errors" == *"No such file"* ]]; then | ||
echo "==========================="; | ||
echo " " | ||
echo " MISSING FILES" | ||
echo "$errors" | grep "No such file" | ||
echo -e "$missingfiles" | ||
echo " " | ||
echo "==========================="; | ||
fi | ||
$gitcmd status | ||
$gitcmd diff | ||
) | ||
if [[ "$noapply" != "1" ]] && [[ "$file" != *-applied.patch ]]; then | ||
mv "$file" "$applied" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/usr/bin/env bash | ||
|
||
# requires curl & jq | ||
|
||
# upstreamCommit --paper HASH --pufferfish HASH | ||
# flag: --paper HASH - the commit hash to use for comparing commits between paper (PaperMC/Paper/compare/HASH...HEAD) | ||
# flag: --pufferfish HASH - the commit hash to use for comparing commits between pufferfish (pufferfish-gg/Pufferfish/compare/HASH...HEAD) | ||
|
||
function getCommits() { | ||
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/"$1"/compare/"$2"...HEAD | jq -r '.commits[] | "'"$1"'@\(.sha[:7]) \(.commit.message | split("\r\n")[0] | split("\n")[0])"' | ||
} | ||
|
||
( | ||
set -e | ||
PS1="$" | ||
|
||
pufferfishHash="$2" | ||
|
||
pufferfish="" | ||
updated="" | ||
logsuffix="" | ||
|
||
# Pufferfish updates | ||
if [ -n "$pufferfishHash" ]; then | ||
pufferfish=$(getCommits "pufferfish-gg/Pufferfish" "$pufferfishHash") | ||
|
||
# Updates found | ||
if [ -n "$pufferfish" ]; then | ||
updated="Pufferfish" | ||
logsuffix="$logsuffix\n\nPufferfish Changes:\n$pufferfish" | ||
fi | ||
fi | ||
|
||
|
||
disclaimer="Upstream has released updates that appear to apply and compile correctly" | ||
log="Updated Upstream ($updated)\n\n${disclaimer}${logsuffix}" | ||
|
||
echo -e "$log" | git commit -F - | ||
|
||
) || exit 1 |