From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id EE2C0431FAF for ; Wed, 2 May 2012 15:26:08 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JS8FxrecYNyS for ; Wed, 2 May 2012 15:26:07 -0700 (PDT) Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 6B67A431FAE for ; Wed, 2 May 2012 15:26:07 -0700 (PDT) Received: from fctnnbsc30w-156034089108.dhcp-dynamic.fibreop.nb.bellaliant.net ([156.34.89.108] helo=zancas.localnet) by tesseract.cs.unb.ca with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1SPhzj-0007Bh-8N; Wed, 02 May 2012 19:26:03 -0300 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1SPhzd-0002tl-Ru; Wed, 02 May 2012 19:25:53 -0300 From: David Bremner To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] configure: test shell parameter substring processing and possibly exec one In-Reply-To: <1334643263-30207-1-git-send-email-tomi.ollila@iki.fi> References: <1334589199-25894-1-git-send-email-tomi.ollila@iki.fi> <1334643263-30207-1-git-send-email-tomi.ollila@iki.fi> User-Agent: Notmuch/0.12+152~g904a807 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Wed, 02 May 2012 19:25:53 -0300 Message-ID: <87ehr2nrta.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam_bar: - X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 May 2012 22:26:09 -0000 I'm still a bit leery of over-complicating the configure script to support legacy /bin/sh; however, I guess I'm at least convinced that the only trivial solution is just to document the requirement for posix /bin/sh. It will be odd to back this out and document the restriction later, so please chime in now if you have strong feelings either way. Tomi Ollila writes: > To tackle this situation the beginning of configure attemts to do a silent > parameter substitution in a subshell; in case this fails the subshell exits > with nonzero value which is easy to detect. s/attemts/attempts/ > The || constructs are used twice. The first one is used as Bourne shell > chokes on 'if ! ... ' construct (and if ...; then :; else do_things; fi > looks stupid). The second one(liner) takes care of the possible future > addition of 'set -eu' in the beginning of this script. OK, although I might have gone for the empty if myself. > +# If not, attempt to locate and launch one which probably can. > +( option=option=value; : ${option#*=} ) 2>/dev/null || { option=option=value seems a little _too_ clever to me. Any reason not to use e.g. option="A,B" > + if test x"${_NOTMUCH_CONFIGURE-}" = x ; then > + _NOTMUCH_CONFIGURE=1; export _NOTMUCH_CONFIGURE This could probably use a comment. > + for x in /bin/ksh /bin/bash /usr/bin/bash I guess add /usr/local/bin/bash? I'm slightly worried this list will just keep growing.