[oe-commits] [meta-openembedded] 14/29: gitver: skip packages instead of panic()ing if ${GITVER} fails to expand
git at git.openembedded.org
git at git.openembedded.org
Tue Aug 8 19:02:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
martin_jansa pushed a commit to branch morty-next
in repository meta-openembedded.
commit 6ee7d0642660d8a7510df9832583edcf9b65f137
Author: Alejandro Mery <amery at hanoverdisplays.com>
AuthorDate: Tue Jun 20 13:13:04 2017 +0100
gitver: skip packages instead of panic()ing if ${GITVER} fails to expand
`inherit externalsrc gitver` is a very useful combo to get development trees
in your workspace having a ${PN}_git.bb with PV=${GITVER} coexisting with a regular
${PN}_${PV}.bb
but not everyone wants to checkout all developments sources and managinging different
layers for each options is quite troublesome.
making `gitver` skip the .bb instead of panic()ing every time EXTERNALSRC is missing
allows people to have a single development layer where packages get enabled if
the right sources are present or falling back to the last release if not
Signed-off-by: Alejandro Mery <amery at hanoverdisplays.com>
Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
meta-oe/classes/gitver.bbclass | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/meta-oe/classes/gitver.bbclass b/meta-oe/classes/gitver.bbclass
index 875a3d7..9154143 100644
--- a/meta-oe/classes/gitver.bbclass
+++ b/meta-oe/classes/gitver.bbclass
@@ -27,23 +27,20 @@ def get_git_pv(d, tagadjust=None):
gitdir = os.path.abspath(os.path.join(srcdir, ".git"))
try:
ver = gitrev_run("git describe --tags", gitdir)
- except Exception as exc:
- bb.fatal(str(exc))
-
- if not ver:
+ except:
try:
ver = gitrev_run("git rev-parse --short HEAD", gitdir)
+ if ver:
+ return "0.0+%s" % ver
+ else:
+ return "0.0"
+
except Exception as exc:
- bb.fatal(str(exc))
+ raise bb.parse.SkipPackage(str(exc))
- if ver:
- return "0.0+%s" % ver
- else:
- return "0.0"
- else:
- if tagadjust:
- ver = tagadjust(ver)
- return ver
+ if ver and tagadjust:
+ ver = tagadjust(ver)
+ return ver
def get_git_hash(d):
import os
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list