git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releases

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jun 2, 2015, 20:17 UTC
Message-ID
<CAPig+cQsrxgMcK0+1jPLY8YXtNF4y17ivTUrFE8L8RS3MeffgA@mail.gmail.com>
In-Reply-To
<20150602200134.GA13382@peff.net>
On Tue, Jun 2, 2015 at 4:01 PM, Jeff King <peff@peff.net> wrote:
Show 12 quoted lines
> 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.
Show 5 quoted lines
>> 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).
Previous: Jeff KingNext: Eric Sunshine
Message 7 of 9 in “auto-detect getdelim()”
  1. 0/2 auto-detect getdelim()Eric Sunshine, Jun 2, 2015
  2. 1/2 config.mak.uname: Darwin: define HAVE_GETDELIM for modern OS X releasesEric Sunshine, Jun 2, 2015
  3. Jeff KingJun 2, 2015
  4. Jeff KingJun 2, 2015
  5. Eric SunshineJun 2, 2015
  6. Jeff KingJun 2, 2015
  7. Eric SunshineJun 2, 2015
  8. 2/2 configure: add getdelim() checkEric Sunshine, Jun 2, 2015
  9. Jeff KingJun 2, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.