All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bitbake-blayers/create: add version for example recipe
@ 2018-06-11  1:52 Anuj Mittal
  2018-06-11  1:52 ` [PATCH 2/2] bitbake-blayers/create: add LAYERSERIES_COMPAT Anuj Mittal
  0 siblings, 1 reply; 5+ messages in thread
From: Anuj Mittal @ 2018-06-11  1:52 UTC (permalink / raw)
  To: openembedded-core

Add version field in recipe name for example recipe created by
bitbake-layers.

Fixes [YOCTO #12767]

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/lib/bblayers/create.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/lib/bblayers/create.py b/meta/lib/bblayers/create.py
index 6a41fe0504..c1923166fd 100644
--- a/meta/lib/bblayers/create.py
+++ b/meta/lib/bblayers/create.py
@@ -53,7 +53,7 @@ class CreatePlugin(LayerPlugin):
         example_template = read_template('example.bb')
         example = os.path.join(layerdir, 'recipes-' + args.examplerecipe, args.examplerecipe)
         bb.utils.mkdirhier(example)
-        with open(os.path.join(example, args.examplerecipe + '.bb'), 'w') as fd:
+        with open(os.path.join(example, args.examplerecipe + '_%s.bb') % args.version, 'w') as fd:
             fd.write(example_template)
 
         logger.plain('Add your new layer with \'bitbake-layers add-layer %s\'' % args.layerdir)
@@ -63,4 +63,5 @@ class CreatePlugin(LayerPlugin):
         parser_create_layer.add_argument('layerdir', help='Layer directory to create')
         parser_create_layer.add_argument('--priority', '-p', default=6, help='Layer directory to create')
         parser_create_layer.add_argument('--example-recipe-name', '-e', dest='examplerecipe', default='example', help='Filename of the example recipe')
+        parser_create_layer.add_argument('--example-recipe-version', '-v', dest='version', default='0.1', help='Version number for the example recipe')
 
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] bitbake-blayers/create: add LAYERSERIES_COMPAT
  2018-06-11  1:52 [PATCH 1/2] bitbake-blayers/create: add version for example recipe Anuj Mittal
@ 2018-06-11  1:52 ` Anuj Mittal
  2018-06-11  7:21   ` Richard Purdie
  2018-06-11  8:29   ` [PATCH v2] " Anuj Mittal
  0 siblings, 2 replies; 5+ messages in thread
From: Anuj Mittal @ 2018-06-11  1:52 UTC (permalink / raw)
  To: openembedded-core

Derive the value for template layer.conf from core layer and add
dependendency on it too.

