[oe-commits] Chris Larson : gitver: drop 'v' tag prefix where appropriate

git version control git at git.openembedded.org
Thu Oct 14 00:32:54 UTC 2010


Module: openembedded.git
Branch: master
Commit: 2a0ffe76630abda6d528dd9ac961051ba09718ed
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=2a0ffe76630abda6d528dd9ac961051ba09718ed

Author: Chris Larson <chris_larson at mentor.com>
Date:   Wed Oct 13 17:29:09 2010 -0700

gitver: drop 'v' tag prefix where appropriate

If the tag starts with 'v' followed by a number, drop the 'v' prefix.  This
will not be done for you if you customize GIT_TAGADJUST.

Signed-off-by: Chris Larson <chris_larson at mentor.com>

---

 classes/gitver.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/classes/gitver.bbclass b/classes/gitver.bbclass
index 3edb273..2efb3f1 100644
--- a/classes/gitver.bbclass
+++ b/classes/gitver.bbclass
@@ -5,8 +5,13 @@
 # for use in ${PV}, extracted from the ${S} git checkout, assuming it is one.
 # This is most useful in concert with srctree.bbclass.
 
+def git_drop_tag_prefix(version):
+    if re.match("v\d", version):
+        return version[1:]
+    else:
+        return version
 
-GIT_TAGADJUST = "version"
+GIT_TAGADJUST = "git_drop_tag_prefix(version)"
 GITVER = "${@get_git_pv('${S}', d, tagadjust=lambda version:${GIT_TAGADJUST})}"
 
 def get_git_pv(path, d, tagadjust=None):





More information about the Openembedded-commits mailing list