Skip to content

Commit

Permalink
scripts/getver.sh: generate revision relative to the reboot tag
Browse files Browse the repository at this point in the history
Signed-off-by: John Crispin <[email protected]>
  • Loading branch information
John Crispin committed Mar 24, 2016
1 parent ee53a24 commit 343c3be
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions scripts/getver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]
}

Expand All @@ -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"

0 comments on commit 343c3be

Please sign in to comment.