Commits
1 1 | |
2 2 | |
3 3 | if [ -z "$1" ] |
4 4 | then |
5 5 | echo "Please run this script again with the clean decompile sources as an argument. In most cases this will be ../work/decompile-XXXX" |
6 6 | exit |
7 7 | fi |
8 8 | cb=src/main/java/net/minecraft/server |
9 9 | nms="$1/net/minecraft/server" |
10 + | show_diff_msg=true |
11 + | |
12 + | if [ $# -ge 2 ] |
13 + | then |
14 + | show_diff_msg=$2 |
15 + | if [ "$show_diff_msg" = false ] |
16 + | then |
17 + | echo "Suppressing normal output. Will only output for changed or created patches." |
18 + | fi |
19 + | fi |
10 20 | |
11 21 | for file in $(/bin/ls $cb) |
12 22 | do |
13 - | echo "Diffing $file" |
23 + | if [ "$show_diff_msg" = true ] |
24 + | then |
25 + | echo "Diffing $file" |
26 + | fi |
14 27 | sed -i 's/\r//' "$nms/$file" |
15 28 | sed -i 's/\r//' "$cb/$file" |
16 29 | outName=$(echo nms-patches/"$(echo $file | cut -d. -f1)".patch) |
17 30 | patchNew=$(diff -u --label a/net/minecraft/server/$file "$nms/$file" --label b/net/minecraft/server/$file "$cb/$file") |
18 31 | if [ -f "$outName" ] |
19 32 | then |
20 33 | patchCut=$(echo "$patchNew" | tail -n +3) |
21 34 | patchOld=$(cat "$outName" | tail -n +3) |
22 35 | if [ "$patchCut" != "$patchOld" ] ; then |
23 36 | echo "$outName changed" |