Re: [AUH][PATCH v2 3/9] upgrade-helper.py: allow to set the git directory from layer-dir

Alexander Kanavin <[email protected]>
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <CANNYZj9hfFoUiGQP+AxDFd2Y6g24h3O4aHGLBOAJCJCmCcgwyA@mail.gmail.com>
On Fri, 24 Apr 2026 at 13:46, <[email protected]> wrote:

>              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))

I don't understand. scripts_path is set thusly:

scripts_path = os.path.realpath(os.path.abspath(os.path.dirname(shutil.which("devtool"))))

What is the layer layout that causes the 'wrong' path to be picked by
this? Either you use integrated poky repo without oe-core, or you use
oe-core without integrated poky, but you shouldn't be using both.

Alex

On Fri, 24 Apr 2026 at 13:46, <[email protected]> wrote:
>
> From: Daniel Turull <[email protected]>
>
> 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 <[email protected]>
> ---
>  upgrade-helper.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/upgrade-helper.py b/upgrade-helper.py
> index 98391f3..df927d1 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))
> --
> 2.34.1
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.