add md5sum for final linux 2.6.27
[openwrt/crisos.git] / scripts / getver.sh
blob5155792016ad8af36e63db9a7d3654b14eb9e8eb
1 #!/usr/bin/env bash
2 export LANG=C
3 export LC_ALL=C
4 [ -n "$TOPDIR" ] && cd $TOPDIR
6 try_version() {
7 [ -f version ] || return 1
8 REV="$(cat version)"
9 [ -n "$REV" ]
12 try_svn() {
13 [ -d .svn ] || return 1
14 REV="$(svn info | awk '/^Revision:/ { print $2 }')"
15 REV="${REV:+r$REV}"
16 [ -n "$REV" ]
19 try_git() {
20 [ -d .git ] || return 1
21 REV="$(git log | grep -m 1 git-svn-id | awk '{ gsub(/.*@/, "", $2); print $2 }')"
22 REV="${REV:+r$REV}"
23 [ -n "$REV" ]
26 try_version || try_svn || try_git || REV="unknown"
27 echo "$REV"