]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
scripts/yocto-layer: Avoids duplication of "meta-" prefix
authorHumberto Ibarra <humberto.ibarra.lopez@intel.com>
Wed, 9 Dec 2015 18:04:56 +0000 (12:04 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Jan 2016 13:52:21 +0000 (13:52 +0000)
The yocto-layer script puts and extra "meta-" prefix on the given layer
name even when the prefix is already there. This fix avoids duplicating
the prefix in these situations.

The change was done inside the create subcommand since this is a parsing
specific to the layer creation. Parsing this in the main method of
yocto-layer was not the right way to go.

Before the change:

$ yocto-layer create meta-layer
[...]
New layer created in meta-meta-layer.

After the change:

$ yocto-layer create meta-layer
[...]
New layer created in meta-layer.

[YOCTO #8050]

(From meta-yocto rev: e21c79eb830ed1593e81f2d58815664109a10933)

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/yocto-layer

index 53d2aabd3fe18657e53232696960af5391c45e69..313d464b6e990e33e9981504d93de6a314c8a354 100755 (executable)
@@ -75,7 +75,11 @@ def yocto_layer_create_subcommand(args, usage_str):
     if options.outdir:
         layer_output_dir = options.outdir
     else:
-        layer_output_dir = "meta-" + layer_name
+        prefix="meta-"
+        if not layer_name.startswith(prefix):
+            layer_output_dir="%s%s"%(prefix,layer_name)
+        else:
+            layer_output_dir=layer_name
 
     yocto_layer_create(layer_name, scripts_path, layer_output_dir, options.codedump, options.properties_file, properties)