aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/classes/gitver.bbclass
diff options
context:
space:
mode:
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 875a3d79d..91541437d 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