[PATCH] configure: check whether shell is capable of parameter substring processing
authorTomi Ollila <tomi.ollila@iki.fi>
Thu, 3 May 2012 18:59:58 +0000 (21:59 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:53 +0000 (09:46 -0800)
98/b20be5639be7346a6bf4830b5afd5bc7a60c1b [new file with mode: 0644]

diff --git a/98/b20be5639be7346a6bf4830b5afd5bc7a60c1b b/98/b20be5639be7346a6bf4830b5afd5bc7a60c1b
new file mode 100644 (file)
index 0000000..f88af27
--- /dev/null
@@ -0,0 +1,98 @@
+Return-Path: <too@guru.guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D1FE3431FBC\r
+       for <notmuch@notmuchmail.org>; Thu,  3 May 2012 12:00:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id D9-xk2YHbbUk for <notmuch@notmuchmail.org>;\r
+       Thu,  3 May 2012 12:00:07 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7637D431FB6\r
+       for <notmuch@notmuchmail.org>; Thu,  3 May 2012 12:00:07 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id A9A5568057; Thu,  3 May 2012 22:00:00 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] configure: check whether shell is capable of parameter\r
+       substring processing\r
+Date: Thu,  3 May 2012 21:59:58 +0300\r
+Message-Id: <1336071598-18930-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.6.1\r
+In-Reply-To: <1334589199-25894-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1334589199-25894-1-git-send-email-tomi.ollila@iki.fi>\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 03 May 2012 19:00:09 -0000\r
+\r
+'configure' script uses parameter substring extensively. It is Posix shell\r
+feature. Original Bourne shell does not have such features. Some systems\r
+still ships such shells as /bin/sh (for compatibility reasons -- shell\r
+scripts written on those platforms are expected to work on 1990's systems).\r
+\r
+Just testing whether parameter substring processing works will make the\r
+shell exit due to syntax error if it is not compatible. Therefore the test\r
+is executed in a subshell -- subshell exits with nonzero value when the\r
+operation in question fails.\r
+\r
+As 'if ! ...' does not work in Bourne shell, Short-circuiting construct\r
+'||' is used to print information message and exit when expected.\r
+---\r
+This is now based on last short talk on IRC. Anyone good with words\r
+care to comment on text content ? :)\r
+\r
+This patch obsoletes:\r
+\r
+id:"1334643263-30207-1-git-send-email-tomi.ollila@iki.fi" , \r
+id:"1334589199-25894-1-git-send-email-tomi.ollila@iki.fi"\r
+and\r
+id:"1333966665-10469-2-git-send-email-Vladimir.Marek@oracle.com"\r
+\r
+ configure |   14 ++++++++++++++\r
+ 1 files changed, 14 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/configure b/configure\r
+index 71981b7..7a13102 100755\r
+--- a/configure\r
++++ b/configure\r
+@@ -1,5 +1,19 @@\r
+ #! /bin/sh\r
+ \r
++# Test whether this shell is capable of parameter substring processing.\r
++( option='a/b'; : ${option#*/} ) 2>/dev/null || {\r
++    echo "\r
++The shell interpreting '$0' is lacking some required features.\r
++\r
++To work around this problem you may try to execute:\r
++\r
++    ksh $0 $*\r
++ or\r
++    bash $0 $*\r
++"\r
++    exit 1\r
++}\r
++\r
+ # Store original IFS value so it can be changed (and restored) in many places.\r
+ readonly DEFAULT_IFS=$IFS\r
+ \r
+-- \r
+1.7.8.2\r
+\r