aboutsummaryrefslogtreecommitdiffstats
path: root/classes/patch.bbclass
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2006-09-05 11:32:08 +0000
committerChris Larson <clarson@kergoth.com>2006-09-05 11:32:08 +0000
commit331ec17a16ea8be41fe2a0e5c4fa272b568f319b (patch)
treea87bb0fe55a44db199b232d2806e748b08a60532 /classes/patch.bbclass
parent203293cfb151dbd7eab7bc797b7b949afa8a3ba1 (diff)
downloadopenembedded-331ec17a16ea8be41fe2a0e5c4fa272b568f319b.tar.gz
patch.bbclass: fix issue encountered by zecke, where PatchTree was only doing a --dry-run, never actually applying the patch. Only quilt-native in oe was using that.
Diffstat (limited to 'classes/patch.bbclass')
-rw-r--r--classes/patch.bbclass21
1 files changed, 10 insertions, 11 deletions
diff --git a/classes/patch.bbclass b/classes/patch.bbclass
index 5e40b3dc0d..f0232adf1e 100644
--- a/classes/patch.bbclass
+++ b/classes/patch.bbclass
@@ -120,21 +120,20 @@ def patch_init(d):
self.patches.insert(self._current or 0, patch)
def _applypatch(self, patch, force = None, reverse = None):
- shellcmd = ["patch", "<", patch['file'], "-p", patch['strippath']]
+ shellcmd = ["cat", patch['file'], "|", "patch", "-p", patch['strippath']]
if reverse:
shellcmd.append('-R')
- shellcmd.append('--dry-run')
- try:
- output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
- except CmdError:
- if force:
- shellcmd.pop(len(shellcmd) - 1)
- output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
- else:
- import sys
- raise sys.exc_value
+ if not force:
+ shellcmd.append('--dry-run')
+
+ output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
+
+ if force:
+ return
+ shellcmd.pop(len(shellcmd) - 1)
+ output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
return output
def Push(self, force = None, all = None):