* [PATCH] metadata_scm.bbclass: restore capture of stderr
@ 2015-11-17 17:42 Christopher Larson
2015-11-17 18:05 ` Christopher Larson
0 siblings, 1 reply; 2+ messages in thread
From: Christopher Larson @ 2015-11-17 17:42 UTC (permalink / raw)
To: openembedded-core; +Cc: Christopher Larson
From: Christopher Larson <chris_larson@mentor.com>
We don't want the user to see errors from the git commands run by metadata_scm
on their console, so we need to capture or suppress stderr as well as stdout.
This was the case prior to the rewrite of the git hash logic, but the 2>&1 was
lost when it was reworked. Bring it back to avoid messages like this in builds
with non-git layers:
fatal: Not a git repository (or any of the parent directories): .git
Cc: Ross Burton <ross.burton@intel.com>
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
meta/classes/metadata_scm.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index 64465fa..a8152f7 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -69,7 +69,7 @@ def base_get_metadata_git_branch(path, d):
try:
return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"],
- cwd=path).strip()
+ cwd=path, stderr=subprocess.STDOUT).strip()
except:
return "<unknown>"
@@ -78,6 +78,6 @@ def base_get_metadata_git_revision(path, d):
try:
return subprocess.check_output(["git", "rev-parse", "HEAD"],
- cwd=path).strip()
+ cwd=path, stderr=subprocess.STDOUT).strip()
except:
return "<unknown>"
--
2.2.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] metadata_scm.bbclass: restore capture of stderr
2015-11-17 17:42 [PATCH] metadata_scm.bbclass: restore capture of stderr Christopher Larson
@ 2015-11-17 18:05 ` Christopher Larson
0 siblings, 0 replies; 2+ messages in thread
From: Christopher Larson @ 2015-11-17 18:05 UTC (permalink / raw)
To: openembedded-core
[-- Attachment #1: Type: text/plain, Size: 1804 bytes --]
Ignore this, Paul has a pending patch for it.
On Tue, Nov 17, 2015 at 10:42 AM Christopher Larson <kergoth@gmail.com>
wrote:
> From: Christopher Larson <chris_larson@mentor.com>
>
> We don't want the user to see errors from the git commands run by
> metadata_scm
> on their console, so we need to capture or suppress stderr as well as
> stdout.
> This was the case prior to the rewrite of the git hash logic, but the 2>&1
> was
> lost when it was reworked. Bring it back to avoid messages like this in
> builds
> with non-git layers:
>
> fatal: Not a git repository (or any of the parent directories): .git
>
> Cc: Ross Burton <ross.burton@intel.com>
> Signed-off-by: Christopher Larson <chris_larson@mentor.com>
> ---
> meta/classes/metadata_scm.bbclass | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/metadata_scm.bbclass
> b/meta/classes/metadata_scm.bbclass
> index 64465fa..a8152f7 100644
> --- a/meta/classes/metadata_scm.bbclass
> +++ b/meta/classes/metadata_scm.bbclass
> @@ -69,7 +69,7 @@ def base_get_metadata_git_branch(path, d):
>
> try:
> return subprocess.check_output(["git", "rev-parse",
> "--abbrev-ref", "HEAD"],
> - cwd=path).strip()
> + cwd=path,
> stderr=subprocess.STDOUT).strip()
> except:
> return "<unknown>"
>
> @@ -78,6 +78,6 @@ def base_get_metadata_git_revision(path, d):
>
> try:
> return subprocess.check_output(["git", "rev-parse", "HEAD"],
> - cwd=path).strip()
> + cwd=path,
> stderr=subprocess.STDOUT).strip()
> except:
> return "<unknown>"
> --
> 2.2.1
>
>
[-- Attachment #2: Type: text/html, Size: 2547 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-17 18:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-17 17:42 [PATCH] metadata_scm.bbclass: restore capture of stderr Christopher Larson
2015-11-17 18:05 ` Christopher Larson
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.