All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] Improve how to determine METADATA_REVISION
@ 2016-04-26 19:49 Peter Kjellerstedt
  2016-04-26 19:49 ` [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo Peter Kjellerstedt
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Kjellerstedt @ 2016-04-26 19:49 UTC (permalink / raw)
  To: openembedded-core

We noticed that METADATA_REVISION was always set to '<unknown>' in our
builds. It turned out that this was because the code in
metadata_scm.bbclass that sets it assumed that ${COREBASE} contains a
repository. This may be true when working with Poky, but is not
necessarily true for other setups. E.g., in our setup we clone Poky,
OpenEmbedded and other repositories using the repo tool and then
create symbolic links from the base directory to the parts that we
want. Since ${COREBASE} is defined based on the path to the meta
layer, it should be a better option to use ${COREBASE}/meta when
looking for the SCM meta information.

Since this works as expected for Git but not SVN, I removed the option
to call base_get_metadata_svn_revision() from
base_detect_revision(). I doubt this should affect anyone (partly
based on the comment in base_get_metadata_svn_revision()), but if this
is not acceptable, it should be trivial to change the code so the meta
directory is only used when looking for Git meta information. However,
since it would require the introduction of two functions to wrap the
Git functions, I refrained from this option until requested otherwise.

//Peter

The following changes since commit a9b503b268e94d311f892fa00c5d6bd9ffdb228e:

  license.bbclass: make sure that image manifest dir exists (2016-04-22 16:28:57 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib pkj/metadata_scm
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=pkj/metadata_scm

Peter Kjellerstedt (1):
  metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo

 meta/classes/metadata_scm.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

-- 
2.1.0



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

* [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo
  2016-04-26 19:49 [PATCH 0/1] Improve how to determine METADATA_REVISION Peter Kjellerstedt
@ 2016-04-26 19:49 ` Peter Kjellerstedt
  2016-04-27 20:26   ` Christopher Larson
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Kjellerstedt @ 2016-04-26 19:49 UTC (permalink / raw)
  To: openembedded-core

The functions base_detect_revision() and base_detect_branch() try to
extract SCM meta information from the path returned by
base_get_scmbasepath(), which currently returns ${COREBASE}. However,
making the assumption that ${COREBASE} contains SCM meta information
can be false. It is true for Poky, but not necessarily other
environments. A better option is to look for the SCM meta information
based on the meta layer.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
---
 meta/classes/metadata_scm.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index 0f7f423..2e6fac2 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -4,8 +4,7 @@ METADATA_REVISION ?= "${@base_detect_revision(d)}"
 def base_detect_revision(d):
     path = base_get_scmbasepath(d)
 
-    scms = [base_get_metadata_git_revision, \
-            base_get_metadata_svn_revision]
+    scms = [base_get_metadata_git_revision]
 
     for scm in scms:
         rev = scm(path, d)
@@ -27,7 +26,7 @@ def base_detect_branch(d):
     return "<unknown>"
 
 def base_get_scmbasepath(d):
-    return d.getVar( 'COREBASE', True)
+    return os.path.join(d.getVar('COREBASE', True), 'meta')
 
 def base_get_metadata_monotone_branch(path, d):
     monotone_branch = "<unknown>"
-- 
2.1.0



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

* Re: [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo
  2016-04-26 19:49 ` [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo Peter Kjellerstedt
@ 2016-04-27 20:26   ` Christopher Larson
  2016-04-28 14:34     ` Peter Kjellerstedt
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Larson @ 2016-04-27 20:26 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1482 bytes --]

On Tue, Apr 26, 2016 at 12:49 PM, Peter Kjellerstedt <
peter.kjellerstedt@axis.com> wrote:

> The functions base_detect_revision() and base_detect_branch() try to
> extract SCM meta information from the path returned by
> base_get_scmbasepath(), which currently returns ${COREBASE}. However,
> making the assumption that ${COREBASE} contains SCM meta information
> can be false. It is true for Poky, but not necessarily other
> environments. A better option is to look for the SCM meta information
> based on the meta layer.
>
> Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
> ---
>  meta/classes/metadata_scm.bbclass | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/metadata_scm.bbclass
> b/meta/classes/metadata_scm.bbclass
> index 0f7f423..2e6fac2 100644
> --- a/meta/classes/metadata_scm.bbclass
> +++ b/meta/classes/metadata_scm.bbclass
> @@ -4,8 +4,7 @@ METADATA_REVISION ?= "${@base_detect_revision(d)}"
>  def base_detect_revision(d):
>      path = base_get_scmbasepath(d)
>
> -    scms = [base_get_metadata_git_revision, \
> -            base_get_metadata_svn_revision]
> +    scms = [base_get_metadata_git_revision]
>

Was this change intended? Because it doesn't match up with the commit
message, as far as I can see.
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 1976 bytes --]

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

