aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2016-07-09 15:01:58 +0200
committerJonas Gorski <jonas.gorski@gmail.com>2016-07-09 15:08:46 +0200
commitf1765277bacbea47a45ed913ca8fa043e9f71393 (patch)
tree19e987e702e9078e474b25c8d0318af21c61e5d5
parenteae812ddb6cc6edfd253711ebb2250c32c599692 (diff)
downloadupstream-f1765277bacbea47a45ed913ca8fa043e9f71393.tar.gz
upstream-f1765277bacbea47a45ed913ca8fa043e9f71393.tar.bz2
upstream-f1765277bacbea47a45ed913ca8fa043e9f71393.zip
scripts/getver.sh: avoid use of git rev-list --count
This is not a valid option in older git version, used in e.g. RHEL6. Reported-by: Steven Haigh <netwiz@crc.id.au> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
-rwxr-xr-xscripts/getver.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/getver.sh b/scripts/getver.sh
index 4c8fab079c..fa2e676925 100755
--- a/scripts/getver.sh
+++ b/scripts/getver.sh
@@ -19,13 +19,13 @@ try_git() {
case "$GET_REV" in
r*)
GET_REV="$(echo $GET_REV | tr -d 'r')"
- BASE_REV="$(git rev-list reboot..HEAD --count)"
+ BASE_REV="$(git rev-list reboot..HEAD | wc -l)"
REV="$(git rev-parse HEAD~$((BASE_REV - GET_REV)))"
;;
*)
UPSTREAM_BASE="$(git merge-base $GET_REV origin/master)"
- UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE --count)"
- REV="$(git rev-list reboot..$GET_REV --count)"
+ UPSTREAM_REV="$(git rev-list reboot..$UPSTREAM_BASE | wc -l)"
+ REV="$(git rev-list reboot..$GET_REV | wc -l)"
if [ -n "$REV" -a -n "$UPSTREAM_REV" -a "$REV" -gt "$UPSTREAM_REV" ]; then
REV="r${UPSTREAM_REV}+$((REV - UPSTREAM_REV))"
else