Hi all,

the attached patch makes git-version-gen compatible with dash shell,
whose shift built-in aborts when there are no more arguments.

Bye,
Mosè
From 0733fa62be455930e549bdee9862f075c352db3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mos=C3=A8=20Giordano?= <[email protected]>
Date: Sun, 8 May 2016 13:39:40 +0200
Subject: [PATCH] git-version-gen: make script compatible with dash

* build-aux/git-version-gen: shift 0 arguments when there are
none.  dash shell aborts when there are no arguments to shift.
---
 ChangeLog                 | 6 ++++++
 build-aux/git-version-gen | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 803a008..0faa30b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-08  Mosè Giordano  <[email protected]>  (tiny change)
+
+	git-version-gen: make script compatible with dash
+	* build-aux/git-version-gen: shift 0 arguments when there are
+	none.  dash shell aborts when there are no arguments to shift.
+
 2016-05-04  Paul Eggert  <[email protected]>
 
 	glob: merge glibc changes into lib/glob.c
diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 6c56147..1389bfc 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2016-05-08.11; # UTC
 
 # Copyright (C) 2007-2016 Free Software Foundation, Inc.
 #
@@ -117,7 +117,7 @@ while test $# -gt 0; do
         exit 1
       fi;;
   esac
-  shift
+  shift $(( $# > 0 ? 1 : 0))
 done
 
 if test "x$tarball_version_file" = x; then
-- 
2.8.1

Reply via email to