From 48b14265792b3d1afda4c0d181b1a3acb757e6c8 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 26 Mar 2007 08:56:58 +0000 Subject: [PATCH] * remove patch.target (merge with trunk) --- pisi/build.py | 2 +- pisi/specfile.py | 3 --- pisi/util.py | 8 +++----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pisi/build.py b/pisi/build.py index e68a0c9f..1f7efe94 100644 --- a/pisi/build.py +++ b/pisi/build.py @@ -490,7 +490,7 @@ class Builder: targetDir=ctx.config.tmp_dir()) ctx.ui.action(_("* Applying patch: %s") % patch.filename) - util.do_patch(self.srcDir, patchFile, level=patch.level, target=patch.target) + util.do_patch(self.srcDir, patchFile, level=patch.level) def generate_static_package_object(self): ar_files = [] diff --git a/pisi/specfile.py b/pisi/specfile.py index 636d8a34..0fa5d224 100644 --- a/pisi/specfile.py +++ b/pisi/specfile.py @@ -68,7 +68,6 @@ class Patch: s_Filename = [autoxml.String, autoxml.mandatory] a_compressionType = [autoxml.String, autoxml.optional] a_level = [autoxml.Integer, autoxml.optional] - a_target = [autoxml.String, autoxml.optional] #FIXME: what's the cleanest way to give a default value for reading level? #def decode_hook(self, node, errs, where): @@ -81,8 +80,6 @@ class Patch: s += ' (' + self.compressionType + ')' if self.level: s += ' level:' + self.level - if self.target: - s += ' target:' + self.target return s diff --git a/pisi/util.py b/pisi/util.py index ec811b90..27b53668 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -480,19 +480,17 @@ def uncompress(patchFile, compressType="gz", targetDir=None): return filePath -def do_patch(sourceDir, patchFile, level = 0, target = ''): +def do_patch(sourceDir, patchFile, level = 0): """Apply given patch to the sourceDir.""" cwd = os.getcwd() os.chdir(sourceDir) if level == None: level = 0 - if target == None: - target = '' check_file(patchFile) - (ret, out, err) = run_batch("patch -p%d %s < %s" % - (level, target, patchFile)) + (ret, out, err) = run_batch("patch -p%d < %s" % + (level, patchFile)) if ret: if out is None and err is None: # Which means stderr and stdout directed so they are None