On Thu, 2022-12-29 at 17:01 +0100, Alexander Kanavin wrote:
> devtool modify/upgrade are not currently equipped to handle conditional local 
> files
> in SRC_URI, and provide only the main no-override set in a workspace under
> source/component/oe-local-files/ (this is done via 
> meta/classes/devtool-source.bbclass).
> 
> On the other hand, updating the changes from workspace into a recipe
> is run iteratively against all overrides; this works for patches (as they
> all are directed into their own override branches in the workspace
> git source tree), but breaks down when trying to match local files
> in a workspace against local files in overridden SRC_URI lists, resulting in
> bad recipe breakage.
> 
> Implementing multiple sets of local files is significant work; let's for now
> simply not touch local files in recipes except when on the no-override 
> variant.
> 
> Signed-off-by: Alexander Kanavin <[email protected]>
> ---
>  scripts/lib/devtool/standard.py | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
> index f46ce34ad1..f3349f98e9 100644
> --- a/scripts/lib/devtool/standard.py
> +++ b/scripts/lib/devtool/standard.py
> @@ -1409,6 +1409,18 @@ def _export_local_files(srctree, rd, destdir, 
> srctreebase):
>      updated = OrderedDict()
>      added = OrderedDict()
>      removed = OrderedDict()
> +
> +    # Get current branch and return early with empty lists
> +    # if on one of the override branches
> +    # (local files are provided only for the main branch and processing
> +    # them against lists from recipe overrides will result in mismatches
> +    # and broken modifications to recipes).
> +    stdout, _ = bb.process.run('git rev-parse --abbrev-ref HEAD',
> +                               cwd=srctree)
> +    branchname = stdout.rstrip()
> +    if branchname.startswith(override_branch_prefix):
> +        return (updated, added, removed)
> +
>      local_files_dir = os.path.join(srctreebase, 'oe-local-files')
>      git_files = _git_ls_tree(srctree)
>      if 'oe-local-files' in git_files:

Is there something we should be adding to the devtool tests to cover
this issue?

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#175123): 
https://lists.openembedded.org/g/openembedded-core/message/175123
Mute This Topic: https://lists.openembedded.org/mt/95938801/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to