Subject: [PATCH] Upgrades x86 to kernel 2.6.27 (#4195)
[openwrt.git] / scripts / getver.sh
1 #!/usr/bin/env bash
2 export LANG=C
3 export LC_ALL=C
4 [ -n "$TOPDIR" ] && cd $TOPDIR
5
6 try_version() {
7 [ -f version ] || return 1
8 REV="$(cat version)"
9 [ -n "$REV" ]
10 }
11
12 try_svn() {
13 [ -d .svn ] || return 1
14 REV="$(svn info | awk '/^Revision:/ { print $2 }')"
15 REV="${REV:+r$REV}"
16 [ -n "$REV" ]
17 }
18
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" ]
24 }
25
26 try_version || try_svn || try_git || REV="unknown"
27 echo "$REV"
This page took 0.041221 seconds and 5 git commands to generate.