summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-12-10 17:57:01 +0100
committerThinkofdeath <thinkofdeath@spigotmc.org>2014-12-10 17:57:01 +0100
commit5d0069f56aa1384bf4aa3bf03c3a35fced1b0696 (patch)
treec9fa41f087e59e556c624240b8b6236a79ba5d3a
parent611ebfa752fa52cb7703d8b56f4f6ef1150af844 (diff)
parent8a8312fb92c488e4323a30cd9ac4268ae862793d (diff)
downloadcraftbukkit-5d0069f56aa1384bf4aa3bf03c3a35fced1b0696.tar
craftbukkit-5d0069f56aa1384bf4aa3bf03c3a35fced1b0696.tar.gz
craftbukkit-5d0069f56aa1384bf4aa3bf03c3a35fced1b0696.tar.lz
craftbukkit-5d0069f56aa1384bf4aa3bf03c3a35fced1b0696.tar.xz
craftbukkit-5d0069f56aa1384bf4aa3bf03c3a35fced1b0696.zip
Merge pull request #26 in SPIGOT/craftbukkit from ~AIKAR/craftbukkit:applyPatches to master
* commit '8a8312fb92c488e4323a30cd9ac4268ae862793d': Improve patch scripts, add applyPatches.sh
-rwxr-xr-xapplyPatches.sh24
-rwxr-xr-xmakePatches.sh8
2 files changed, 29 insertions, 3 deletions
diff --git a/applyPatches.sh b/applyPatches.sh
new file mode 100755
index 00000000..27936e73
--- /dev/null
+++ b/applyPatches.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+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
+fi
+
+nms=$1/net/minecraft/server
+cb=src/main/java/net/minecraft/server
+#clean up and rebuild
+rm -rf $cb
+mkdir -p $cb
+for file in $(/bin/ls nms-patches)
+do
+ patchFile="nms-patches/$file"
+ file="$(echo $file | cut -d. -f1).java"
+
+ echo "Patching $file < $patchFile"
+ sed -i 's/\r//' "$nms/$file"
+
+ cp "$nms/$file" "$cb/$file"
+ patch -d src/main/java/ "net/minecraft/server/$file" < "$patchFile"
+done \ No newline at end of file
diff --git a/makePatches.sh b/makePatches.sh
index 5c0f74f4..0ebca409 100755
--- a/makePatches.sh
+++ b/makePatches.sh
@@ -5,13 +5,15 @@ 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
fi
+cb=src/main/java/net/minecraft/server
+nms="$1/net/minecraft/server"
-for file in $(ls src/main/java/net/minecraft/server)
+for file in $(/bin/ls $cb)
do
echo "Diffing $file"
- dos2unix -q $1/net/minecraft/server/$file $1/net/minecraft/server/$file
+ sed -i 's/\r//' "$nms/$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)
+ patchNew=$(diff -u "$nms/$file" "$cb/$file")
if [ -f "$outName" ]
then
patchCut=$(echo "$patchNew" | tail -n +3)