3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

Z plays with scripts and GPG part 2

Dieser Commit ist enthalten in:
Zach Brown 2016-04-13 22:39:54 -05:00
Ursprung 8ccd31ed38
Commit 86722e02bf
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: CC9DA35FC5450B76
2 geänderte Dateien mit 26 neuen und 14 gelöschten Zeilen

Datei anzeigen

@ -4,7 +4,7 @@
PS1="$"
basedir="$(cd "$1" && pwd -P)"
workdir="$basedir/work"
gpgsign=$(git config commit.gpgsign)
gpgsign="$(git config commit.gpgsign || echo "false")"
echo "Rebuilding Forked projects.... "
function applyPatch {
@ -22,13 +22,21 @@ function applyPatch {
git clone "$what" "$target"
fi
cd "$basedir/$target"
# 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
echo "Resetting $target to $what_name..."
git remote rm upstream > /dev/null 2>&1
git remote add upstream "$basedir/$what" >/dev/null 2>&1
git checkout master 2>/dev/null || git checkout -b master
git fetch upstream >/dev/null 2>&1
git reset --hard upstream/upstream
echo " Applying patches to $target..."
git am --abort >/dev/null 2>&1
git am --3way --ignore-whitespace "$basedir/${what_name}-Patches/"*.patch
if [ "$?" != "0" ]; then
@ -43,18 +51,10 @@ function applyPatch {
function enableCommitSigningIfNeeded {
if [[ "$gpgsign" == "true" ]]; then
git config --global commit.gpgsign true
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.
if [[ "$gpgsign" == "true" ]]; then
# Yes, this has to be global
git config --global commit.gpgsign false
fi
# Move into spigot dir
cd "$workdir/Spigot"
basedir=$(pwd)
@ -64,7 +64,7 @@ basedir=$(pwd)
applyPatch ../CraftBukkit Spigot-Server patched
) || (
echo "Failed to apply Spigot Patches"
enableCommitSigningIfNeeded
enableCommitSigningIfNeeded
exit 1
) || exit 1
# Move out of Spigot
@ -73,17 +73,17 @@ cd "$basedir"
echo "Importing MC Dev"
./scripts/importmcdev.sh "$basedir"
./scripts/importmcdev.sh "$basedir" >/dev/null 2>&1
# Apply paper
cd "$basedir"
(
applyPatch "work/Spigot/Spigot-API" Paper-API HEAD &&
applyPatch "work/Spigot/Spigot-Server" Paper-Server HEAD
enableCommitSigningIfNeeded
enableCommitSigningIfNeeded
) || (
echo "Failed to apply Paper Patches"
enableCommitSigningIfNeeded
enableCommitSigningIfNeeded
exit 1
) || exit 1
)

Datei anzeigen

@ -9,12 +9,20 @@ minecraftversion=$(cat "$workdir/BuildData/info.json" | grep minecraftVersion |
decompiledir="$workdir/$minecraftversion"
nms="$decompiledir/net/minecraft/server"
cb="src/main/java/net/minecraft/server"
gpgsign="$(git config commit.gpgsign || echo "false")"
patch=$(which patch 2>/dev/null)
if [ "x$patch" == "x" ]; then
patch="$basedir/hctap.exe"
fi
function enableCommitSigningIfNeeded {
if [[ "$gpgsign" == "true" ]]; then
git config commit.gpgsign true
fi
}
echo "Applying CraftBukkit patches to NMS..."
cd "$workdir/CraftBukkit"
git checkout -B patched HEAD >/dev/null 2>&1
@ -35,6 +43,10 @@ do
done
git add src >/dev/null 2>&1
# We don't need to sign an automated commit
# All it does is make you input your key passphrase mid-patch
git config commit.gpgsign false
git commit -m "CraftBukkit $ $(date)" >/dev/null 2>&1
enableCommitSigningIfNeeded
git checkout -f HEAD^ >/dev/null 2>&1
)