diff options
author | GunfighterJ <joseph.jenniges@gmail.com> | 2014-11-28 17:06:11 -0600 |
---|---|---|
committer | GunfighterJ <joseph.jenniges@gmail.com> | 2014-11-28 17:06:11 -0600 |
commit | 443e45e276f4d9fef9f80d4a157db2294fc39456 (patch) | |
tree | 53de07f2449124f10b7e8d2f26e59357032f3a91 | |
parent | 90ac03522ac4bd287100d5923de29c1abbb9fa6b (diff) | |
download | craftbukkit-443e45e276f4d9fef9f80d4a157db2294fc39456.tar craftbukkit-443e45e276f4d9fef9f80d4a157db2294fc39456.tar.gz craftbukkit-443e45e276f4d9fef9f80d4a157db2294fc39456.tar.lz craftbukkit-443e45e276f4d9fef9f80d4a157db2294fc39456.tar.xz craftbukkit-443e45e276f4d9fef9f80d4a157db2294fc39456.zip |
Don't commit unchanged patches
-rwxr-xr-x | makePatches.sh | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/makePatches.sh b/makePatches.sh index 8dd725d6..5c0f74f4 100755 --- a/makePatches.sh +++ b/makePatches.sh @@ -2,20 +2,26 @@ if [ -z "$1" ] then - echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX" - exit + echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX" + exit fi 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 - 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) + echo "Diffing $file" + dos2unix -q $1/net/minecraft/server/$file $1/net/minecraft/server/$file + 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) + if [ -f "$outName" ] + then patchCut=$(echo "$patchNew" | tail -n +3) patchOld=$(cat "$outName" | tail -n +3) if [ "$patchCut" != "$patchOld" ] ; then echo "$outName changed" echo "$patchNew" > "$outName" fi -done + else + echo "New patch $outName" + echo "$patchNew" > "$outName" + fi +done
\ No newline at end of file |