summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>2019-02-22 15:16:01 +1100
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>2019-03-06 09:50:00 +1300
commit3abf853d2cc6f5ef137eedae64779790e3b472b7 (patch)
tree82a0f352eaebe0e8e0270706fc11f34c4ba8dcce
parent28d0d7035ee3099935ef264db40a86142c098ec5 (diff)
downloadtalos-petitboot-3abf853d2cc6f5ef137eedae64779790e3b472b7.tar.gz
talos-petitboot-3abf853d2cc6f5ef137eedae64779790e3b472b7.zip
version.sh: Include leading 'v' from git describe
For some reason our version script removes the leading 'v' from the git tag. This confuses some other tools such as Buildroot and is different to most other projects, so include it again. Additionally now that we have tagged releases just use git describe rather than using a SHA and date to describe non-tag commits. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
-rwxr-xr-xversion.sh12
1 files changed, 2 insertions, 10 deletions
diff --git a/version.sh b/version.sh
index bf91f70..83cda7a 100755
--- a/version.sh
+++ b/version.sh
@@ -15,16 +15,8 @@ if head=$(git rev-parse --short=8 --verify HEAD 2>/dev/null); then
suffix=-dirty
fi
- if tag=$(git describe --tags --exact-match 2>/dev/null); then
- # use a tag; remove any 'v' prefix from v<VERSION> tags
- tag=${tag#v}
- version=$(printf "%s%s" ${tag} ${suffix})
- else
- # Use the git commit revision for the package version, and add
- # a date prefix for easy comparisons.
- date=$(git log --pretty=format:"%ct" -1 HEAD)
- version=$(printf "%($datefmt)T.g%s%s" ${date} ${head} ${suffix})
- fi
+ tag=$(git describe --tags 2>/dev/null)
+ version=$(printf "%s%s" ${tag} ${suffix})
else
# Check if a specific version is set, eg: by buildroot
if [ ! -z "$PETITBOOT_VERSION" ];
OpenPOWER on IntegriCloud