[source] scripts/getver.sh: fix revision number on BSD/MacOS
LEDE Commits
lede-commits at lists.infradead.org
Sat Jul 9 11:02:34 PDT 2016
nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/?p=source.git;a=commitdiff;h=c19381dfca92a2eb80d35f294515a777da2cb7be
commit c19381dfca92a2eb80d35f294515a777da2cb7be
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sat Jul 9 20:00:50 2016 +0200
scripts/getver.sh: fix revision number on BSD/MacOS
Strip leading whitespace from wc -l output
Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
scripts/getver.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/getver.sh b/scripts/getver.sh
index fa2e676..5d8788f 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
More information about the lede-commits
mailing list