From 1553b2ac4547662f4589f0664fd5598c04aae021 Mon Sep 17 00:00:00 2001 From: "A. Murat Eren" Date: Mon, 20 Jun 2005 08:52:11 +0000 Subject: [PATCH] primitive patch impl.. --- pisi/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pisi/util.py b/pisi/util.py index bedb1ba8..68945415 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -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)))