path: root/meta-oe
diff options
authorAlejandro Mery <amery@hanoverdisplays.com>2017-06-20 13:13:04 +0100
committerArmin Kuster <akuster808@gmail.com>2017-09-13 17:16:28 -0700
commit29225f2e23d65211e3bc669e2bfd9ae8ff56aaf3 (patch)
tree425cbd7e3818936c672b989331f9b205d4cf9c58 /meta-oe
parent4acb87b4d865501ed7a05e443aab5a670ef0cbfc (diff)
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> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-oe')
1 files changed, 10 insertions, 13 deletions
diff --git a/meta-oe/classes/gitver.bbclass b/meta-oe/classes/gitver.bbclass
index a09c997496..380374ab27 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"))
ver = gitrev_run("git describe --tags", gitdir)
- except Exception as exc:
- bb.fatal(str(exc))
- if not ver:
+ except:
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