diff mbox series

[AUH] PATCH 2/6] upgrade-helper.py: allow to set the git directory from layer-dir

Message ID 20260409090815.1731294-3-daniel.turull@ericsson.com
State New
Headers show
Series [AUH] PATCH 2/6] upgrade-helper.py: allow to set the git directory from layer-dir | expand

Commit Message

Daniel Turull April 9, 2026, 9:08 a.m. UTC
From: Daniel Turull <daniel.turull@ericsson.com>

Replace the assumption that the poky directory is the first PATH entry
and reuse --layer-dir to setup directory for git repo.

This is useful when not using poky and each meta-layer is its own git.
Without this fix, commit_changes fails in non-poky layouts:

  git add .../openembedded-core/meta/recipes-support/gnupg
  fatal: '.../openembedded-core/meta/recipes-support/gnupg'
  is outside repository at '.../yocto-scarthgap'

Assisted-by: Claude, Anthropic
Signed-off-by: Daniel Turull <daniel.turull@ericsson.com>
---
 upgrade-helper.py | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/upgrade-helper.py b/upgrade-helper.py
index 68f315b..67ca54b 100755
--- a/upgrade-helper.py
+++ b/upgrade-helper.py
@@ -184,6 +184,9 @@  class Updater(object):
                     _layer_settings_error(s)
 
             self.git = Git(self.opts['layer_dir'])
+        elif settings.get('layer_dir'):
+            # allow to set the git repo directory without enabling layer_mode
+            self.git = Git(settings.get('layer_dir'))
         else:
             # use scripts_path to get oe-core directory
             self.git = Git(os.path.dirname(scripts_path))