summaryrefslogtreecommitdiff
path: root/localserver/applicator.py
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-23 23:45:19 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-23 23:45:19 -0300
commitc2ccb14ffff0e45398365e19dfd2874307ddb943 (patch)
tree976eaea586fb8f1ee0ab8cae67c69071aed8b952 /localserver/applicator.py
downloadtools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.gz
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.bz2
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.xz
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.zip
Initial commit
Diffstat (limited to 'localserver/applicator.py')
-rw-r--r--localserver/applicator.py45
1 files changed, 45 insertions, 0 deletions
diff --git a/localserver/applicator.py b/localserver/applicator.py
new file mode 100644
index 0000000..beb99a6
--- /dev/null
+++ b/localserver/applicator.py
@@ -0,0 +1,45 @@
+import subprocess
+
+# Open reapply.patch3
+f=open("reapply.patch3", "r")
+subprocess.call("cd ../../server-code", shell=True)
+
+for line in f:
+ if line[0] == "#" or line[0] == "\r" or line[0] == "\n":
+ continue
+ print "Downloading patch "+line.replace("\n", "")
+ subprocess.call("cd ../../server-code ; wget https://gitlab.com/evol/hercules/commit/"+line.replace("\n", "")+".diff", shell=True)
+ print "Applying patch..."
+ #subprocess.call("cd ../../server-code ; ls", shell=True)
+ subprocess.call("cd ../../server-code ; git apply --ignore-whitespace --reject "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch applied"
+ subprocess.call("cd ../../server-code ; rm "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch deleted (success)"
+
+
+f.close()
+print "Evol porting finished"
+
+
+###############################################
+# Open reapply.patch4 (HerculesWS Upstream)
+f=open("reapply.patch4", "r")
+subprocess.call("cd ../../server-code", shell=True)
+
+for line in f:
+ if line[0] == "#" or line[0] == "\r" or line[0] == "\n":
+ continue
+ print "Downloading patch "+line.replace("\n", "")
+ subprocess.call("cd ../../server-code ; wget https://github.com/HerculesWS/Hercules/commit/"+line.replace("\n", "")+".diff", shell=True)
+ print "Applying patch..."
+ #subprocess.call("cd ../../server-code ; ls", shell=True)
+ subprocess.call("cd ../../server-code ; git apply --ignore-whitespace --exclude=doc/ --exclude=tools/ --exclude=db/ --exclude=npc/ --exclude=conf/ --reject "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch applied"
+ subprocess.call("cd ../../server-code ; rm "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch deleted (success)"
+
+
+f.close()
+print "HercWS porting finished"
+subprocess.call("ls --recursive ../../server-code|grep rej", shell=True)
+