diff mbox series

[auh,1/2] commit_changes: handle lack of recipe_dir gracefully

Message ID 20260116064746.3584094-1-alex@linutronix.de
State New
Headers show
Series [auh,1/2] commit_changes: handle lack of recipe_dir gracefully | expand

Commit Message

Alexander Kanavin Jan. 16, 2026, 6:47 a.m. UTC
Recent changes exposed this issue: if recipe_dir is not
set, then the code should not try to access it, and instead
simply skip the recipe, and handle it as a 'nothing to commit'
situation.

recipe_dir may not be set when for some reason reading the
recipe environment has failed.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 upgrade-helper.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/upgrade-helper.py b/upgrade-helper.py
index c1c26c0..2f38e0a 100755
--- a/upgrade-helper.py
+++ b/upgrade-helper.py
@@ -393,7 +393,8 @@  class Updater(object):
 
             I(" %s: Auto commit changes ..." % pns)
             for p in g['pkgs']:
-                self.git.add(p['recipe_dir'])
+                if 'recipe_dir' in p:
+                    self.git.add(p['recipe_dir'])
             self.git.commit(g['commit_msg'], self.opts['author'])
 
             stdout = self.git.create_patch(g['workdir'])