From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: openembedded-core <openembedded-core@lists.openembedded.org>
Subject: [PATCH] lib/oe/patch.py: Fix patch resolver logic
Date: Thu, 01 Mar 2012 23:41:22 +0000 [thread overview]
Message-ID: <1330645282.15224.0.camel@ted> (raw)
Currently, if PATCHRESOLVE is user and and PatchTree() is being used, you can
get backtraces if patch applcication fails. This is because even in the failure
case, self._current is incremented, meaning second time around, there are array
range issues.
This patch changes the code so _current is only incremented upon successful
patch application, thereby resolving this failure.
[YOCTO #2043 partially]
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 6f7f900..065a8f7 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -134,20 +134,23 @@ class PatchTree(PatchSet):
bb.note("patches is %s" % self.patches)
if all:
for i in self.patches:
+ bb.note("applying patch %s" % i)
+ self._applypatch(i, force)
+
if self._current is not None:
self._current = self._current + 1
else:
self._current = 0
- bb.note("applying patch %s" % i)
- self._applypatch(i, force)
else:
+ bb.note("applying patch %s" % self.patches[self._current or 0])
+ ret = self._applypatch(self.patches[self._current or 0], force)
+
if self._current is not None:
self._current = self._current + 1
else:
self._current = 0
- bb.note("applying patch %s" % self.patches[self._current])
- return self._applypatch(self.patches[self._current], force)
+ return ret
def Pop(self, force = None, all = None):
if all:
next reply other threads:[~2012-03-01 23:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 23:41 Richard Purdie [this message]
2012-03-02 12:20 ` [PATCH] lib/oe/patch.py: Fix patch resolver logic Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330645282.15224.0.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox