summaryrefslogtreecommitdiffstats
path: root/meta-oe/classes/gitver.bbclass
diff options
context:
space:
mode:
authorAlejandro Mery <amery@hanoverdisplays.com>2017-06-20 13:13:04 +0100
committerMartin Jansa <Martin.Jansa@gmail.com>2017-06-22 16:03:00 +0200
commit251547bd2ee9417175cf8d4349f83cdbd7f8479e (patch)
tree527c4ed2c0a87919fd03702ec7af267bc38c7241 /meta-oe/classes/gitver.bbclass
parentbc94e4329acce34972b42c3ed30ee28e910224ae (diff)
downloadmeta-openembedded-251547bd2ee9417175cf8d4349f83cdbd7f8479e.tar.gz
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@hanoverdisplays.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/classes/gitver.bbclass')
-rw-r--r--meta-oe/classes/gitver.bbclass23
1 files changed, 10 insertions, 13 deletions
diff --git a/meta-oe/classes/gitver.bbclass b/meta-oe/classes/gitver.bbclass
index a09c99749..380374ab2 100644
--- a/meta-oe/classes/gitver.bbclass
+++ b/meta-oe/classes/gitver.bbclass
@@ -27,23 +27,20 @@ def get_git_pv(d, tagadjust=None):
27 gitdir = os.path.abspath(os.path.join(srcdir, ".git")) 27 gitdir = os.path.abspath(os.path.join(srcdir, ".git"))
28 try: 28 try:
29 ver = gitrev_run("git describe --tags", gitdir) 29 ver = gitrev_run("git describe --tags", gitdir)
30 except Exception as exc: 30 except:
31 bb.fatal(str(exc))
32
33 if not ver:
34 try: 31 try:
35 ver = gitrev_run("git rev-parse --short HEAD", gitdir) 32 ver = gitrev_run("git rev-parse --short HEAD", gitdir)
33 if ver:
34 return "0.0+%s" % ver
35 else:
36 return "0.0"
37
36 except Exception as exc: 38 except Exception as exc:
37 bb.fatal(str(exc)) 39 raise bb.parse.SkipPackage(str(exc))
38 40
39 if ver: 41 if ver and tagadjust:
40 return "0.0+%s" % ver 42 ver = tagadjust(ver)
41 else: 43 return ver
42 return "0.0"
43 else:
44 if tagadjust:
45 ver = tagadjust(ver)
46 return ver
47 44
48def get_git_hash(d): 45def get_git_hash(d):
49 import os 46 import os