From: Eric Sunshine <sunshine@sunshineco.com>
To: Jeff King <peff@peff.net>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [PATCH 1/2] config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases
Date: Tue, 2 Jun 2015 16:17:38 -0400 [thread overview]
Message-ID: <CAPig+cQsrxgMcK0+1jPLY8YXtNF4y17ivTUrFE8L8RS3MeffgA@mail.gmail.com> (raw)
In-Reply-To: <20150602200134.GA13382@peff.net>
On Tue, Jun 2, 2015 at 4:01 PM, Jeff King <peff@peff.net> wrote:
> On Tue, Jun 02, 2015 at 03:57:44PM -0400, Eric Sunshine wrote:
>
>> > Oops, I missed the trailing '.' in the regex there, and it probably
>> > needs double-quotes in case the inner expr fails to match anything.
>>
>> Which is messy considering the double quotes already surrounding
>> $(uname_R). Suggestions?
>
> The shell should do the right thing with nested quotes inside backticks.
> So just (untested):
>
> $(shell expr "`expr "$(uname_R)" : '\([0-9][0-9]*\.\)'`" '>=' 11),1)
Right. Temporary brain derailment on my part.
>> I suppose the combination of `...` with built-in 'test' and built-in
>> 'echo' would be the most efficient choice. Do you want it re-rolled?
>
> I can live with it either way. It's all pretty horrible and ugly; the
> saving grace is that we hopefully never have to touch that line again.
I'll re-roll, taking advantage of `...` and (typically, builtin)
'test' and 'echo'. This:
$(shell test "`expr "$(uname_R)" : '\([0-9][0-9]*\)\.'`" -ge 11 && echo 1)
Already tested on OS X 10.10 (Yosemite) and 10.5 (Leopard).
next prev parent reply other threads:[~2015-06-02 20:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-02 18:18 [PATCH 0/2] auto-detect getdelim() Eric Sunshine
2015-06-02 18:18 ` [PATCH 1/2] config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases Eric Sunshine
2015-06-02 18:44 ` Jeff King
2015-06-02 19:04 ` Jeff King
2015-06-02 19:57 ` Eric Sunshine
2015-06-02 20:01 ` Jeff King
2015-06-02 20:17 ` Eric Sunshine [this message]
2015-06-02 18:18 ` [PATCH 2/2] configure: add getdelim() check Eric Sunshine
2015-06-02 18:45 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAPig+cQsrxgMcK0+1jPLY8YXtNF4y17ivTUrFE8L8RS3MeffgA@mail.gmail.com \
--to=sunshine@sunshineco.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).