diff --git a/patch.py b/patch.py new file mode 100755 index 0000000..84c3099 --- /dev/null +++ b/patch.py @@ -0,0 +1,19 @@ +#!/bin/python3.6 +import sys + +patch=open(sys.argv[1], "r").readlines() +orig=open(sys.argv[2],"r") +origlines = orig.readlines() + +for idx,oline in enumerate(origlines): + subst = oline.split('=') + for idx1,pline in enumerate(patch): + if subst[0] in pline: + origlines[idx] = pline + patch.pop(idx1) +origlines += patch +orig.close + +new=open(sys.argv[2],"w") +new.writelines(origlines) +new.close