[PATCH 0/3] nmbug-status: add support for querying the search views
[notmuch-archives.git] / b2 / 9427d688d4612439497d3851bb46d0a88db9c9
1 Return-Path: <too@guru.guru-group.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id A5B0F431FAF\r
6         for <notmuch@notmuchmail.org>; Mon, 16 Apr 2012 08:13:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id RcbzVNATEMdz for <notmuch@notmuchmail.org>;\r
16         Mon, 16 Apr 2012 08:13:28 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
18         by olra.theworths.org (Postfix) with ESMTP id D8611431FAE\r
19         for <notmuch@notmuchmail.org>; Mon, 16 Apr 2012 08:13:27 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 6445768055; Mon, 16 Apr 2012 18:13:21 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH] configure: test shell parameter substring processing and\r
25         possibly exec one\r
26 Date: Mon, 16 Apr 2012 18:13:19 +0300\r
27 Message-Id: <1334589199-25894-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.7.6.1\r
29 Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Mon, 16 Apr 2012 15:13:28 -0000\r
43 \r
44 configure script uses parameter substring extensively. It is Posix shell\r
45 feature. Original Bourne shell does not have such features. Some systems\r
46 still ships such shells as /bin/sh (for compatibility reasons -- shell\r
47 scripts written on those platforms are expected to work in 1990's systems...)\r
48 \r
49 To tackle this situation the beginning of configure attemts to do a silent\r
50 parameter substitution in a subshell; in case this fails the subshell exits\r
51 with nonzero value which is easy to detect.\r
52 \r
53 The || constructs are used twice. The first one is used as Bourne shell\r
54 chokes on 'if ! ... ' construct (and if ...; then :; else do_things; fi\r
55 looks stupid). The second one(liner) takes care of the possible future\r
56 'set -eu' in the beginning of this script.\r
57 ---\r
58 \r
59 This patch obsoletes id:"1333966665-10469-2-git-send-email-Vladimir.Marek@oracle.com"\r
60 \r
61  configure |   14 ++++++++++++++\r
62  1 files changed, 14 insertions(+), 0 deletions(-)\r
63 \r
64 diff --git a/configure b/configure\r
65 index 71981b7..06fbeff 100755\r
66 --- a/configure\r
67 +++ b/configure\r
68 @@ -1,5 +1,19 @@\r
69  #! /bin/sh\r
70  \r
71 +# Test whether this sh is capable of parameter substring processing.\r
72 +# If not, attempt to locate and launch one which probably can.\r
73 +( option=option=value; : ${option#*=} ) 2>/dev/null || {\r
74 +    if test x"${_NOTMUCH_CONFIGURE-}" = x ; then\r
75 +       NOTMUCH_CONFIGURE=1; export _NOTMUCH_CONFIGURE\r
76 +       for x in /bin/ksh /bin/bash /usr/bin/bash\r
77 +       do test ! -x "$x" || exec "$x" "$0" "$@"\r
78 +       done\r
79 +    fi\r
80 +    echo "Cannot find compatible shell to execute '$0'" >&2\r
81 +    exit 1\r
82 +}\r
83 +unset _NOTMUCH_CONFIGURE\r
84 +\r
85  # Store original IFS value so it can be changed (and restored) in many places.\r
86  readonly DEFAULT_IFS=$IFS\r
87  \r
88 -- \r
89 1.7.8.2\r
90 \r