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
Jeff King <peff@peff.net>
Date
Jun 2, 2015, 18:44 UTC
Message-ID
<20150602184413.GA11437@peff.net>
In-Reply-To
<1433269138-10890-2-git-send-email-sunshine@sunshineco.com>
On Tue, Jun 02, 2015 at 02:18:57PM -0400, Eric Sunshine wrote:
Show 10 quoted lines
> The use of 'expr' in this new test is decidedly different from existing
> instances which merely check if `uname -R` matches a particular single
> digit and a period. If the new test took the same approach, it would
> have to match either one digit (in a particular range) plus a period, or
> two digits with the first being "1", plus a period. The resulting 'expr'
> expression quickly becomes ugly and quite difficult to decipher. Hence,
> the new test instead takes advantage of expr's relational operator '>='
> to keep things simple and make the test easy to understand at a glance
> ("if version >= 11" where 11 is the Darwin major version number of OS X
> 10.7).

I think that is OK with respect to portability; we are already inside a $(uname_S) check, so we know we are on some form of Mac OS. But...

> +	ifeq ($(shell expr $(shell expr "$(uname_R)" : '\([0-9][0-9]*\)\.') '>=' 11),1)
Do you need to spawn two shells? It seems like:
  $(shell expr `expr "$(uname_R)" : '\([0-9][0-9]*\)'` '>=' 11),1)
should do the same thing.
-Peff
Previous: Eric SunshineNext: Jeff King
Message 3 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.