prplos/scripts/prplos_version.sh
Petr Štetiar ca25d241e2
scripts: prplos_version.sh: mark development version as 4.0.0
Development on next prplOS release 4.0.0 started, so lets mark the
version accordingly.

References: PCF-1574
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2025-07-31 15:25:48 +00:00

25 lines
560 B
Bash
Executable File

#!/usr/bin/env bash
export LANG=C
export LC_ALL=C
PRPLOS_DEVELOPMENT_VERSION="${PRPLOS_DEVELOPMENT_VERSION:-4.0.0}"
tagged_version() {
local tag
tag=$(git describe --exact-match --tags HEAD 2>/dev/null | sed 's/^prplos-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