diff options
author | Werner Koch <wk@gnupg.org> | 2017-01-12 09:58:57 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-01-12 09:58:57 +0100 |
commit | 3c00b52f7cb0fbd756c0bbe5134b8f2d69c60dd1 (patch) | |
tree | 19da57cd7fb0efe97943b7259a624f4a151ae9c2 /autogen.sh | |
parent | libdns: Silence -Wstrict-prototypes on some function ptrs. (diff) | |
download | gnupg2-3c00b52f7cb0fbd756c0bbe5134b8f2d69c60dd1.tar.xz gnupg2-3c00b52f7cb0fbd756c0bbe5134b8f2d69c60dd1.zip |
build: Make autogen.sh more POSIX friendly.
* autogen.sh: Replace non POSIX "cp -a" and "head -c".
--
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh index 92c6df807..f2af5a7b5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -225,7 +225,7 @@ if [ "$myhost" = "find-version" ]; then fi [ -n "$tmp" ] && beta=yes rev=$(git rev-parse --short HEAD | tr -d '\n\r') - rvd=$((0x$(echo ${rev} | head -c 4))) + rvd=$((0x$(echo ${rev} | dd bs=1 count=2 2>/dev/null))) else ingit=no beta=yes @@ -417,8 +417,11 @@ fi # Check the git setup. if [ -d .git ]; then - CP="cp -a" - [ -z "${SILENT}" ] && CP="$CP -v" + CP="cp -p" + # If we have a GNU cp we can add -v + if cp --version >/dev/null 2>/dev/null; then + [ -z "${SILENT}" ] && CP="$CP -v" + fi if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then [ -z "${SILENT}" ] && cat <<EOF *** Activating trailing whitespace git pre-commit hook. *** |