]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
bblayers/makesetup: move check for existence of git remotes to oe-setup-layers plugin
authorAlexander Kanavin <alex@linutronix.de>
Tue, 7 May 2024 11:46:23 +0000 (13:46 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 28 May 2024 08:38:19 +0000 (09:38 +0100)
This helps when making a local copy of all the layers: it's fine to
not have any remotes configured in that case.

Also correct the mistake in accessing 'contains_this_file' property:
it may not necessarily exist, and if so, it should default to False.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/bblayers/makesetup.py
meta/lib/bblayers/setupwriters/oe-setup-layers.py

index 48dc73c288d914ca272e38955b73827081dce8f7..4199b5f06981fa5a1a0178b60b2294798d924e59 100644 (file)
@@ -63,10 +63,6 @@ class MakeSetupPlugin(LayerPlugin):
                         'describe':oe.buildcfg.get_metadata_git_describe(repo_path)}}
                 if repo_path == destdir_repo:
                     repos[repo_path]['contains_this_file'] = True
-                if not repos[repo_path]['git-remote']['remotes'] and not repos[repo_path]['contains_this_file']:
-                    e = "Layer repository in {path} does not have any remotes configured. Please add at least one with 'git remote add'.".format(path=repo_path)
-                    logger.error(e)
-                    raise Exception(e)
 
         top_path = os.path.commonpath([os.path.dirname(r) for r in repos.keys()])
 
index 56c929471e61ffecfa1661cc7796470d22d85cf8..8faeabfabc86de73d3acd074a603cad7f7a67c56 100644 (file)
@@ -86,6 +86,9 @@ class OeSetupLayersWriter():
                 os.makedirs(args.destdir)
             repos = parent.make_repo_config(args.destdir)
             for r in repos.values():
+                if not r['git-remote']['remotes'] and not r.get('contains_this_file', False):
+                    e = "Layer repository in {path} does not have any remotes configured. Please add at least one with 'git remote add'.".format(path=r['originpath'])
+                    raise Exception(e)
                 del r['originpath']
             json = {"version":"1.0","sources":repos}
             if not repos: