{"thread":{"id":"23914","subject":"installation issue when building with NO_CURL=YesPlease","startedAt":"2010-05-26T13:35:03Z","lastAt":"2010-07-06T21:56:51Z","messageCount":22,"participants":["Paul Walker","Ramkumar Ramachandra","Michael J Gruber","Dirk Süsserott","Bruce Stephens","Brandon Casey","Raja R Harinath","Johannes Sixt","Junio C Hamano","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"142366","messageId":"5B1E2CF0-4BC4-43FF-A372-EB3582DA6286@aol.com","threadId":"23914","inReplyTo":null,"subject":"installation issue when building with NO_CURL=YesPlease","fromName":"Paul Walker","fromEmail":"pwalker752@aol.com","sentAt":"2010-05-26T13:35:03Z","receivedAt":"2010-05-26T13:35:03Z","isPatch":false,"sender":{"key":"pwalker752@aol.com","avatar":null},"body":"As I could not find any bug reporting information on the wiki I  \nthought I would mention this here, please let me know if there is a  \nbetter forum for bug reports.  I believe the latest git release  \n(1.7.1.) has an installation bug when building with  \n\"NO_CURL=YesPlease\".  Looking at the Makefile line 1999 it reads\n\nfor p in $(REMOTE_CURL_ALIASES); do\n\nwhich results in \"/bin/sh: syntax error at line 1 : `;' unexpected\" as  \nREMOTE_CURL_ALIASES is empty.\n"},{"id":"142369","messageId":"4BFD290B.6050502@drmicha.warpmail.net","threadId":"23914","inReplyTo":"5B1E2CF0-4BC4-43FF-A372-EB3582DA6286@aol.com","subject":"Re: installation issue when building with NO_CURL=YesPlease","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-26T13:58:35Z","receivedAt":"2010-05-26T13:58:35Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Paul Walker venit, vidit, dixit 26.05.2010 15:35:\n> As I could not find any bug reporting information on the wiki I  \n> thought I would mention this here, please let me know if there is a  \n> better forum for bug reports.  I believe the latest git release  \n> (1.7.1.) has an installation bug when building with  \n> \"NO_CURL=YesPlease\".  Looking at the Makefile line 1999 it reads\n> \n> for p in $(REMOTE_CURL_ALIASES); do\n> \n> which results in \"/bin/sh: syntax error at line 1 : `;' unexpected\" as  \n> REMOTE_CURL_ALIASES is empty.\n\nThat seems to depend on the shell. My bash 4.1.2 doesn't care. What does\n/bin/sh --version say for you?\n\nMichael\n"},{"id":"142368","messageId":"AANLkTimsGdv-La_poLpdrvuGChD6_sAD77fcjqKn5PAd@mail.gmail.com","threadId":"23914","inReplyTo":"5B1E2CF0-4BC4-43FF-A372-EB3582DA6286@aol.com","subject":"Re: installation issue when building with NO_CURL=YesPlease","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2010-05-26T13:58:39Z","receivedAt":"2010-05-26T13:58:39Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\n> As I could not find any bug reporting information on the wiki I thought I\n> would mention this here, please let me know if there is a better forum for\n> bug reports.\n\nBugs are usually reported on this mailing list.\n\n> I believe the latest git release (1.7.1.) has an installation\n> bug when building with \"NO_CURL=YesPlease\".  Looking at the Makefile line\n> 1999 it reads\n>\n> for p in $(REMOTE_CURL_ALIASES); do\n>\n> which results in \"/bin/sh: syntax error at line 1 : `;' unexpected\" as\n> REMOTE_CURL_ALIASES is empty.\n\nI can't reproduce this. How exactly are you building? I'm using\n$ NO_CURL=YesPlease make\n... and it builds fine for me.\n\n-- Ram\n"},{"id":"142370","messageId":"8E0CE121-DB2F-4017-AB46-282562B072FB@aol.com","threadId":"23914","inReplyTo":"AANLkTimsGdv-La_poLpdrvuGChD6_sAD77fcjqKn5PAd@mail.gmail.com","subject":"Re: installation issue when building with NO_CURL=YesPlease","fromName":"Paul Walker","fromEmail":"pwalker752@aol.com","sentAt":"2010-05-26T14:15:06Z","receivedAt":"2010-05-26T14:15:06Z","isPatch":false,"sender":{"key":"pwalker752@aol.com","avatar":null},"body":"\nOn 26 May 2010, at 14:58, Ramkumar Ramachandra wrote:\n\n> Hi,\n>\n>> As I could not find any bug reporting information on the wiki I  \n>> thought I\n>> would mention this here, please let me know if there is a better  \n>> forum for\n>> bug reports.\n>\n> Bugs are usually reported on this mailing list.\n>\n>>  I believe the latest git release (1.7.1.) has an installation\n>> bug when building with \"NO_CURL=YesPlease\".  Looking at the  \n>> Makefile line\n>> 1999 it reads\n>>\n>> for p in $(REMOTE_CURL_ALIASES); do\n>>\n>> which results in \"/bin/sh: syntax error at line 1 : `;' unexpected\"  \n>> as\n>> REMOTE_CURL_ALIASES is empty.\n>\n> I can't reproduce this. How exactly are you building? I'm using\n> $ NO_CURL=YesPlease make\n> ... and it builds fine for me.\n>\n> -- Ram\n\nI used:\n\ngmake prefix=<path> NO_CURL=YesPlease NO_PYTHON=YesPlease all\n\nwhich works fine, followed by\n\ngmake prefix=<path> NO_CURL=YesPlease NO_PYTHON=YesPlease install\n\nwhich reported the above error\n"},{"id":"142371","messageId":"4f12dca01c2e72c5ba38ce5230422b394c1297d9.1274883851.git.git@drmicha.warpmail.net","threadId":"23914","inReplyTo":"8E0CE121-DB2F-4017-AB46-282562B072FB@aol.com","subject":"[PATCH] Makefile: reenable install with NO_CURL","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-05-26T14:24:34Z","receivedAt":"2010-05-26T14:24:34Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Setting NO_CURL leaves some variables like REMOTE_CURL_ALIASES\nempty, which creates no fun when for-looping over\n$(REMOTE_CURL_ALIASES) unconditionally. Make it conditional.\n\nReported-by: Paul Walker <PWalker752@aol.com>\nSigned-off-by: Michael J Gruber <git@drmicha.warpmail.net>\n---\nAgainst master but suggested for maint.\nNote that the problem occurs during \"make install\", not \"make\".\n\n Makefile |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 07cab8f..d5d6565 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2008,12 +2008,13 @@ endif\n \t\tln -s \"git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git$X\" \"$$execdir/$$p\" || exit; \\\n \t  done; } && \\\n-\t{ for p in $(REMOTE_CURL_ALIASES); do \\\n+\t{ test x\"$(REMOTE_CURL_ALIASES)\" = x || \\\n+\t\t{ for p in $(REMOTE_CURL_ALIASES); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" || exit; \\\n-\t  done; } && \\\n+\t  done; } ; } && \\\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n install-gitweb:\n-- \n1.7.1.232.g2311e.dirty\n"},{"id":"142391","messageId":"24D3B56E-0EA0-4E1C-BF42-F5BF71891F78@aol.com","threadId":"23914","inReplyTo":"4BFD290B.6050502@drmicha.warpmail.net","subject":"Re: installation issue when building with NO_CURL=YesPlease","fromName":"Paul Walker","fromEmail":"pwalker752@aol.com","sentAt":"2010-05-26T14:41:36Z","receivedAt":"2010-05-26T14:41:36Z","isPatch":false,"sender":{"key":"pwalker752@aol.com","avatar":null},"body":"\nOn 26 May 2010, at 14:58, Michael J Gruber wrote:\n\n> Paul Walker venit, vidit, dixit 26.05.2010 15:35:\n>> As I could not find any bug reporting information on the wiki I\n>> thought I would mention this here, please let me know if there is a\n>> better forum for bug reports.  I believe the latest git release\n>> (1.7.1.) has an installation bug when building with\n>> \"NO_CURL=YesPlease\".  Looking at the Makefile line 1999 it reads\n>>\n>> for p in $(REMOTE_CURL_ALIASES); do\n>>\n>> which results in \"/bin/sh: syntax error at line 1 : `;' unexpected\"  \n>> as\n>> REMOTE_CURL_ALIASES is empty.\n>\n> That seems to depend on the shell. My bash 4.1.2 doesn't care. What  \n> does\n> /bin/sh --version say for you?\n>\n> Michael\n\nI am struggling to work this out as my version of sh does not support  \nthe --version flag.\nI tried a bunch of other options provided by google with not success.\nIf it helps I believe that /bin/sh is a version of ksh that comes with  \nAIX 6.1\n"},{"id":"142387","messageId":"4BFD680E.8000603@dirk.my1.cc","threadId":"23914","inReplyTo":"8E0CE121-DB2F-4017-AB46-282562B072FB@aol.com","subject":"Re: installation issue when building with NO_CURL=YesPlease","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2010-05-26T18:27:26Z","receivedAt":"2010-05-26T18:27:26Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Am 26.05.2010 16:15 schrieb Paul Walker:\n> \n> On 26 May 2010, at 14:58, Ramkumar Ramachandra wrote:\n> \n>> Hi,\n>>\n>>> As I could not find any bug reporting information on the wiki I \n>>> thought I\n>>> would mention this here, please let me know if there is a better \n>>> forum for\n>>> bug reports.\n>>\n>> Bugs are usually reported on this mailing list.\n>>\n>>>  I believe the latest git release (1.7.1.) has an installation\n>>> bug when building with \"NO_CURL=YesPlease\".  Looking at the Makefile \n>>> line\n>>> 1999 it reads\n>>>\n>>> for p in $(REMOTE_CURL_ALIASES); do\n>>>\n>>> which results in \"/bin/sh: syntax error at line 1 : `;' unexpected\" as\n>>> REMOTE_CURL_ALIASES is empty.\n>>\n>> I can't reproduce this. How exactly are you building? I'm using\n>> $ NO_CURL=YesPlease make\n>> ... and it builds fine for me.\n>>\n>> -- Ram\n> \n> I used:\n> \n> gmake prefix=<path> NO_CURL=YesPlease NO_PYTHON=YesPlease all\n> \n> which works fine, followed by\n> \n> gmake prefix=<path> NO_CURL=YesPlease NO_PYTHON=YesPlease install\n> \n> which reported the above error\n> \n\nI had a similar problem when \"make install\"ing under AIX. Not with \nNO_CURL but with some other NO_* option. I forgot which.\nThis yealded to an empty $(REMOTE_***_ALIASES) macro \n(REMOTE_CURL_ALIASES in your case) which my AIX shell cannot handle.\n\nIt reads \"for p in; do\" which makes it unhappy. I solved my problem with \n  the SHELL_PATH environment variable (look at the first few lines in \nthe Makefile).\n\n$ SHELL_PATH=/bin/bash NO_SOMETHING=YesPlease make install\n\nthen worked fine for me.\n\nHTH,\n     Dirk\n"},{"id":"142388","messageId":"80typu1ozt.fsf@tiny.isode.net","threadId":"23914","inReplyTo":"4BFD680E.8000603@dirk.my1.cc","subject":"Re: installation issue when building with NO_CURL=YesPlease","fromName":"Bruce Stephens","fromEmail":"bruce.stephens@isode.com","sentAt":"2010-05-26T18:45:10Z","receivedAt":"2010-05-26T18:45:10Z","isPatch":false,"sender":{"key":"bruce.stephens@isode.com","avatar":null},"body":"Dirk Süsserott <newsletter@dirk.my1.cc> writes:\n\n[...]\n\n> I had a similar problem when \"make install\"ing under AIX. Not with\n> NO_CURL but with some other NO_* option. I forgot which.\n> This yealded to an empty $(REMOTE_***_ALIASES) macro\n> (REMOTE_CURL_ALIASES in your case) which my AIX shell cannot handle.\n>\n> It reads \"for p in; do\" which makes it unhappy. I solved my problem\n> with the SHELL_PATH environment variable (look at the first few lines\n> in the Makefile).\n>\n> $ SHELL_PATH=/bin/bash NO_SOMETHING=YesPlease make install\n>\n> then worked fine for me.\n\nIt wouldn't be too horrible to fix the Makefiles, though.  Doing stuff\nlike this works portably (judging by what some OpenSSL Makefiles do):\n\n\tfoo=\"$(REMOTE_CURL_ALIASES)\"; for i in $$foo; do \\\n\n[...]\n"},{"id":"142390","messageId":"4BFD7082.1080608@dirk.my1.cc","threadId":"23914","inReplyTo":"80typu1ozt.fsf@tiny.isode.net","subject":"Re: installation issue when building with NO_CURL=YesPlease","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2010-05-26T19:03:30Z","receivedAt":"2010-05-26T19:03:30Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Am 26.05.2010 20:45 schrieb Bruce Stephens:\n> Dirk Süsserott <newsletter@dirk.my1.cc> writes:\n> \n> [...]\n> \n>> I had a similar problem when \"make install\"ing under AIX. Not with\n>> NO_CURL but with some other NO_* option. I forgot which.\n>> This yealded to an empty $(REMOTE_***_ALIASES) macro\n>> (REMOTE_CURL_ALIASES in your case) which my AIX shell cannot handle.\n>>\n>> It reads \"for p in; do\" which makes it unhappy. I solved my problem\n>> with the SHELL_PATH environment variable (look at the first few lines\n>> in the Makefile).\n>>\n>> $ SHELL_PATH=/bin/bash NO_SOMETHING=YesPlease make install\n>>\n>> then worked fine for me.\n> \n> It wouldn't be too horrible to fix the Makefiles, though.  Doing stuff\n> like this works portably (judging by what some OpenSSL Makefiles do):\n> \n> \tfoo=\"$(REMOTE_CURL_ALIASES)\"; for i in $$foo; do \\\n> \n> [...]\n> \n\nBruce,\n\nI just saw that Michael posted a patch which tests for the emptyness of \nREMOTE_CURL_ALIASES. Probably that's a more convenient solution.\n\nDirk\n"},{"id":"144699","messageId":"8YdP-GcDDflOVZnykNVIGZV2ru1dwSkd6psWipKx3nNQK-C4OmEK2ZwFAj1tSIK1LUawtXDhUrxEeO95yG3lXQ@cipher.nrlssc.navy.mil","threadId":"23914","inReplyTo":"80typu1ozt.fsf@tiny.isode.net","subject":"[PATCH 1/2] Makefile: remove some unnecessary curly braces","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2010-07-02T18:50:28Z","receivedAt":"2010-07-02T18:50:28Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n Makefile |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 9aca8a1..527d872 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2079,19 +2079,19 @@ endif\n \t\ttest -z \"$(NO_CROSS_DIRECTORY_HARDLINKS)\" && \\\n \t\tln \"$$bindir/git$X\" \"$$execdir/git$X\" 2>/dev/null || \\\n \t\tcp \"$$bindir/git$X\" \"$$execdir/git$X\"; } ; } && \\\n-\t{ for p in $(BUILT_INS); do \\\n+\tfor p in $(BUILT_INS); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git$X\" \"$$execdir/$$p\" || exit; \\\n-\t  done; } && \\\n+\tdone && \\\n \t{ test x\"$(REMOTE_CURL_ALIASES)\" = x || \\\n-\t\t{ for p in $(REMOTE_CURL_ALIASES); do \\\n+\t\tfor p in $(REMOTE_CURL_ALIASES); do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" || exit; \\\n-\t  done; } ; } && \\\n+\tdone; } && \\\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n install-gitweb:\n-- \n1.7.2.rc1\n"},{"id":"144700","messageId":"8YdP-GcDDflOVZnykNVIGceOm01bqeg9PDvdgIfgqUnh29RKC-6Qi8_KBVoqLIt5iyt7g1TX5l96M5KyLrfOqg@cipher.nrlssc.navy.mil","threadId":"23914","inReplyTo":"80typu1ozt.fsf@tiny.isode.net","subject":"[PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2010-07-02T18:50:29Z","receivedAt":"2010-07-02T18:50:29Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nksh does not like it when the list argument is missing in a for loop.  This\ncan happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be unset.\nIn this case, the for loop in the Makefile expands to look like this:\n\n   for p in ; do\n\nand ksh complains like this:\n\n   /bin/ksh: syntax error at line 15 : `;' unexpected\n\nThe existing attempt to work around this issue, introduced by 70b89f87,\ntried to protect the for loop by first testing whether REMOTE_CURL_ALIASES\nwas empty, but it does not seem to work.  So adopt Bruce Stephens's\nsuggestion (which comes from OpenSSL) for working around this issue.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n Makefile |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 527d872..bc3c570 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2085,13 +2085,13 @@ endif\n \t\tln -s \"git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git$X\" \"$$execdir/$$p\" || exit; \\\n \tdone && \\\n-\t{ test x\"$(REMOTE_CURL_ALIASES)\" = x || \\\n-\t\tfor p in $(REMOTE_CURL_ALIASES); do \\\n+\tremote_curl_aliases=\"$(REMOTE_CURL_ALIASES)\" && \\\n+\tfor p in $$remote_curl_aliases; do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" || exit; \\\n-\tdone; } && \\\n+\tdone && \\\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n install-gitweb:\n-- \n1.7.2.rc1\n"},{"id":"144732","messageId":"87d3v56q6o.fsf@hariville.hurrynot.org","threadId":"23914","inReplyTo":"8YdP-GcDDflOVZnykNVIGceOm01bqeg9PDvdgIfgqUnh29RKC-6Qi8_KBVoqLIt5iyt7g1TX5l96M5KyLrfOqg@cipher.nrlssc.navy.mil","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Raja R Harinath","fromEmail":"harinath@hurrynot.org","sentAt":"2010-07-03T06:21:35Z","receivedAt":"2010-07-03T06:21:35Z","isPatch":true,"sender":{"key":"harinath@hurrynot.org","avatar":"https://avatars.githubusercontent.com/u/4610?v=4"},"body":"Hi,\n\nBrandon Casey <casey@nrlssc.navy.mil> writes:\n\n> ksh does not like it when the list argument is missing in a for loop.  This\n> can happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be unset.\n> In this case, the for loop in the Makefile expands to look like this:\n>\n>    for p in ; do\n>\n> and ksh complains like this:\n>\n>    /bin/ksh: syntax error at line 15 : `;' unexpected\n[snip]\n> -\t{ test x\"$(REMOTE_CURL_ALIASES)\" = x || \\\n> -\t\tfor p in $(REMOTE_CURL_ALIASES); do \\\n> +\tremote_curl_aliases=\"$(REMOTE_CURL_ALIASES)\" && \\\n> +\tfor p in $$remote_curl_aliases; do \\\n\nI believe the idiom\n\n  test x'$(foo)' = x || for p in ''$(foo); do\n\nworks equally well in this case, and is less invasive.\n\n- Hari\n"},{"id":"144781","messageId":"4C30D4D5.3020900@drmicha.warpmail.net","threadId":"23914","inReplyTo":"8YdP-GcDDflOVZnykNVIGceOm01bqeg9PDvdgIfgqUnh29RKC-6Qi8_KBVoqLIt5iyt7g1TX5l96M5KyLrfOqg@cipher.nrlssc.navy.mil","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-07-04T18:37:09Z","receivedAt":"2010-07-04T18:37:09Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Brandon Casey venit, vidit, dixit 02.07.2010 20:50:\n> From: Brandon Casey <drafnel@gmail.com>\n> \n> ksh does not like it when the list argument is missing in a for loop.  This\n> can happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be unset.\n> In this case, the for loop in the Makefile expands to look like this:\n> \n>    for p in ; do\n> \n> and ksh complains like this:\n> \n>    /bin/ksh: syntax error at line 15 : `;' unexpected\n> \n> The existing attempt to work around this issue, introduced by 70b89f87,\n> tried to protect the for loop by first testing whether REMOTE_CURL_ALIASES\n> was empty, but it does not seem to work.  So adopt Bruce Stephens's\n\nWhat does that mean? Either it works or it doesn't. I did work back\nthen. Does it (i.e.: the test for emtyness) fail to work for certain shells?\n\nMichael\n"},{"id":"144797","messageId":"4C31796E.9050109@viscovery.net","threadId":"23914","inReplyTo":"4C30D4D5.3020900@drmicha.warpmail.net","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-07-05T06:19:26Z","receivedAt":"2010-07-05T06:19:26Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 7/4/2010 20:37, schrieb Michael J Gruber:\n> Brandon Casey venit, vidit, dixit 02.07.2010 20:50:\n>> In this case, the for loop in the Makefile expands to look like this:\n>>\n>>    for p in ; do\n>>\n>> and ksh complains like this:\n>>\n>>    /bin/ksh: syntax error at line 15 : `;' unexpected\n>>\n>> The existing attempt to work around this issue, introduced by 70b89f87,\n>> tried to protect the for loop by first testing whether REMOTE_CURL_ALIASES\n>> was empty, but it does not seem to work.  So adopt Bruce Stephens's\n> \n> What does that mean? Either it works or it doesn't. I did work back\n> then. Does it (i.e.: the test for emtyness) fail to work for certain shells?\n\nBefore the test for emptyness can happen, the complete statement must be\nparsed, but ksh finds a syntax error in the statement and, therefore,\ncannot even begin to execute the statement. (ksh doesn't follow POSIX in\nthis regard, where this would not be a syntax error.)\n\n-- Hannes\n"},{"id":"144802","messageId":"4C319478.4070903@drmicha.warpmail.net","threadId":"23914","inReplyTo":"4C31796E.9050109@viscovery.net","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-07-05T08:14:48Z","receivedAt":"2010-07-05T08:14:48Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Johannes Sixt venit, vidit, dixit 05.07.2010 08:19:\n> Am 7/4/2010 20:37, schrieb Michael J Gruber:\n>> Brandon Casey venit, vidit, dixit 02.07.2010 20:50:\n>>> In this case, the for loop in the Makefile expands to look like this:\n>>>\n>>>    for p in ; do\n>>>\n>>> and ksh complains like this:\n>>>\n>>>    /bin/ksh: syntax error at line 15 : `;' unexpected\n>>>\n>>> The existing attempt to work around this issue, introduced by 70b89f87,\n>>> tried to protect the for loop by first testing whether REMOTE_CURL_ALIASES\n>>> was empty, but it does not seem to work.  So adopt Bruce Stephens's\n>>\n>> What does that mean? Either it works or it doesn't. I did work back\n>> then. Does it (i.e.: the test for emtyness) fail to work for certain shells?\n> \n> Before the test for emptyness can happen, the complete statement must be\n> parsed, but ksh finds a syntax error in the statement and, therefore,\n> cannot even begin to execute the statement. (ksh doesn't follow POSIX in\n> this regard, where this would not be a syntax error.)\n\nOK, thanks for clarifying. I suggest this to go into the commit message\nso that the \"does not seem to work\" is qualified.\n\nThe OP back then (before 70b89f87) used ksh on AIX 6.1, but maybe he\nleft the thread without testing. I assume Hari's suggestion works on\nksh, as well?\n\nIf we go for Brandon's version: Is there a reason for small-casing the\nvar name? It looks as if we had two different variables with different\ncase (which we don't).\n\nBTW: Is the $$var gmake specific? Has anyone tested the new version on,\nsay, AIX, not just on Linux with ksh?\n\nMichael\n"},{"id":"144805","messageId":"4C31A298.1030005@viscovery.net","threadId":"23914","inReplyTo":"4C319478.4070903@drmicha.warpmail.net","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2010-07-05T09:15:04Z","receivedAt":"2010-07-05T09:15:04Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 7/5/2010 10:14, schrieb Michael J Gruber:\n> BTW: Is the $$var gmake specific?\n\nNo. $ is a (special?) make variable that contains only a dollar sign. To\nexpand the variable in the Makefile, you have to write $$ (like for any\nother Makefile variable whose name has only a single character, like $@,\n$<, etc). As a result, you get a single dollar sign in the shell command\ntext. :-)\n\n-- Hannes\n"},{"id":"144806","messageId":"4C31A65C.7030002@drmicha.warpmail.net","threadId":"23914","inReplyTo":"4C31A298.1030005@viscovery.net","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2010-07-05T09:31:08Z","receivedAt":"2010-07-05T09:31:08Z","isPatch":true,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Johannes Sixt venit, vidit, dixit 05.07.2010 11:15:\n> Am 7/5/2010 10:14, schrieb Michael J Gruber:\n>> BTW: Is the $$var gmake specific?\n> \n> No. $ is a (special?) make variable that contains only a dollar sign. To\n> expand the variable in the Makefile, you have to write $$ (like for any\n> other Makefile variable whose name has only a single character, like $@,\n> $<, etc). As a result, you get a single dollar sign in the shell command\n> text. :-)\n\nI guess I need this in my personal tree:\n\ndiff --git a/Michael b/Michael\nindex 5318944..2ff6a75 100644\n--- a/Michael\n+++ b/Michael\n@@ -0815,2 +0815,2 @@ endif\n\n-stupid remark about lower case\n-stupid question about escaping $\n+compensate for lack of morning coffee\n+note that an empty shell var is more than nothing at all\n\nMichael\n"},{"id":"144835","messageId":"7vy6dpyeqf.fsf@alter.siamese.dyndns.org","threadId":"23914","inReplyTo":"4C31796E.9050109@viscovery.net","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-05T18:18:16Z","receivedAt":"2010-07-05T18:18:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j.sixt@viscovery.net> writes:\n\n> Before the test for emptyness can happen, the complete statement must be\n> parsed, but ksh finds a syntax error in the statement and, therefore,\n> cannot even begin to execute the statement. (ksh doesn't follow POSIX in\n> this regard, where this would not be a syntax error.)\n\nI had to stare at Brandon's patch that was essentially:\n\n-    for p in $(FOO); do echo $$p; done\n+    foo=$(FOO); for p in $$foo; do echo $$p; done\n\nand the above two doesn't look like there should be any difference; your\nexplanation makes quite a lot of sense but that's arcane.  I doubt I will\nbe able to justify and explain the latter construction without consulting\nyour message I am responsing to, if somebody asks \"why do we assign $(FOO)\nto a shell variable and then iterate over it?\" 6 months from now.\n\nIt might make sense to use $(foreach) instead of rolling our own loop in\nthe shell to avoid glitches like this.\n\n Makefile |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 9aca8a1..8bbb574 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2085,13 +2085,13 @@ endif\n \t\tln -s \"git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git$X\" \"$$execdir/$$p\" || exit; \\\n \t  done; } && \\\n-\t{ test x\"$(REMOTE_CURL_ALIASES)\" = x || \\\n-\t\t{ for p in $(REMOTE_CURL_ALIASES); do \\\n-\t\t$(RM) \"$$execdir/$$p\" && \\\n-\t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n-\t\tln -s \"git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n-\t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" || exit; \\\n-\t  done; } ; } && \\\n+\t$(foreach p,$(REMOTE_CURL_ALIASES), \\\n+\t\t{ \\\n+\t\t$(RM) \"$$execdir/$p\" && \\\n+\t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$p\" 2>/dev/null || \\\n+\t\tln -s \"git-remote-http$X\" \"$$execdir/$p\" 2>/dev/null || \\\n+\t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$p\" || exit; \\\n+\t\t} && ) : \\\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n install-gitweb:\n"},{"id":"144844","messageId":"m2hbkd66nn.fsf@igel.home","threadId":"23914","inReplyTo":"7vy6dpyeqf.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2010-07-05T20:00:12Z","receivedAt":"2010-07-05T20:00:12Z","isPatch":true,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> +\t$(foreach p,$(REMOTE_CURL_ALIASES), \\\n> +\t\t{ \\\n> +\t\t$(RM) \"$$execdir/$p\" && \\\n> +\t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$p\" 2>/dev/null || \\\n> +\t\tln -s \"git-remote-http$X\" \"$$execdir/$p\" 2>/dev/null || \\\n> +\t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$p\" || exit; \\\n> +\t\t} && ) : \\\n                       ^^\n>  \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n\nMissing && at the end of the preceding line (otherwise the last line is\neffectively commented out).\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"144849","messageId":"AANLkTin0h8DUWo3sfhRdA7NCCCPLKXfQzSDvWX7p1OPq@mail.gmail.com","threadId":"23914","inReplyTo":"7vy6dpyeqf.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Brandon Casey","fromEmail":"drafnel@gmail.com","sentAt":"2010-07-05T21:29:40Z","receivedAt":"2010-07-05T21:29:40Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"It looks like Johannes has already supplied the explanation that was\nmissing from my commit message.  Thanks.\n\n\nOn Mon, Jul 5, 2010 at 1:18 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Johannes Sixt <j.sixt@viscovery.net> writes:\n>\n>> Before the test for emptyness can happen, the complete statement must be\n>> parsed, but ksh finds a syntax error in the statement and, therefore,\n>> cannot even begin to execute the statement. (ksh doesn't follow POSIX in\n>> this regard, where this would not be a syntax error.)\n>\n> I had to stare at Brandon's patch that was essentially:\n>\n> -    for p in $(FOO); do echo $$p; done\n> +    foo=$(FOO); for p in $$foo; do echo $$p; done\n>\n> and the above two doesn't look like there should be any difference; your\n> explanation makes quite a lot of sense but that's arcane.  I doubt I will\n> be able to justify and explain the latter construction without consulting\n> your message I am responsing to, if somebody asks \"why do we assign $(FOO)\n> to a shell variable and then iterate over it?\" 6 months from now.\n>\n> It might make sense to use $(foreach) instead of rolling our own loop in\n> the shell to avoid glitches like this.\n\n$(foreach) works too.  I only avoided it because it has already caused a\nproblem once before by creating a command line that exceeded the\nmaximum argument list length on IRIX.\n\nREMOTE_CURL_ALIASES only has 3 items in it right now, and probably\nwon't grow much larger, if it grows at all, so there is little chance of\nexceeding the maximum argument list length on IRIX.  So $(foreach) is\nfine with me if you think that reads better.\n\n-Brandon\n"},{"id":"144867","messageId":"7v630t72vo.fsf@alter.siamese.dyndns.org","threadId":"23914","inReplyTo":"AANLkTin0h8DUWo3sfhRdA7NCCCPLKXfQzSDvWX7p1OPq@mail.gmail.com","subject":"Re: [PATCH 2/2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-06T02:36:27Z","receivedAt":"2010-07-06T02:36:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <drafnel@gmail.com> writes:\n\n> $(foreach) works too.  I only avoided it because it has already caused a\n> problem once before by creating a command line that exceeded the\n> maximum argument list length on IRIX.\n\nOk, fair enough.\n\n> REMOTE_CURL_ALIASES only has 3 items in it right now, and probably\n> won't grow much larger, if it grows at all, so there is little chance of\n> exceeding the maximum argument list length on IRIX.  So $(foreach) is\n> fine with me if you think that reads better.\n\nWell your patch fixes the issue, and I would actually prefer it as long as\nit is explained well ;-).\n\nThanks.\n"},{"id":"144965","messageId":"vUheaJEBKF4RpCQidVNBD1qrdnnqrcfK_TfSmMUj8l53PCm3F-faBNN2Pxk97G5Mf5GY3dVoDgwkpzK8xO7nXw@cipher.nrlssc.navy.mil","threadId":"23914","inReplyTo":"7v630t72vo.fsf@alter.siamese.dyndns.org","subject":"[PATCH 2/2 v2] Makefile: work around ksh's failure to handle missing list argument to for loop","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2010-07-06T21:56:51Z","receivedAt":"2010-07-06T21:56:51Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nksh does not like it when the list argument is missing in a 'for' loop.\nThis can happen when NO_CURL is set which causes REMOTE_CURL_ALIASES to be\nunset.  In this case, the 'for' loop in the Makefile is expanded to look\nlike this:\n\n   for p in ; do\n\nand ksh complains like this:\n\n   /bin/ksh: syntax error at line 15 : `;' unexpected\n\nThe existing attempt to work around this issue, introduced by 70b89f87,\ntried to protect the 'for' loop by first testing whether REMOTE_CURL_ALIASES\nwas empty, but this does not work since, as Johannes Sixt explains, \"Before\nthe test for emptyness can happen, the complete statement must be parsed,\nbut ksh finds a syntax error in the statement and, therefore, cannot even\nbegin to execute the statement. (ksh doesn't follow POSIX in this regard,\nwhere this would not be a syntax error.)\".\n\nMake's $(foreach) function could be used to avoid this shell glitch, but\nsince it has already caused a problem once before by generating a command\nline that exceeded the maximum argument list length on IRIX, let's adopt\nBruce Stephens's suggestion for working around this issue in the same way\nthe OpenSSL folks have done it.  This solution first assigns the contents\nof the REMOTE_CURL_ALIASES make variable to a shell variable and then\nsupplies the shell variable as the list argument in the 'for' loop.  This\nsatisfies ksh and has the expected behavior even if $(REMOTE_CURL_ALIASES)\nis empty.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n\n\nOn 07/05/2010 09:36 PM, Junio C Hamano wrote:\n> Well your patch fixes the issue, and I would actually prefer it as long as\n> it is explained well ;-).\n\nHeh, ok, hopefully this commit message does a better job.\n\n-Brandon\n\n\n Makefile |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 527d872..bc3c570 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2085,13 +2085,13 @@ endif\n \t\tln -s \"git$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git$X\" \"$$execdir/$$p\" || exit; \\\n \tdone && \\\n-\t{ test x\"$(REMOTE_CURL_ALIASES)\" = x || \\\n-\t\tfor p in $(REMOTE_CURL_ALIASES); do \\\n+\tremote_curl_aliases=\"$(REMOTE_CURL_ALIASES)\" && \\\n+\tfor p in $$remote_curl_aliases; do \\\n \t\t$(RM) \"$$execdir/$$p\" && \\\n \t\tln \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tln -s \"git-remote-http$X\" \"$$execdir/$$p\" 2>/dev/null || \\\n \t\tcp \"$$execdir/git-remote-http$X\" \"$$execdir/$$p\" || exit; \\\n-\tdone; } && \\\n+\tdone && \\\n \t./check_bindir \"z$$bindir\" \"z$$execdir\" \"$$bindir/git-add$X\"\n \n install-gitweb:\n-- \n1.7.2.rc1\n"}]}