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

Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Jul 5, 2010, 08:14 UTC
Message-ID
<4C319478.4070903@drmicha.warpmail.net>
In-Reply-To
<4C31796E.9050109@viscovery.net>
Johannes Sixt venit, vidit, dixit 05.07.2010 08:19:
Show 21 quoted lines
> Am 7/4/2010 20:37, schrieb Michael J Gruber:
>> Brandon Casey venit, vidit, dixit 02.07.2010 20:50:
>>> In this case, the for loop in the Makefile expands to look like this:
>>>
>>>    for p in ; do
>>>
>>> and ksh complains like this:
>>>
>>>    /bin/ksh: syntax error at line 15 : `;' unexpected
>>>
>>> The existing attempt to work around this issue, introduced by 70b89f87,
>>> tried to protect the for loop by first testing whether REMOTE_CURL_ALIASES
>>> was empty, but it does not seem to work.  So adopt Bruce Stephens's
>>
>> What does that mean? Either it works or it doesn't. I did work back
>> then. Does it (i.e.: the test for emtyness) fail to work for certain shells?
> 
> Before the test for emptyness can happen, the complete statement must be
> parsed, but ksh finds a syntax error in the statement and, therefore,
> cannot even begin to execute the statement. (ksh doesn't follow POSIX in
> this regard, where this would not be a syntax error.)

OK, thanks for clarifying. I suggest this to go into the commit message so that the "does not seem to work" is qualified.

The OP back then (before 70b89f87) used ksh on AIX 6.1, but maybe he left the thread without testing. I assume Hari's suggestion works on ksh, as well?

If we go for Brandon's version: Is there a reason for small-casing the var name? It looks as if we had two different variables with different case (which we don't).

BTW: Is the $$var gmake specific? Has anyone tested the new version on,
say, AIX, not just on Linux with ksh?
Michael
Previous: Johannes SixtNext: Johannes Sixt
Message 15 of 22 in “installation issue when building with NO_CURL=YesPlease”
  1. Paul WalkerMay 26, 2010
  2. Michael J GruberMay 26, 2010
  3. Paul WalkerMay 26, 2010
  4. Ramkumar RamachandraMay 26, 2010
  5. Paul WalkerMay 26, 2010
  6. Makefile: reenable install with NO_CURLMichael J Gruber, May 26, 2010
  7. Dirk SüsserottMay 26, 2010
  8. Bruce StephensMay 26, 2010
  9. Dirk SüsserottMay 26, 2010
  10. 1/2 Makefile: remove some unnecessary curly bracesBrandon Casey, Jul 2, 2010
  11. 2/2 Makefile: work around ksh's failure to handle missing list argument to for loopBrandon Casey, Jul 2, 2010
  12. Raja R HarinathJul 3, 2010
  13. Michael J GruberJul 4, 2010
  14. Johannes SixtJul 5, 2010
  15. Michael J GruberJul 5, 2010
  16. Johannes SixtJul 5, 2010
  17. Michael J GruberJul 5, 2010
  18. Junio C HamanoJul 5, 2010
  19. Andreas SchwabJul 5, 2010
  20. Brandon CaseyJul 5, 2010
  21. Junio C HamanoJul 6, 2010
  22. 2/2 Makefile: work around ksh's failure to handle missing list argument to for loopBrandon Casey, Jul 6, 2010

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.