It was decided, that prplOS releases should be actually prplWare releases, so we've renamed prplos-vX.Y.Z Git tags to prplware-vX.Y.Z since prplWare 4.0.1 release. So lets adapt the versioning script to support that new Git tag scheme. Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org> (cherry picked from commit 4b55e8c58fd0a0c94b7c689685c871d2355ed7e5)
25 lines
562 B
Bash
Executable File
25 lines
562 B
Bash
Executable File
#!/usr/bin/env bash
|
|
export LANG=C
|
|
export LC_ALL=C
|
|
|
|
PRPLOS_DEVELOPMENT_VERSION="${PRPLOS_DEVELOPMENT_VERSION:-4.1.0}"
|
|
|
|
tagged_version() {
|
|
local tag
|
|
|
|
tag=$(git describe --exact-match --tags HEAD 2>/dev/null | sed 's/^prplware-v//')
|
|
[ -n "$tag" ] && echo "$tag" && exit
|
|
}
|
|
|
|
development_version() {
|
|
local git_hash
|
|
|
|
git_hash=$(git log --pretty=format:%h -n 1 --abbrev=8 2>/dev/null)
|
|
[ -z "$git_hash" ] && git_hash="unknown"
|
|
echo "${PRPLOS_DEVELOPMENT_VERSION}-${git_hash}"
|
|
}
|
|
|
|
[ -n "$TOPDIR" ] && cd "$TOPDIR" || exit
|
|
tagged_version
|
|
development_version
|