From 7879a274c1d4d9f1e2adfeca3ffd4b970a7268f8 Mon Sep 17 00:00:00 2001 From: Vladimir Marek Date: Wed, 11 Apr 2012 10:43:42 +0200 Subject: [PATCH] Re: [PATCH 1/4] Make configure use /bin/bash instead of /bin/sh --- 5e/2bfe7e34be197e399f4cb44d32aa44bf444bc0 | 142 ++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 5e/2bfe7e34be197e399f4cb44d32aa44bf444bc0 diff --git a/5e/2bfe7e34be197e399f4cb44d32aa44bf444bc0 b/5e/2bfe7e34be197e399f4cb44d32aa44bf444bc0 new file mode 100644 index 000000000..d00345054 --- /dev/null +++ b/5e/2bfe7e34be197e399f4cb44d32aa44bf444bc0 @@ -0,0 +1,142 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 1321D431FAF + for ; Wed, 11 Apr 2012 01:44:18 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -4.999 +X-Spam-Level: +X-Spam-Status: No, score=-4.999 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_HI=-5, UNPARSEABLE_RELAY=0.001] + 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 uUMgKDyJ9s4Z for ; + Wed, 11 Apr 2012 01:44:17 -0700 (PDT) +Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 45D36431FAE + for ; Wed, 11 Apr 2012 01:44:17 -0700 (PDT) +Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) + by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with + ESMTP id q3B8iFTk019749 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) + for ; Wed, 11 Apr 2012 08:44:16 GMT +Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) + by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id + q3B8iEhd013937 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) + for ; Wed, 11 Apr 2012 08:44:14 GMT +Received: from abhmt119.oracle.com (abhmt119.oracle.com [141.146.116.71]) + by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id + q3B8iEpi015631 + for ; Wed, 11 Apr 2012 03:44:14 -0500 +Received: from pub.czech.sun.com (/10.163.20.32) + by default (Oracle Beehive Gateway v4.0) + with ESMTP ; Wed, 11 Apr 2012 01:44:13 -0700 +Date: Wed, 11 Apr 2012 10:43:42 +0200 +From: Vladimir Marek +To: Notmuch Mail +Subject: Re: [PATCH 1/4] Make configure use /bin/bash instead of /bin/sh +Message-ID: <20120411084342.GL10554@pub.czech.sun.com> +Mail-Followup-To: Notmuch Mail +References: <1333966665-10469-1-git-send-email-Vladimir.Marek@oracle.com> + <1333966665-10469-2-git-send-email-Vladimir.Marek@oracle.com> + + <20120409121930.GA10554@pub.czech.sun.com> + +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8 +Content-Disposition: inline +In-Reply-To: +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Source-IP: acsinet22.oracle.com [141.146.126.238] +X-Auth-Type: Internal IP +X-CT-RefId: str=0001.0A090208.4F854460.00B6,ss=1,re=0.000,fgs=0 +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, 11 Apr 2012 08:44:18 -0000 + +Hi, + +> >> > Posix /bin/sh is not capable of running this configure and fails. +> >> +> >> What fails? What would it take to make this work on posix sh instead? +> >> +> >> The tests do require bash, but generally I think it would be preferable to +> >> not depend on bash to build. +> > +> > Well I gave it a quick stab. This is not posix: +> > +> > BLAH=$( ... ) +> > BLAH=$(( ... )) +> > ${option%=*} +> > ${option%%=*} +> > ${option#=*} +> > ${option##=*} +> +> According to +> +> http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html +> +> all of those are part of Shell Command Language... + +Hmm, you are right. The solaris /bin/sh is older revision of posix. + + + +> Does the configure script work if you replace /bin/sh with /bin/ksh +> in your Solaris box + +yes, it does work if executed by /bin/bash or /bin/ksh + + +> If yes, something like the following could be added to the beginning +> of 'configure' +> +> option=option=value +> if test ! x"${option$*=}" = x"value" 2>/dev/null; then +> if test x"${PREVENT_LOOPING-}" = x; then +> PREVENT_LOOPING=true; export PREVENT_LOOPING +> test ! -x /bin/ksh || exec /bin/ksh "$0" "$@" +> test ! -x /bin/bash || exec /bin/bash "$0" "$@" +> fi +> echo "Cannot find compatible shell for '$0'" >&2 +> exit 1 +> fi + +Unfortunately, no. The /bin/sh says "bad substitution" and does not run +the script at all. I also tried + +eval 'echo ${A%%1}'; echo ok + +but that does not run the 'echo ok' and fails also. + + +I can see three possible solutions + +1) use bash or ksh in the shebang line +2) rewrite the script as I gave the overview +3) declare that solaris 10 /bin/sh is not compatible with configure +script + + +Frankly even 3) is viable option, one just have to remember to run +'bash configure'. If everything else would work, I would be happy :) + +Thank you +-- + Vlad -- 2.26.2