Fixes [YOCTO #12767]

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/lib/bblayers/create.py            | 2 +-
 meta/lib/bblayers/templates/layer.conf | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta/lib/bblayers/create.py b/meta/lib/bblayers/create.py
index c1923166fd..d9699b21f9 100644
--- a/meta/lib/bblayers/create.py
+++ b/meta/lib/bblayers/create.py
@@ -44,7 +44,7 @@ class CreatePlugin(LayerPlugin):
         shutil.copy(license_src, license_dst)
 
         # Create the layer.conf from templates/layer.conf
-        layerconf_template = read_template('layer.conf') % (args.layerdir, args.layerdir, args.layerdir, args.priority)
+        layerconf_template = read_template('layer.conf') % (args.layerdir, args.layerdir, args.layerdir, args.priority, args.layerdir, args.layerdir)
         layerconf = os.path.join(conf, 'layer.conf')
         with open(layerconf, 'w') as fd:
             fd.write(layerconf_template)
diff --git a/meta/lib/bblayers/templates/layer.conf b/meta/lib/bblayers/templates/layer.conf
index 3c0300226c..61b3ad8db3 100644
--- a/meta/lib/bblayers/templates/layer.conf
+++ b/meta/lib/bblayers/templates/layer.conf
@@ -8,3 +8,6 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
 BBFILE_COLLECTIONS += "%s"
 BBFILE_PATTERN_%s = "^${LAYERDIR}/"
 BBFILE_PRIORITY_%s = "%s"
+
+LAYERDEPENDS_%s = "core"
+LAYERSERIES_COMPAT_%s = "${LAYERSERIES_COMPAT_core}"
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] bitbake-blayers/create: add LAYERSERIES_COMPAT
  2018-06-11  1:52 ` [PATCH 2/2] bitbake-blayers/create: add LAYERSERIES_COMPAT Anuj Mittal
@ 2018-06-11  7:21   ` Richard Purdie
  2018-06-11  8:29   ` [PATCH v2] " Anuj Mittal
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Purdie @ 2018-06-11  7:21 UTC (permalink / raw)
  To: Anuj Mittal, openembedded-core

On Mon, 2018-06-11 at 09:52 +0800, Anuj Mittal wrote:
> Derive the value for template layer.conf from core layer and add
> dependendency on it too.
> 
> Fixes [YOCTO #12767]
> 
> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
> ---
>  meta/lib/bblayers/create.py            | 2 +-
>  meta/lib/bblayers/templates/layer.conf | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/lib/bblayers/create.py
> b/meta/lib/bblayers/create.py
> index c1923166fd..d9699b21f9 100644
> --- a/meta/lib/bblayers/create.py
> +++ b/meta/lib/bblayers/create.py
> @@ -44,7 +44,7 @@ class CreatePlugin(LayerPlugin):
>          shutil.copy(license_src, license_dst)
>  
>          # Create the layer.conf from templates/layer.conf
> -        layerconf_template = read_template('layer.conf') %
> (args.layerdir, args.layerdir, args.layerdir, args.priority)
> +        layerconf_template = read_template('layer.conf') %
> (args.layerdir, args.layerdir, args.layerdir, args.priority,
> args.layerdir, args.layerdir)
>          layerconf = os.path.join(conf, 'layer.conf')
>          with open(layerconf, 'w') as fd:
>              fd.write(layerconf_template)
> diff --git a/meta/lib/bblayers/templates/layer.conf
> b/meta/lib/bblayers/templates/layer.conf
> index 3c0300226c..61b3ad8db3 100644
> --- a/meta/lib/bblayers/templates/layer.conf
> +++ b/meta/lib/bblayers/templates/layer.conf
> @@ -8,3 +8,6 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
>  BBFILE_COLLECTIONS += "%s"
>  BBFILE_PATTERN_%s = "^${LAYERDIR}/"
>  BBFILE_PRIORITY_%s = "%s"
> +
> +LAYERDEPENDS_%s = "core"
> +LAYERSERIES_COMPAT_%s = "${LAYERSERIES_COMPAT_core}"

I feel very strongly that we do not want to just copy and paste this
"follow core" value around. The template needs to contain an expanded
value so that when core changes, people need to update their layer to
say what they're compatible with.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2] bitbake-blayers/create: add LAYERSERIES_COMPAT
  2018-06-11  1:52 ` [PATCH 2/2] bitbake-blayers/create: add LAYERSERIES_COMPAT Anuj Mittal
  2018-06-11  7:21   ` Richard Purdie
@ 2018-06-11  8:29   ` Anuj Mittal
  2018-06-11  8:41     ` Peter Kjellerstedt
  1 sibling, 1 reply; 5+ messages in thread
From: Anuj Mittal @ 2018-06-11  8:29 UTC (permalink / raw)
  To: openembedded-core

Derive the value for template layer.conf from core layer and add
dependendency on it too.

Fixes [YOCTO #12767]

Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
 meta/lib/bblayers/create.py            | 5 ++++-
 meta/lib/bblayers/templates/layer.conf | 3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/meta/lib/bblayers/create.py b/meta/lib/bblayers/create.py
index c1923166fd..e06949c92b 100644
--- a/meta/lib/bblayers/create.py
+++ b/meta/lib/bblayers/create.py
@@ -43,8 +43,11 @@ class CreatePlugin(LayerPlugin):
         license_dst = os.path.join(layerdir, copying)
         shutil.copy(license_src, license_dst)
 
+        # Get the compat value for core layer.
+        compat = self.tinfoil.config_data.getVar('LAYERSERIES_COMPAT_core') or ""
+
         # Create the layer.conf from templates/layer.conf
-        layerconf_template = read_template('layer.conf') % (args.layerdir, args.layerdir, args.layerdir, args.priority)
+        layerconf_template = read_template('layer.conf') % (args.layerdir, args.layerdir, args.layerdir, args.priority, args.layerdir, args.layerdir, compat)
         layerconf = os.path.join(conf, 'layer.conf')
         with open(layerconf, 'w') as fd:
             fd.write(layerconf_template)
diff --git a/meta/lib/bblayers/templates/layer.conf b/meta/lib/bblayers/templates/layer.conf
index 3c0300226c..49f95cafc8 100644
--- a/meta/lib/bblayers/templates/layer.conf
+++ b/meta/lib/bblayers/templates/layer.conf
@@ -8,3 +8,6 @@ BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
 BBFILE_COLLECTIONS += "%s"
 BBFILE_PATTERN_%s = "^${LAYERDIR}/"
 BBFILE_PRIORITY_%s = "%s"
+
+LAYERDEPENDS_%s = "core"
+LAYERSERIES_COMPAT_%s = "%s"
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] bitbake-blayers/create: add LAYERSERIES_COMPAT
  2018-06-11  8:29   ` [PATCH v2] " Anuj Mittal
@ 2018-06-11  8:41     ` Peter Kjellerstedt
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Kjellerstedt @ 2018-06-11  8:41 UTC (permalink / raw)
  To: Anuj Mittal, openembedded-core

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org
> [mailto:openembedded-core-bounces@lists.openembedded.org] On Behalf Of
> Anuj Mittal
> Sent: den 11 juni 2018 10:29
> To: openembedded-core@lists.openembedded.org
> Subject: [OE-core] [PATCH v2] bitbake-blayers/create: add LAYERSERIES_COMPAT
                                ^^^^^^^^^^^^^^^
I assume you mean "bitbake-layers"... This goes for the other 
patch in the series as well.

//Peter



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-11  8:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-11  1:52 [PATCH 1/2] bitbake-blayers/create: add version for example recipe Anuj Mittal
2018-06-11  1:52 ` [PATCH 2/2] bitbake-blayers/create: add LAYERSERIES_COMPAT Anuj Mittal
2018-06-11  7:21   ` Richard Purdie
2018-06-11  8:29   ` [PATCH v2] " Anuj Mittal
2018-06-11  8:41     ` Peter Kjellerstedt

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.