prplos/scripts/prplos_version.sh
Petr Štetiar 8fbd2c3772
scripts: prplos_version.sh: mark development version as 3.1.0
OpenWrt 23.05 release is the new base for the upcoming prplOS 3.1.0
release, so lets mark the build versions accordingly.

Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2025-07-31 15:18:14 +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:-3.1.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