[U-Boot] [PATCH v2 0/1] Fix patman Series-notes handling for buildman

Creating a branch with a Series-notes and running buildman on that branch results in a buildman error of the form "TypeError: cannot concatenate 'str' and 'list' objects". This "series" fixes that by initializing series.notes as an array, not a scalar. This is a single and short patch which would not normally require a Cover-letter (which you are reading now) and Series-notes (which you'll read soon), but I thought it quite elegant to test this patch with itself. And anyway I could not resist.
This patch was tested by actually including a Series-notes (you are reading it now) and therefore a Cover-letter (you have read it already) in the local commit containing this patch, running buildman on it to check that it does not break any more, then running patman on it to both test that patman does not break as it would have with v1 of the patch, and actually submit the patch.
Changes in v2: - fix typo in commit message ("rathen" -> "rather") - actually limit array initialization to series.notes
Albert ARIBAUD (1): patman: fix series-notes handling for buildman
tools/patman/series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)

A patman series with a 'Series-notes' section causes buildman to crash with:
self.series.notes += self.section TypeError: cannot concatenate 'str' and 'list' objects
Fix by initializing series.notes as a one-element array rather than a scalar.
Signed-off-by: Albert ARIBAUD albert.u.boot@aribaud.net ---
Changes in v2: - fix typo in commit message ("rathen" -> "rather") - actually limit array initialization to series.notes
tools/patman/series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/patman/series.py b/tools/patman/series.py index 3399f2c..cc6f80b 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -69,7 +69,10 @@ class Series(dict):
# Otherwise just set the value elif name in valid_series: - self[name] = value + if name=="notes": + self[name] = [value] + else: + self[name] = value else: raise ValueError("In %s: line '%s': Unknown 'Series-%s': valid " "options are %s" % (commit.hash, line, name,

On 2 February 2016 at 02:24, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
A patman series with a 'Series-notes' section causes buildman to crash with:
self.series.notes += self.section TypeError: cannot concatenate 'str' and 'list' objects
Fix by initializing series.notes as a one-element array rather than a scalar.
Signed-off-by: Albert ARIBAUD albert.u.boot@aribaud.net
Changes in v2:
- fix typo in commit message ("rathen" -> "rather")
- actually limit array initialization to series.notes
tools/patman/series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Acked-by: Simon Glass sjg@chromium.org Tested-by: Simon Glass sjg@chromium.org
Thanks.

On 23 February 2016 at 22:12, Simon Glass sjg@chromium.org wrote:
On 2 February 2016 at 02:24, Albert ARIBAUD albert.u.boot@aribaud.net wrote:
A patman series with a 'Series-notes' section causes buildman to crash with:
self.series.notes += self.section TypeError: cannot concatenate 'str' and 'list' objects
Fix by initializing series.notes as a one-element array rather than a scalar.
Signed-off-by: Albert ARIBAUD albert.u.boot@aribaud.net
Changes in v2:
- fix typo in commit message ("rathen" -> "rather")
- actually limit array initialization to series.notes
tools/patman/series.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Acked-by: Simon Glass sjg@chromium.org Tested-by: Simon Glass sjg@chromium.org
Thanks.
Applied to u-boot-dm, thanks!
participants (2)
-
Albert ARIBAUD
-
Simon Glass