Hi,

running ./autogen.sh I get

  sh: 1: [[: not found

during autoreconf. Culprit is

m4_define([nm_git_sha], [m4_esyscmd([ ( [[ -d ./.git/ && "$(realpath
./.git/)" = "$(realpath "$(git rev-parse --git-dir 2>/dev/null)"
2>/dev/null)" ]] && git rev-parse --verify -q HEAD 2>/dev/null ) || true
])])

[[ ]] is a bashism. Fixing that to use [ ] && [ ] I encounter another error:

  sh: 1: realpath: not found

The realpath utility is not installed by default on Debian systems.
It would probably be better to use readlink -f here, since that is part
of coreutils and installed by default.

I'm not sure what the check is supposed to achieve, but the attached
patch fixes the errors for me.

Please review.

Michael


-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
From b8fc9817a392dffb4cf2d1a86ce1be998af4bc94 Mon Sep 17 00:00:00 2001
From: Michael Biebl <bi...@debian.org>
Date: Tue, 17 Jun 2014 16:09:10 +0200
Subject: [PATCH] Fix bashisms in configure.ac

[[ && ]] is a bashism, so use [ ] && [ ] instead.
Also use readlink -f instead of realpath, since the latter is not
guaranteed to be installed.
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index e5044d4..00af5b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,7 +7,7 @@ m4_define([nm_micro_version], [9])
 m4_define([nm_nano_version],  [95])
 m4_define([nm_version],
           [nm_major_version.nm_minor_version.nm_micro_version.nm_nano_version])
-m4_define([nm_git_sha], [m4_esyscmd([ ( [[ -d ./.git/ && "$(realpath ./.git/)" = "$(realpath "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ]] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
+m4_define([nm_git_sha], [m4_esyscmd([ ( [ -d ./.git/ ] && [ "$(readlink -f ./.git/)" = "$(readlink -f "$(git rev-parse --git-dir 2>/dev/null)" 2>/dev/null)" ] && git rev-parse --verify -q HEAD 2>/dev/null ) || true ])])
 
 AC_INIT([NetworkManager], [nm_version],
         [http://bugzilla.gnome.org/enter_bug.cgi?product=NetworkManager],
-- 
2.0.0

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
networkmanager-list mailing list
networkmanager-list@gnome.org
https://mail.gnome.org/mailman/listinfo/networkmanager-list

Reply via email to