aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/getver.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-09 20:00:50 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-09 20:02:21 +0200
commitc19381dfca92a2eb80d35f294515a777da2cb7be (patch)
tree4129a60987343b64344f24e3663725af30307b4e /scripts/getver.sh
parent916aebb300e9e9215723dd9a3892d91ba5695411 (diff)
downloadupstream-c19381dfca92a2eb80d35f294515a777da2cb7be.tar.gz
upstream-c19381dfca92a2eb80d35f294515a777da2cb7be.tar.bz2
upstream-c19381dfca92a2eb80d35f294515a777da2cb7be.zip
scripts/getver.sh: fix revision number on BSD/MacOS
Strip leading whitespace from wc -l output Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'scripts/getver.sh')
-rwxr-xr-xscripts/getver.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/getver.sh b/scripts/getver.sh
index fa2e676925..5d8788f202 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -24,8 +24,8 @@ try_git() {
;;
*)
UPSTREAM_BASE="$(git merge-base $GET_REV origin/master)"
- UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE | wc -l)"
- REV="$(git rev-list reboot..$GET_REV | wc -l)"
+ UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE | wc -l | awk '{print $1}')"
+ REV="$(git rev-list reboot..$GET_REV | wc -l | awk '{print $1}')"
if [ -n "$REV" -a -n "$UPSTREAM_REV" -a "$REV" -gt "$UPSTREAM_REV" ]; then
REV="r${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
else