diff options
author | Chris Larson <kergoth@openedhand.com> | 2006-09-15 07:54:58 +0000 |
---|---|---|
committer | Chris Larson <kergoth@openedhand.com> | 2006-09-15 07:54:58 +0000 |
commit | 81971a2766c5ef698681f313968142b53790eef5 (patch) | |
tree | 3ae5b975f16515f733ef378698cf469588d73ab9 /meta/classes/patch.bbclass | |
parent | 508996658c66bb8e758c5978658865906a3c45d5 (diff) | |
download | openembedded-core-81971a2766c5ef698681f313968142b53790eef5.tar.gz openembedded-core-81971a2766c5ef698681f313968142b53790eef5.tar.bz2 openembedded-core-81971a2766c5ef698681f313968142b53790eef5.zip |
patch.bbclass: sync with upstream oe.
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@713 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/patch.bbclass')
-rw-r--r-- | meta/classes/patch.bbclass | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass index 5e40b3dc0d..0989407844 100644 --- a/meta/classes/patch.bbclass +++ b/meta/classes/patch.bbclass @@ -117,24 +117,27 @@ def patch_init(d): """""" PatchSet.Import(self, patch, force) - self.patches.insert(self._current or 0, patch) + if self._current is not None: + i = self._current + 1 + else: + i = 0 + self.patches.insert(i, 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): @@ -144,12 +147,14 @@ def patch_init(d): self._current = self._current + 1 else: self._current = 0 + bb.note("applying patch %s" % i) self._applypatch(i, force) else: if self._current is not None: self._current = self._current + 1 else: self._current = 0 + bb.note("applying patch %s" % self.patches[self._current]) self._applypatch(self.patches[self._current], force) |