2014-11-25 22:32:16 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -z "$1" ]
|
|
|
|
then
|
2014-11-29 00:06:11 +01:00
|
|
|
echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX"
|
|
|
|
exit
|
2014-11-25 22:32:16 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
for file in $(ls src/main/java/net/minecraft/server)
|
|
|
|
do
|
2014-11-29 00:06:11 +01:00
|
|
|
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
|
2014-11-29 00:02:15 +01:00
|
|
|
patchCut=$(echo "$patchNew" | tail -n +3)
|
|
|
|
patchOld=$(cat "$outName" | tail -n +3)
|
|
|
|
if [ "$patchCut" != "$patchOld" ] ; then
|
|
|
|
echo "$outName changed"
|
|
|
|
echo "$patchNew" > "$outName"
|
|
|
|
fi
|
2014-11-29 00:06:11 +01:00
|
|
|
else
|
|
|
|
echo "New patch $outName"
|
|
|
|
echo "$patchNew" > "$outName"
|
|
|
|
fi
|
|
|
|
done
|