scripts/getver.sh: generate revision relative to the reboot tag

Signed-off-by: John Crispin <blogic@openwrt.org>
lede-17.01
John Crispin 2016-03-24 22:14:12 +01:00
parent ee53a240ac
commit 343c3be454
1 changed files with 2 additions and 10 deletions

View File

@ -9,17 +9,9 @@ try_version() {
[ -n "$REV" ] [ -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() { try_git() {
git rev-parse --git-dir >/dev/null 2>&1 || return 1 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="$(git describe | sed "s/reboot-\([0-9]*\)-.*/\1/g")"
REV="${REV:+r$REV}"
[ -n "$REV" ] [ -n "$REV" ]
} }
@ -30,5 +22,5 @@ try_hg() {
[ -n "$REV" ] [ -n "$REV" ]
} }
try_version || try_svn || try_git || try_hg || REV="unknown" try_version || try_git || try_hg || REV="unknown"
echo "$REV" echo "$REV"