summaryrefslogtreecommitdiffstats
path: root/makePatches.sh
diff options
context:
space:
mode:
authorAikar <aikar@aikar.co>2014-12-03 14:19:09 -0500
committerAikar <aikar@aikar.co>2014-12-03 14:46:14 -0500
commit8a8312fb92c488e4323a30cd9ac4268ae862793d (patch)
tree0b47a2378109a2f3b2ffa10f6f80b00ce3a7a8e4 /makePatches.sh
parent4c02ffcaf34bb6b350b1a39ed9bac1e6b3285fe2 (diff)
downloadcraftbukkit-8a8312fb92c488e4323a30cd9ac4268ae862793d.tar
craftbukkit-8a8312fb92c488e4323a30cd9ac4268ae862793d.tar.gz
craftbukkit-8a8312fb92c488e4323a30cd9ac4268ae862793d.tar.lz
craftbukkit-8a8312fb92c488e4323a30cd9ac4268ae862793d.tar.xz
craftbukkit-8a8312fb92c488e4323a30cd9ac4268ae862793d.zip
Improve patch scripts, add applyPatches.sh
When working on CraftBukkit, one may need to update to the latest. Before adding new work, you would need to rebuild your patched files to latest. Currently BuildTools does this for you, but BuildTools does not support segment based actions. So this new script replicates the behavior of rebuilding the patched files using nms-patches. BuildTools can then be updated to simply call this script. Also, improved makePatches by removing dos2unix. This command does not exists on all systems, and can very simply be replaced by sed. Finally, hard coded path to /ls as a user may of aliased ls to default change the format, so call it directly to ensure we get the desired behavior.
Diffstat (limited to 'makePatches.sh')
-rwxr-xr-xmakePatches.sh8
1 files changed, 5 insertions, 3 deletions
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)