summaryrefslogtreecommitdiffstats
path: root/makePatches.sh
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-28 18:26:30 +0000
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-11-28 18:26:30 +0000
commit8768831c56147b6a8a054bd13b6d5b2b90e5bfcf (patch)
treeab6a6bd44cc3791eef983088bcd8edf8289bfe7e /makePatches.sh
parent2abdb9a06122372e1951633045dec4061cabc59f (diff)
downloadcraftbukkit-8768831c56147b6a8a054bd13b6d5b2b90e5bfcf.tar
craftbukkit-8768831c56147b6a8a054bd13b6d5b2b90e5bfcf.tar.gz
craftbukkit-8768831c56147b6a8a054bd13b6d5b2b90e5bfcf.tar.lz
craftbukkit-8768831c56147b6a8a054bd13b6d5b2b90e5bfcf.tar.xz
craftbukkit-8768831c56147b6a8a054bd13b6d5b2b90e5bfcf.zip
Only rebuild patches that are changed
Diffstat (limited to 'makePatches.sh')
-rwxr-xr-xmakePatches.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/makePatches.sh b/makePatches.sh
index 771e39f8..8dd725d6 100755
--- a/makePatches.sh
+++ b/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