diff --git a/makepatch.class b/makepatch.class new file mode 100644 index 0000000..c8f2768 Binary files /dev/null and b/makepatch.class differ diff --git a/makepatch.java b/makepatch.java new file mode 100644 index 0000000..5da6eff --- /dev/null +++ b/makepatch.java @@ -0,0 +1,53 @@ +import java.util.*; +import java.io.*; +public class makepatch +{ + +public static void main(String[] args) throws Exception +{ + +if(args.length == 1) +{ + +String post = ""; +Scanner in = new Scanner(new File(args[0])); +in.nextLine();in.nextLine(); +post += in.nextLine().replace("eclipse/Clean/src/main/java","../src-base/minecraft")+"\n"; +post += in.nextLine().replace("eclipse/cauldron/src/main/java","../src-work/minecraft")+"\n"; +while(in.hasNextLine()) +{ + + String current = in.nextLine(); + if(current.contains("No newline at end of file")) continue; + + if(current.startsWith("@@")) + { + if(!(current.endsWith("@@") || current.endsWith("@ "))) + { + post += current.substring(0,current.lastIndexOf("@@")+2)+"\n"; + post += current.substring(current.lastIndexOf("@@")+2)+"\n"; + } + else + { + post += current + "\n"; + } + + } + else + { + post += current + "\n"; + } + +} +in.close(); +PrintWriter out = new PrintWriter(new File(args[0])); +out.print(post); +out.close(); + +} +else +System.out.println("1 patch to fix arg required"); + +} + +} diff --git a/makepatch.sh b/makepatch.sh index 6630825..35779e5 100755 --- a/makepatch.sh +++ b/makepatch.sh @@ -14,7 +14,7 @@ then CLEAN=`find eclipse/Clean/src/main/java | grep $FILE` CAULD=`find eclipse/cauldron/src/main/java | grep $FILE` PATCH=`find patches/ | grep -i $FILE` - git diff --no-index $CLEAN $CAULD + git diff --no-index --text -w $CLEAN $CAULD echo "Diff patch of ${redf}$CLEAN${reset} and ${gref}$CAULD${reset} above." elif [ $1 == "make" ] then @@ -23,7 +23,8 @@ then CLEAN=`find eclipse/Clean/src/main/java | grep $FILE` CAULD=`find eclipse/cauldron/src/main/java | grep $FILE` PATCH=`find patches/ | grep -i $FILE` - git diff --no-index $CLEAN $CAULD > $PATCH + git diff --no-index --text -w $CLEAN $CAULD > $PATCH + java makepatch.class $PATCH echo "Diff of ${redf}$CLEAN${reset} and ${gref}$CAULD${reset} written to ${yelf}$PATCH${reset}" else echo "${bluf}CREATING PATCH${reset}" @@ -31,6 +32,7 @@ else CLEAN=`find eclipse/Clean/src/main/java | grep $FILE` CAULD=`find eclipse/cauldron/src/main/java | grep $FILE` PATCH=`find patches/ | grep -i $FILE` - git diff --no-index $CLEAN $CAULD > $PATCH + git diff --no-prefix --no-index --text -w $CLEAN $CAULD > $PATCH + java makepatch.class $PATCH echo "Diff of ${redf}$CLEAN${reset} and ${gref}$CAULD${reset} written to ${yelf}$PATCH${reset}" fi