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

eclass: add get_semver() to cros-workon eclass #1754

Merged
merged 1 commit into from Feb 3, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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