]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
oe-setup-layers: make "path" optional
authorYoann Congal <yoann.congal@smile.fr>
Sat, 1 Nov 2025 22:57:44 +0000 (23:57 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 3 Nov 2025 17:39:51 +0000 (17:39 +0000)
Layer names and path are often redundant. Allow users to omit the path
key when it is equal to the layer name by using the layer name as a
default value for its path.

For example, from layers.example.json:
  "sources": {
      "meta-alex": {
          "path": "meta-alex"
      },
      "meta-intel": {
          "path": "meta-intel"
      },
      "poky": {
          "path": "poky"
      }
  },

Update the schema to stop requiring "path" and remove it in example for
"meta-intel".

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/files/layers.example.json
meta/files/layers.schema.json
scripts/oe-setup-layers

index 0a6a6a7b489b0325aba220f92b2fb7659456ccf3..f3b65220831c1ed1247616821d6c5e8dcbd11312 100644 (file)
@@ -24,8 +24,7 @@
                     }
                 },
                 "rev": "0a96edae609a3f48befac36af82cf1eed6786b4a"
-            },
-            "path": "meta-intel"
+            }
         },
         "poky": {
             "git-remote": {
index 659ee8da49823d378758a506cbee3f9809608f33..b5c13fdb5c998122046c4395bbe12c2d505a334f 100644 (file)
@@ -17,9 +17,6 @@
                 "type": "object",
                 "description": "The upstream source from which a set of layers may be fetched",
                 "additionalProperties": false,
-                "required": [
-                    "path"
-                ],
                 "properties": {
                     "path": {
                         "description": "The path where this layer source will be placed when fetching",
index 6fbfefd656f99112237ea9e434cd23ee7e3c3fea..31cb9632515609d409a9e31935c59d8bacfaa5dd 100755 (executable)
@@ -66,7 +66,7 @@ def _do_checkout(args, json):
     oesetupbuild = None
     for r_name in repos:
         r_data = repos[r_name]
-        repodir = os.path.abspath(os.path.join(args['destdir'], r_data['path']))
+        repodir = os.path.abspath(os.path.join(args['destdir'], r_data.get('path', r_name)))
         repodirs.append(repodir)
 
         if 'contains_this_file' in r_data.keys():