Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] Fix errors showing up with layers that aren't git repos
@ 2015-11-09 14:40 Paul Eggleton
  2015-11-09 14:40 ` [PATCH 1/1] classes/metadata_scm: fix git errors showing up on non-git repositories Paul Eggleton
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2015-11-09 14:40 UTC (permalink / raw)
  To: openembedded-core


This should really be applied to both master and jethro.


The following changes since commit e44ed8c18e395b9c055aefee113b90708e8a8a2f:

  build-appliance-image: Update to jethro head revision (2015-11-03 14:02:57 +0000)

are available in the git repository at:

  git://git.openembedded.org/openembedded-core-contrib paule/metadata_scm
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/metadata_scm

Paul Eggleton (1):
  classes/metadata_scm: fix git errors showing up on non-git
    repositories

 meta/classes/metadata_scm.bbclass | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

-- 
2.1.0



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

* [PATCH 1/1] classes/metadata_scm: fix git errors showing up on non-git repositories
  2015-11-09 14:40 [PATCH 0/1] Fix errors showing up with layers that aren't git repos Paul Eggleton
@ 2015-11-09 14:40 ` Paul Eggleton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2015-11-09 14:40 UTC (permalink / raw)
  To: openembedded-core

Fixes the following error showing up for layers that aren't a git repo
(or aren't parented by one):

fatal: Not a git repository (or any of the parent directories): .git

This was because we weren't intercepting stderr. We might as well just
use bb.process.run() here which does that and returns stdout and stderr
separately.

(This was a regression that came in with OE-Core revision
3aac11076e22ac4fea48f5404110bb959547a9fe).

Fixes [YOCTO #8661].

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/metadata_scm.bbclass | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/meta/classes/metadata_scm.bbclass b/meta/classes/metadata_scm.bbclass
index 64465fa..0f7f423 100644
--- a/meta/classes/metadata_scm.bbclass
+++ b/meta/classes/metadata_scm.bbclass
@@ -65,19 +65,19 @@ def base_get_metadata_svn_revision(path, d):
     return revision
 
 def base_get_metadata_git_branch(path, d):
-    import subprocess
+    import bb.process
 
     try:
-        return subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"],
-                                       cwd=path).strip()
-    except:
-        return "<unknown>"
+        rev, _ = bb.process.run('git rev-parse --abbrev-ref HEAD', cwd=path)
+    except bb.process.ExecutionError:
+        rev = '<unknown>'
+    return rev.strip()
 
 def base_get_metadata_git_revision(path, d):
-    import subprocess
+    import bb.process
 
     try:
-        return subprocess.check_output(["git", "rev-parse", "HEAD"],
-                                       cwd=path).strip()
-    except:
-        return "<unknown>"
+        rev, _ = bb.process.run('git rev-parse HEAD', cwd=path)
+    except bb.process.ExecutionError:
+        rev = '<unknown>'
+    return rev.strip()
-- 
2.1.0



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

end of thread, other threads:[~2015-11-09 14:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-09 14:40 [PATCH 0/1] Fix errors showing up with layers that aren't git repos Paul Eggleton
2015-11-09 14:40 ` [PATCH 1/1] classes/metadata_scm: fix git errors showing up on non-git repositories Paul Eggleton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox