Skip to contentSkip to conversation

recipetool: Fix list concatenation when using edit

PATCH Alex Kiernan 2 participants 2 messages Jun 12, 2020 – Jun 15, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 12 lines · Alex Kiernan via lists.openembedded.org

If there are multiple appends, ensure we concatenate compatible things:

Traceback (most recent call last):
File "/home/akiernan/poky/scripts/recipetool", line 111, in <module>
ret = main()
File "/home/akiernan/poky/scripts/recipetool", line 100, in main
ret = args.func(args)
File "/home/akiernan/poky/scripts/lib/recipetool/edit.py", line 38, in edit
return scriptutils.run_editor([recipe_path] + appends, logger)
TypeError: can only concatenate list (not "tuple") to list

Quoted 3 lines

---

I should add a test to this too, since what's there is well tested today (apart from edit!)

Quoted 20 lines
 scripts/lib/recipetool/edit.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/lib/recipetool/edit.py +1 -2
index 94bdf7bca4eb..d5b980a1c03e 100644
@@ -34,7 +34,7 @@ def edit(args):
     recipe_path = tinfoil.get_recipe_file(args.target)
     appends = tinfoil.get_file_appends(recipe_path)
 
-    return scriptutils.run_editor([recipe_path] + appends, logger)
+    return scriptutils.run_editor([recipe_path] + list(appends), logger)
 
 
 def register_commands(subparsers):
--

2.17.1

Signature · 1 line
Alex Kiernan
#2 lore raw
Quoted 18 lines · Alex Kiernan

On Fri, Jun 12, 2020 at 2:38 PM Alex Kiernan via lists.openembedded.org <[email protected]

Quoted 1 line
Quoted 14 lines · wrote:

If there are multiple appends, ensure we concatenate compatible things:

Traceback (most recent call last):
File "/home/akiernan/poky/scripts/recipetool", line 111, in
<module>
ret = main()
File "/home/akiernan/poky/scripts/recipetool", line 100, in main
ret = args.func(args)
File "/home/akiernan/poky/scripts/lib/recipetool/edit.py", line
38, in edit
return scriptutils.run_editor([recipe_path] + appends, logger)
TypeError: can only concatenate list (not "tuple") to list

Quoted 6 lines
Quoted 3 lines

---

I should add a test to this too, since what's there is well tested today (apart from edit!)

That would be much appreciated as it does have some of our better test coverage!

Cheers,

Richard