Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1754 from mischief/coreos-semver-eclass
Browse files Browse the repository at this point in the history
eclass: add get_semver() to cros-workon eclass
  • Loading branch information
mischief committed Feb 3, 2016
2 parents 22e5c7a + 93beac7 commit 0fe2a68
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions eclass/cros-workon.eclass
Expand Up @@ -166,4 +166,20 @@ cros-workon_pkg_info() {
echo "CROS_WORKON_PROJECT=(\"${CROS_WORKON_PROJECT}\")"
}

# get the semver of the git repo that is being built
get_semver() {
# get git tag/sha
local v
v=$(git describe --long --dirty) || die

# strip a leading v from the tag
v=${v#v}

# replace first - with +, to attach git sha/dirty as semver metadata
v=${v/-/+}

echo ${v}
}

EXPORT_FUNCTIONS src_unpack pkg_info

0 comments on commit 0fe2a68

Please sign in to comment.