aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/getver.sh
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2016-03-24 22:14:12 +0100
committerJohn Crispin <blogic@openwrt.org>2016-03-24 22:14:12 +0100
commit343c3be45451e4a11f03109bd6cb1dd9061ec5eb (patch)
tree9c5a8951eab17805a10b82b5a206659557e3e496 /scripts/getver.sh
parentee53a240ac902dc83209008a2671e7fdcf55957a (diff)
downloadupstream-343c3be45451e4a11f03109bd6cb1dd9061ec5eb.tar.gz
upstream-343c3be45451e4a11f03109bd6cb1dd9061ec5eb.tar.bz2
upstream-343c3be45451e4a11f03109bd6cb1dd9061ec5eb.zip
scripts/getver.sh: generate revision relative to the reboot tag
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'scripts/getver.sh')
-rwxr-xr-xscripts/getver.sh12
1 files changed, 2 insertions, 10 deletions
diff --git a/scripts/getver.sh b/scripts/getver.sh
index 6cf7797519..d3b68c8634 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -9,17 +9,9 @@ try_version() {
[ -n "$REV" ]
}
-try_svn() {
- [ -d .svn ] || return 1
- REV="$(svn info | awk '/^Last Changed Rev:/ { print $4 }')"
- REV="${REV:+r$REV}"
- [ -n "$REV" ]
-}
-
try_git() {
git rev-parse --git-dir >/dev/null 2>&1 || return 1
- REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $0); print $1 }')"
- REV="${REV:+r$REV}"
+ REV="$(git describe | sed "s/reboot-\([0-9]*\)-.*/\1/g")"
[ -n "$REV" ]
}
@@ -30,5 +22,5 @@ try_hg() {
[ -n "$REV" ]
}
-try_version || try_svn || try_git || try_hg || REV="unknown"
+try_version || try_git || try_hg || REV="unknown"
echo "$REV"