primitive patch impl..

This commit is contained in:
A. Murat Eren
2005-06-20 08:52:11 +00:00
parent 449f640897
commit 1553b2ac45
+10
View File
@@ -81,3 +81,13 @@ def run_batch(cmd):
def strlist(l):
"""concatenate string reps of l's elements"""
return string.join(map(lambda x: str(x) + ' ', l))
def do_patch(patch, p=0):
"""simple function to apply patches.."""
check_file(patch)
cmd = "patch -p%d < %s" % (p, patch)
p = os.popen(cmd)
o = p.readlines()
retval = p.close()
if retval:
raise UtilError("ERROR: patch (%s) failed: %s" % (patch, strlist (o)))