* Re: [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo
  2016-04-27 20:26   ` Christopher Larson
@ 2016-04-28 14:34     ` Peter Kjellerstedt
  2016-04-28 16:11       ` Christopher Larson
  0 siblings, 1 reply; 6+ messages in thread
From: Peter Kjellerstedt @ 2016-04-28 14:34 UTC (permalink / raw)
  To: Christopher Larson; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1952 bytes --]

Yes, it was intentional. I mentioned this in the cover letter. I can of course add something about it to the commit message as well if you like.

//Peter

From: kergoth@gmail.com [mailto:kergoth@gmail.com] On Behalf Of Christopher Larson
Sent: den 27 april 2016 22:27
To: Peter Kjellerstedt
Cc: Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo



On Tue, Apr 26, 2016 at 12:49 PM, Peter Kjellerstedt <peter.kjellerstedt@axis.com<mailto:peter.kjellerstedt@axis.com>> wrote:
The functions base_detect_revision() and base_detect_branch() try to
extract SCM meta information from the path returned by
base_get_scmbasepath(), which currently returns ${COREBASE}. However,
making the assumption that ${COREBASE} contains SCM meta information
can be false. It is true for Poky, but not necessarily other
environments. A better option is to look for the SCM meta information
based on the meta layer.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com<mailto:peter.kjellerstedt@axis.com>>
---
 meta/classes/metadata_scm.bbclass | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index 0f7f423..2e6fac2 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -4,8 +4,7 @@ METADATA_REVISION ?= "${@base_detect_revision(d)}"
 def base_detect_revision(d):
     path = base_get_scmbasepath(d)

-    scms = [base_get_metadata_git_revision, \
-            base_get_metadata_svn_revision]
+    scms = [base_get_metadata_git_revision]

Was this change intended? Because it doesn't match up with the commit message, as far as I can see.
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 5487 bytes --]

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

* Re: [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo
  2016-04-28 14:34     ` Peter Kjellerstedt
@ 2016-04-28 16:11       ` Christopher Larson
  2016-04-29 17:04         ` Peter Kjellerstedt
  0 siblings, 1 reply; 6+ messages in thread
From: Christopher Larson @ 2016-04-28 16:11 UTC (permalink / raw)
  To: Peter Kjellerstedt; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 974 bytes --]

On Thu, Apr 28, 2016 at 7:34 AM, Peter Kjellerstedt <
peter.kjellerstedt@axis.com> wrote:

> Yes, it was intentional. I mentioned this in the cover letter. I can of
> course add something about it to the commit message as well if you like.
>

That's what a commit message is for, yes, to describe why something is
being changed. The cover letter isn't going to end up in the git history.
If it hasn't yet been merged, I think it'd be nice to get it improved, so
someone looking at the logs later understands the intention. Thanks.


>
> -    scms = [base_get_metadata_git_revision, \
> -            base_get_metadata_svn_revision]
> +    scms = [base_get_metadata_git_revision]
>
>
>
> Was this change intended? Because it doesn't match up with the commit
> message, as far as I can see.
>
-- 
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 2354 bytes --]

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

* Re: [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo
  2016-04-28 16:11       ` Christopher Larson
@ 2016-04-29 17:04         ` Peter Kjellerstedt
  0 siblings, 0 replies; 6+ messages in thread
From: Peter Kjellerstedt @ 2016-04-29 17:04 UTC (permalink / raw)
  To: Christopher Larson; +Cc: Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

I have sent an updated patch now with the commit message amended.

//Peter

From: kergoth@gmail.com [mailto:kergoth@gmail.com] On Behalf Of Christopher Larson
Sent: den 28 april 2016 18:11
To: Peter Kjellerstedt
Cc: Patches and discussions about the oe-core layer
Subject: Re: [OE-core] [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo

On Thu, Apr 28, 2016 at 7:34 AM, Peter Kjellerstedt <peter.kjellerstedt@axis.com<mailto:peter.kjellerstedt@axis.com>> wrote:
Yes, it was intentional. I mentioned this in the cover letter. I can of course add something about it to the commit message as well if you like.

That's what a commit message is for, yes, to describe why something is being changed. The cover letter isn't going to end up in the git history. If it hasn't yet been merged, I think it'd be nice to get it improved, so someone looking at the logs later understands the intention. Thanks.


-    scms = [base_get_metadata_git_revision, \
-            base_get_metadata_svn_revision]
+    scms = [base_get_metadata_git_revision]

Was this change intended? Because it doesn't match up with the commit message, as far as I can see.
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 5708 bytes --]

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

end of thread, other threads:[~2016-04-29 17:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-26 19:49 [PATCH 0/1] Improve how to determine METADATA_REVISION Peter Kjellerstedt
2016-04-26 19:49 ` [PATCH 1/1] metadata_scm.bbclass: Do not assume ${COREBASE} is a Git repo Peter Kjellerstedt
2016-04-27 20:26   ` Christopher Larson
2016-04-28 14:34     ` Peter Kjellerstedt
2016-04-28 16:11       ` Christopher Larson
2016-04-29 17:04         ` 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.