All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] scripts/yocto-layer: Avoids duplication of "meta-" prefix
@ 2015-12-09 18:04 humberto.ibarra.lopez
  0 siblings, 0 replies; only message in thread
From: humberto.ibarra.lopez @ 2015-12-09 18:04 UTC (permalink / raw)
  To: openembedded-core

From: Humberto Ibarra <humberto.ibarra.lopez@intel.com>

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]

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
---
 scripts/yocto-layer | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/scripts/yocto-layer b/scripts/yocto-layer
index 53d2aab..313d464 100755
--- a/scripts/yocto-layer
+++ b/scripts/yocto-layer
@@ -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)
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-09 18:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-09 18:04 [PATCH v3] scripts/yocto-layer: Avoids duplication of "meta-" prefix humberto.ibarra.lopez

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.