* [PATCH] lib/oe/patch.py: Fix patch resolver logic
@ 2012-03-01 23:41 Richard Purdie
2012-03-02 12:20 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Richard Purdie @ 2012-03-01 23:41 UTC (permalink / raw)
To: openembedded-core
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:
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] lib/oe/patch.py: Fix patch resolver logic
2012-03-01 23:41 [PATCH] lib/oe/patch.py: Fix patch resolver logic Richard Purdie
@ 2012-03-02 12:20 ` Richard Purdie
0 siblings, 0 replies; 2+ messages in thread
From: Richard Purdie @ 2012-03-02 12:20 UTC (permalink / raw)
To: Patches and discussions about the oe-core layer
On Thu, 2012-03-01 at 23:41 +0000, Richard Purdie wrote:
> 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>
This patch is wrong, it breaks with multiple patch application. I've
posted an updated patch.
Cheers,
Richard
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-03-02 12:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-01 23:41 [PATCH] lib/oe/patch.py: Fix patch resolver logic Richard Purdie
2012-03-02 12:20 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox