From 85c209005627d3b5a10d79b28dd566a1077b7244 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Fri, 28 Nov 2014 18:26:30 +0000 Subject: [PATCH] Only rebuild patches that are changed By: Thinkofdeath --- paper-server/makePatches.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/paper-server/makePatches.sh b/paper-server/makePatches.sh index 771e39f804..8dd725d630 100755 --- a/paper-server/makePatches.sh +++ b/paper-server/makePatches.sh @@ -6,11 +6,16 @@ then exit fi -rm -f nms-patches/* - for file in $(ls src/main/java/net/minecraft/server) do echo "Diffing $file" dos2unix -q $1/net/minecraft/server/$file $1/net/minecraft/server/$file - diff -u $1/net/minecraft/server/$file src/main/java/net/minecraft/server/$file > nms-patches/"$(echo $file | cut -d. -f1)".patch + outName=$(echo nms-patches/"$(echo $file | cut -d. -f1)".patch) + patchNew=$(diff -u $1/net/minecraft/server/$file src/main/java/net/minecraft/server/$file) + patchCut=$(echo "$patchNew" | tail -n +3) + patchOld=$(cat "$outName" | tail -n +3) + if [ "$patchCut" != "$patchOld" ] ; then + echo "$outName changed" + echo "$patchNew" > "$outName" + fi done