Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 30 / 25bd4b41b70af53c58a4e749500d397db051b8
1 Return-Path: <tomi.ollila@iki.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 6AE89431FAF\r
6         for <notmuch@notmuchmail.org>; Wed, 11 Apr 2012 11:47:38 -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 ObFShJJbQywQ for <notmuch@notmuchmail.org>;\r
16         Wed, 11 Apr 2012 11:47:37 -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 31974431FAE\r
19         for <notmuch@notmuchmail.org>; Wed, 11 Apr 2012 11:47:37 -0700 (PDT)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id B744F68055; Wed, 11 Apr 2012 21:47:32 +0300 (EEST)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: Vladimir Marek <Vladimir.Marek@Oracle.COM>,\r
24         Notmuch Mail <notmuch@notmuchmail.org>\r
25 Subject: Re: [PATCH 1/4] Make configure use /bin/bash instead of /bin/sh\r
26 In-Reply-To: <20120411084342.GL10554@pub.czech.sun.com>\r
27 References: <1333966665-10469-1-git-send-email-Vladimir.Marek@oracle.com>\r
28         <1333966665-10469-2-git-send-email-Vladimir.Marek@oracle.com>\r
29         <CAB+hUn9eVVBN7xzMSUT6kB2+MNn8H6KoKuxGDOwck0sgp9qgmw@mail.gmail.com>\r
30         <20120409121930.GA10554@pub.czech.sun.com>\r
31         <m2ehrv4hx2.fsf@guru.guru-group.fi>\r
32         <20120411084342.GL10554@pub.czech.sun.com>User-Agent:\r
33         Notmuch/0.12+77~gee11800 (http://notmuchmail.org) Emacs/23.3.1\r
34         (x86_64-unknown-linux-gnu)\r
35 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
36         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
37         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
38 Date: Wed, 11 Apr 2012 21:47:32 +0300\r
39 Message-ID: <m2wr5mm7gb.fsf@guru.guru-group.fi>\r
40 MIME-Version: 1.0\r
41 Content-Type: text/plain; charset=us-ascii\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Wed, 11 Apr 2012 18:47:38 -0000\r
55 \r
56 On Wed, Apr 11 2012, Vladimir Marek <Vladimir.Marek@Oracle.COM> wrote:\r
57 \r
58 > Hi,\r
59 >\r
60 \r
61 [ ... ]\r
62 \r
63 >\r
64 >> Does the configure script work if you replace /bin/sh with /bin/ksh\r
65 >> in your Solaris box\r
66 >\r
67 > yes, it does work if executed by /bin/bash or /bin/ksh\r
68 >\r
69 >\r
70 >> If yes, something like the following could be added to the beginning\r
71 >> of 'configure'\r
72 >> \r
73 >> option=option=value\r
74 >> if test ! x"${option$*=}" = x"value" 2>/dev/null; then\r
75 >>      if test x"${PREVENT_LOOPING-}" = x; then\r
76 >>              PREVENT_LOOPING=true; export PREVENT_LOOPING\r
77 >>                 test ! -x /bin/ksh || exec /bin/ksh "$0" "$@"\r
78 >>                 test ! -x /bin/bash || exec /bin/bash "$0" "$@"\r
79 >>         fi\r
80 >>         echo "Cannot find compatible shell for '$0'" >&2\r
81 >>         exit 1\r
82 >> fi\r
83 >\r
84 > Unfortunately, no. The /bin/sh says "bad substitution" and does not run\r
85 > the script at all. I also tried\r
86 >\r
87 > eval 'echo ${A%%1}'; echo ok\r
88 >\r
89 > but that does not run the 'echo ok' and fails also.\r
90 \r
91 You're right! I tested this stuff using heirloom-sh\r
92 from http://heirloom.sourceforge.net/sh.html\r
93 \r
94 It is interesting that the shell stops executing when \r
95 it finds this syntax (instead of contnuing, even without -e)\r
96 \r
97 > I can see three possible solutions\r
98 >\r
99 > 1) use bash or ksh in the shebang line\r
100 \r
101 Cannot do there are systems lacking /bin/bash & /bin/ksh\r
102 \r
103 > 2) rewrite the script as I gave the overview\r
104 \r
105 Some work todo; case construct can do option key matching to get \r
106 identical interface and then cut or sed to get just option value.\r
107 \r
108 > 3) declare that solaris 10 /bin/sh is not compatible with configure\r
109 > script\r
110 >\r
111 > Frankly even 3) is viable option, one just have to remember to run\r
112 > 'bash configure'. If everything else would work, I would be happy :)\r
113 \r
114 Option 4) use the following heuristics:\r
115 \r
116 case ~ in '~')\r
117         if test x"${PREVENT_LOOPING-}" = x; then\r
118                 PREVENT_LOOPING=true; export PREVENT_LOOPING\r
119                 for x in /bin/ksh /bin/bash /usr/bin/bash\r
120                 do test ! -x "$x" || exec "$x" "$0" "$@"\r
121                 done\r
122         fi\r
123         echo "Cannot find compatible shell for '$0'" >&2\r
124         exit 1\r
125 esac\r
126 \r
127 i.e. if tilde expansion is not done guess this shell is not \r
128 compatible enough\r
129 \r
130 Option 5) do substitution check in subshell:\r
131 \r
132 ( option=option=value; : ${option$*=} ) 2>/dev/null || {\r
133         if test x"${PREVENT_LOOPING-}" = x; then\r
134                 PREVENT_LOOPING=true; export PREVENT_LOOPING\r
135                 for x in /bin/ksh /bin/bash /usr/bin/bash\r
136                 do test ! -x "$x" || exec "$x" "$0" "$@"\r
137                 done\r
138         fi\r
139         echo "Cannot find compatible shell for '$0'" >&2\r
140         exit 1\r
141 }\r
142 \r
143 >\r
144 > Thank you\r
145 > -- \r
146 >       Vlad\r
147 \r
148 Tomi\r