remove target support from do_patch, it was added by me and i realize its a design error. Seems no package uses that attribute, and if one exists that package should be corrected not PiSi.

This commit is contained in:
S.Çağlar Onur
2007-02-20 14:15:01 +00:00
parent 34a28e82c8
commit de7005af62
2 changed files with 3 additions and 8 deletions
-3
View File
@@ -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
+3 -5
View File
@@ -469,19 +469,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