{"thread":{"id":"26787","subject":"[PATCH] repack: find -> /usr/bin/find, as for cygwin","startedAt":"2011-03-19T12:08:04Z","lastAt":"2011-03-21T09:36:06Z","messageCount":14,"participants":["ryenus ◇","Nguyen Thai Ngoc Duy","René Scharfe","Junio C Hamano","Matthieu Moy","Erik Faye-Lund"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"163741","messageId":"AANLkTimHof_MNSGbU2KGX=7Q3MQpjkzXK+xyGGVjbngR@mail.gmail.com","threadId":"26787","inReplyTo":null,"subject":"[PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"ryenus ◇","fromEmail":"ryenus@gmail.com","sentAt":"2011-03-19T12:08:04Z","receivedAt":"2011-03-19T12:08:04Z","isPatch":true,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"If I run Cygwin git directly from cmd.exe instead of from a shell,\ne.g. bash, I get the following error when executing git repack\n\nFIND: Parameter format not correct\n\nthat's because in git-repack.sh, 'find' is called without its full\npath, this patch corrects this\n\nSigned-off-by: ryenus <ryenus@gmail.com>\n---\n git-repack.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-repack.sh b/git-repack.sh\nindex 624feec..212caa7 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -64,7 +64,7 @@ case \",$all_into_one,\" in\n ,t,)\n        args= existing=\n        if [ -d \"$PACKDIR\" ]; then\n-               for e in `cd \"$PACKDIR\" && find . -type f -name '*.pack' \\\n+               for e in `cd \"$PACKDIR\" && /usr/bin/find . -type f\n-name '*.pack' \\\n                        | sed -e 's/^\\.\\///' -e 's/\\.pack$//'`\n                do\n                        if [ -e \"$PACKDIR/$e.keep\" ]; then\n--\n1.7.4\n"},{"id":"163742","messageId":"AANLkTimPbz2s=Maafhqg-7wOk_TT4fFSh7AQ-3rWY0A3@mail.gmail.com","threadId":"26787","inReplyTo":"AANLkTimHof_MNSGbU2KGX=7Q3MQpjkzXK+xyGGVjbngR@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-03-19T12:18:52Z","receivedAt":"2011-03-19T12:18:52Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Mar 19, 2011 at 7:08 PM, ryenus ◇ <ryenus@gmail.com> wrote:\n> -               for e in `cd \"$PACKDIR\" && find . -type f -name '*.pack' \\\n> +               for e in `cd \"$PACKDIR\" && /usr/bin/find . -type f\n\nI'd rather have something like in test-lib.sh (with conditions)\n\nfind() {\n/usr/bin/find \"$@\"\n}\n\nEven better, rewrite this script to C.\n-- \nDuy\n"},{"id":"163756","messageId":"4D84D0C0.7080808@lsrfire.ath.cx","threadId":"26787","inReplyTo":"AANLkTimPbz2s=Maafhqg-7wOk_TT4fFSh7AQ-3rWY0A3@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"René Scharfe","fromEmail":"rene.scharfe@lsrfire.ath.cx","sentAt":"2011-03-19T15:50:24Z","receivedAt":"2011-03-19T15:50:24Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 19.03.2011 13:18, schrieb Nguyen Thai Ngoc Duy:\n> On Sat, Mar 19, 2011 at 7:08 PM, ryenus ◇<ryenus@gmail.com>  wrote:\n>> -               for e in `cd \"$PACKDIR\"&&  find . -type f -name '*.pack' \\\n>> +               for e in `cd \"$PACKDIR\"&&  /usr/bin/find . -type f\n> \n> I'd rather have something like in test-lib.sh (with conditions)\n> \n> find() {\n> /usr/bin/find \"$@\"\n> }\n> \n> Even better, rewrite this script to C.\n\nThat's a good idea, but it's a lot more involved than the original\npatch.\n\nDo we need to support pack files in subdirectories of $PACKDIR?  If\nnot -- and I don't immediately see why, except that the current code\ndoes with its find call -- then the following patch might be a quick\nbandaid.  Untested, please be careful.\n\nRené\n\n\n git-repack.sh |   19 ++++++++++---------\n 1 files changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/git-repack.sh b/git-repack.sh\nindex 624feec..4e49079 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -64,15 +64,16 @@ case \",$all_into_one,\" in\n ,t,)\n \targs= existing=\n \tif [ -d \"$PACKDIR\" ]; then\n-\t\tfor e in `cd \"$PACKDIR\" && find . -type f -name '*.pack' \\\n-\t\t\t| sed -e 's/^\\.\\///' -e 's/\\.pack$//'`\n-\t\tdo\n-\t\t\tif [ -e \"$PACKDIR/$e.keep\" ]; then\n-\t\t\t\t: keep\n-\t\t\telse\n-\t\t\t\texisting=\"$existing $e\"\n-\t\t\tfi\n-\t\tdone\n+\t\texisting=$(\n+\t\t\tcd \"$PACKDIR\" &&\n+\t\t\tfor e in *.pack\n+\t\t\tdo\n+\t\t\t\tif test -f \"$e\" -a ! -e \"${e%.pack}.keep\"\n+\t\t\t\tthen\n+\t\t\t\t\techo \"${e%.pack}\"\n+\t\t\t\tfi\n+\t\t\tdone\n+\t\t)\n \t\tif test -n \"$existing\" -a -n \"$unpack_unreachable\" -a \\\n \t\t\t-n \"$remove_redundant\"\n \t\tthen\n"},{"id":"163758","messageId":"20110319160754.GA5871@do","threadId":"26787","inReplyTo":"4D84D0C0.7080808@lsrfire.ath.cx","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-03-19T16:07:54Z","receivedAt":"2011-03-19T16:07:54Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Mar 19, 2011 at 04:50:24PM +0100, René Scharfe wrote:\n> Do we need to support pack files in subdirectories of $PACKDIR?  If\n> not -- and I don't immediately see why, except that the current code\n> does with its find call -- then the following patch might be a quick\n> bandaid.  Untested, please be careful.\n\nI looked at test-lib.sh but forgot git-sh-setup.sh, which does\naliasing for find in MINGW build. With your patch, the last use of\nfind is gone. So we might as well do this\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex aa16b83..e891edc 100644\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -232,9 +232,6 @@ case $(uname -s) in\n \tsort () {\n \t\t/usr/bin/sort \"$@\"\n \t}\n-\tfind () {\n-\t\t/usr/bin/find \"$@\"\n-\t}\n \tis_absolute_path () {\n \t\tcase \"$1\" in\n \t\t[/\\\\]* | [A-Za-z]:*)\n\n-- \nDuy\n"},{"id":"163760","messageId":"AANLkTinncw6GSLf3QvxjqKoaqesH9SWxrn5TENnHDj4Y@mail.gmail.com","threadId":"26787","inReplyTo":"20110319160754.GA5871@do","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-03-19T16:15:30Z","receivedAt":"2011-03-19T16:15:30Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Mar 19, 2011 at 11:07 PM, Nguyen Thai Ngoc Duy\n<pclouds@gmail.com> wrote:\n> I looked at test-lib.sh but forgot git-sh-setup.sh, which does\n> aliasing for find in MINGW build. With your patch, the last use of\n> find is gone. So we might as well do this\n>\n> -       find () {\n> -               /usr/bin/find \"$@\"\n> -       }\n\nOn second thought, no. We probably need to do an unconditional alias\n\nfind() {\n    die \"find is not supported\"\n}\n\nto make sure no one will ever use it again.\n-- \nDuy\n"},{"id":"163762","messageId":"AANLkTinxyp=PbvzRkyyxXin5aOFm1NP4Be6U2Dv0aD6d@mail.gmail.com","threadId":"26787","inReplyTo":"AANLkTimPbz2s=Maafhqg-7wOk_TT4fFSh7AQ-3rWY0A3@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"ryenus ◇","fromEmail":"ryenus@gmail.com","sentAt":"2011-03-19T16:32:47Z","receivedAt":"2011-03-19T16:32:47Z","isPatch":true,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"Thank you, Duy, you're almost right, I just checked git-sh-setup.sh,\nin the bottom, sort and find are defined as functions like what you\npointed out, but only for MinGW, therefore a better fix is to check\nfor cygwin as well:\n\n---\n git-sh-setup.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-sh-setup.sh b/git-sh-setup.sh\nindex aa16b83..5c52ae4 100644\n--- a/git-sh-setup.sh\n+++ b/git-sh-setup.sh\n@@ -227,7 +227,7 @@ fi\n\n # Fix some commands on Windows\n case $(uname -s) in\n-*MINGW*)\n+*MINGW*|*CYGWIN*)\n        # Windows has its own (incompatible) sort and find\n        sort () {\n                /usr/bin/sort \"$@\"\n--\n1.7.4\n"},{"id":"163763","messageId":"AANLkTi=EQhtOM3dR8V5dxP=AfNxWuSFoTbvzL36q3rXL@mail.gmail.com","threadId":"26787","inReplyTo":"AANLkTinxyp=PbvzRkyyxXin5aOFm1NP4Be6U2Dv0aD6d@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"ryenus ◇","fromEmail":"ryenus@gmail.com","sentAt":"2011-03-19T16:43:23Z","receivedAt":"2011-03-19T16:43:23Z","isPatch":true,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"OK, I've been away for a while and didn't notice latest replies :-) do\nyou mean find is not used elsewhere in git?\n\nAnyway, looks like checking for both MinGW and Cygwin still applies.\n\nThanks\n\nOn Sun, Mar 20, 2011 at 00:32, ryenus ◇ <ryenus@gmail.com> wrote:\n> Thank you, Duy, you're almost right, I just checked git-sh-setup.sh,\n> in the bottom, sort and find are defined as functions like what you\n> pointed out, but only for MinGW, therefore a better fix is to check\n> for cygwin as well:\n>\n> ---\n>  git-sh-setup.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n> index aa16b83..5c52ae4 100644\n> --- a/git-sh-setup.sh\n> +++ b/git-sh-setup.sh\n> @@ -227,7 +227,7 @@ fi\n>\n>  # Fix some commands on Windows\n>  case $(uname -s) in\n> -*MINGW*)\n> +*MINGW*|*CYGWIN*)\n>        # Windows has its own (incompatible) sort and find\n>        sort () {\n>                /usr/bin/sort \"$@\"\n> --\n> 1.7.4\n>\n"},{"id":"163765","messageId":"AANLkTi=iMZWTG8DJWSrkjzNR6FFkc_mo_epQLNfkwZiV@mail.gmail.com","threadId":"26787","inReplyTo":"AANLkTi=EQhtOM3dR8V5dxP=AfNxWuSFoTbvzL36q3rXL@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2011-03-19T16:47:33Z","receivedAt":"2011-03-19T16:47:33Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Mar 19, 2011 at 11:43 PM, ryenus ◇ <ryenus@gmail.com> wrote:\n> OK, I've been away for a while and didn't notice latest replies :-) do\n> you mean find is not used elsewhere in git?\n\nThat's what 'git grep find *.sh' told me. Anyway I suppose our\ntestsuites cover all commands quite good so we would notice if any\nother commands still use 'find'.\n\n> Anyway, looks like checking for both MinGW and Cygwin still applies.\n\nI don't use cygwin so I don't know if cygwin users are happy with\nthat. But it looks ok (unless some users decide to move find to\nanother place)\n-- \nDuy\n"},{"id":"163768","messageId":"7vsjujq8kf.fsf@alter.siamese.dyndns.org","threadId":"26787","inReplyTo":"AANLkTinxyp=PbvzRkyyxXin5aOFm1NP4Be6U2Dv0aD6d@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2011-03-19T18:17:04Z","receivedAt":"2011-03-19T18:17:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"ryenus ◇ <ryenus@gmail.com> writes:\n\n> Thank you, Duy, you're almost right, I just checked git-sh-setup.sh,\n> in the bottom, sort and find are defined as functions like what you\n> pointed out, but only for MinGW, therefore a better fix is to check\n> for cygwin as well:\n>\n> ---\n>  git-sh-setup.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n> index aa16b83..5c52ae4 100644\n> --- a/git-sh-setup.sh\n> +++ b/git-sh-setup.sh\n> @@ -227,7 +227,7 @@ fi\n>\n>  # Fix some commands on Windows\n>  case $(uname -s) in\n> -*MINGW*)\n> +*MINGW*|*CYGWIN*)\n\nThis looks like a more sensible alternative than forbidding the use of\n\"find\", privided if the new pattern is an appropriate one to catch cygwin.\n\nI don't have any Windows boxes, so I cannot verify, but the patch smells\ncorrect.\n"},{"id":"163794","messageId":"AANLkTinPCeg3NU2bRvk8rwWSWnu4b0PHwya9+PWAc3DB@mail.gmail.com","threadId":"26787","inReplyTo":"7vsjujq8kf.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"ryenus ◇","fromEmail":"ryenus@gmail.com","sentAt":"2011-03-20T00:31:38Z","receivedAt":"2011-03-20T00:31:38Z","isPatch":true,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"I'm not sure if there's a set of tests for Cygwin/MinGW among all the\ntest cases in GIT, here is a simple one:\n\n#!/bin/sh\necho $(uname -s)\ncase $(uname -s) in\n*MINGW*|*CYGWIN*)\n  echo \"detected MinGW/Cygwin\"\n  ;;\n*MinGW*)\n  echo \"detected MinGW\"\n  ;;\n*Cygwin*)\n  echo \"detected Cygwin\"\n  ;;\nesac\n\nRun with dash, the output is\n\nCYGWIN_NT-6.1\ndetected MinGW/Cygwin\n\nWhile I don't have MinGW, so someone has it please give it a shot.\n\nThanks\n\n2011/3/20 Junio C Hamano <gitster@pobox.com>:\n> ryenus ◇ <ryenus@gmail.com> writes:\n>\n>> Thank you, Duy, you're almost right, I just checked git-sh-setup.sh,\n>> in the bottom, sort and find are defined as functions like what you\n>> pointed out, but only for MinGW, therefore a better fix is to check\n>> for cygwin as well:\n>>\n>> ---\n>>  git-sh-setup.sh |    2 +-\n>>  1 files changed, 1 insertions(+), 1 deletions(-)\n>>\n>> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n>> index aa16b83..5c52ae4 100644\n>> --- a/git-sh-setup.sh\n>> +++ b/git-sh-setup.sh\n>> @@ -227,7 +227,7 @@ fi\n>>\n>>  # Fix some commands on Windows\n>>  case $(uname -s) in\n>> -*MINGW*)\n>> +*MINGW*|*CYGWIN*)\n>\n> This looks like a more sensible alternative than forbidding the use of\n> \"find\", privided if the new pattern is an appropriate one to catch cygwin.\n>\n> I don't have any Windows boxes, so I cannot verify, but the patch smells\n> correct.\n>\n>\n>\n"},{"id":"163796","messageId":"AANLkTinFFnm7-TKcbTdbzJHx4i4L8rdi4xogr3R7=7s1@mail.gmail.com","threadId":"26787","inReplyTo":"AANLkTinPCeg3NU2bRvk8rwWSWnu4b0PHwya9+PWAc3DB@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"ryenus ◇","fromEmail":"ryenus@gmail.com","sentAt":"2011-03-20T00:35:51Z","receivedAt":"2011-03-20T00:35:51Z","isPatch":true,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"oops, corrected the script with the test strings in upper cases\n\n#!/bin/sh\necho $(uname -s)\ncase $(uname -s) in\n*MINGW*|*CYGWIN*)\n  echo \"detected MinGW/Cygwin\"\n  ;;\n*MINGW*)\n  echo \"detected MinGW\"\n  ;;\n*CYGWIN*)\n  echo \"detected Cygwin\"\n  ;;\nesac\n\n\nOn Sun, Mar 20, 2011 at 08:31, ryenus ◇ <ryenus@gmail.com> wrote:\n> I'm not sure if there's a set of tests for Cygwin/MinGW among all the\n> test cases in GIT, here is a simple one:\n>\n> #!/bin/sh\n> echo $(uname -s)\n> case $(uname -s) in\n> *MINGW*|*CYGWIN*)\n>  echo \"detected MinGW/Cygwin\"\n>  ;;\n> *MinGW*)\n>  echo \"detected MinGW\"\n>  ;;\n> *Cygwin*)\n>  echo \"detected Cygwin\"\n>  ;;\n> esac\n>\n> Run with dash, the output is\n>\n> CYGWIN_NT-6.1\n> detected MinGW/Cygwin\n>\n> While I don't have MinGW, so someone has it please give it a shot.\n>\n> Thanks\n>\n> 2011/3/20 Junio C Hamano <gitster@pobox.com>:\n>> ryenus ◇ <ryenus@gmail.com> writes:\n>>\n>>> Thank you, Duy, you're almost right, I just checked git-sh-setup.sh,\n>>> in the bottom, sort and find are defined as functions like what you\n>>> pointed out, but only for MinGW, therefore a better fix is to check\n>>> for cygwin as well:\n>>>\n>>> ---\n>>>  git-sh-setup.sh |    2 +-\n>>>  1 files changed, 1 insertions(+), 1 deletions(-)\n>>>\n>>> diff --git a/git-sh-setup.sh b/git-sh-setup.sh\n>>> index aa16b83..5c52ae4 100644\n>>> --- a/git-sh-setup.sh\n>>> +++ b/git-sh-setup.sh\n>>> @@ -227,7 +227,7 @@ fi\n>>>\n>>>  # Fix some commands on Windows\n>>>  case $(uname -s) in\n>>> -*MINGW*)\n>>> +*MINGW*|*CYGWIN*)\n>>\n>> This looks like a more sensible alternative than forbidding the use of\n>> \"find\", privided if the new pattern is an appropriate one to catch cygwin.\n>>\n>> I don't have any Windows boxes, so I cannot verify, but the patch smells\n>> correct.\n>>\n>>\n>>\n>\n"},{"id":"163804","messageId":"vpqlj0ajkqa.fsf@bauges.imag.fr","threadId":"26787","inReplyTo":"AANLkTinFFnm7-TKcbTdbzJHx4i4L8rdi4xogr3R7=7s1@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2011-03-20T07:48:29Z","receivedAt":"2011-03-20T07:48:29Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"ryenus ◇ <ryenus@gmail.com> writes:\n\n> oops, corrected the script with the test strings in upper cases\n>\n> #!/bin/sh\n> echo $(uname -s)\n> case $(uname -s) in\n> *MINGW*|*CYGWIN*)\n         ^\nThis \"|\" means \"or\" in a case statement...\n\n>   echo \"detected MinGW/Cygwin\"\n>   ;;\n> *MINGW*)\n\n...so I can see no way to reach this point: if the string matches\n*MINGW*, it also matches *MINGW*|*CYGWIN*.\n\n>   echo \"detected MinGW\"\n>   ;;\n> *CYGWIN*)\n>   echo \"detected Cygwin\"\n>   ;;\n> esac\n\nBut you've just showed that $(uname -s) of Cygwin did contain upper-case\nCYGWIN, which I think was the point to verify :-).\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"163806","messageId":"AANLkTim+sijuHidJNWyqC75yTFVo0YX67J3AXnPJVsoc@mail.gmail.com","threadId":"26787","inReplyTo":"vpqlj0ajkqa.fsf@bauges.imag.fr","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"ryenus ◇","fromEmail":"ryenus@gmail.com","sentAt":"2011-03-20T08:42:20Z","receivedAt":"2011-03-20T08:42:20Z","isPatch":true,"sender":{"key":"ryenus@gmail.com","avatar":"https://avatars.githubusercontent.com/u/610161?v=4"},"body":"Hey Matthieu,\n\nYes, I mean it.\n\nThe purpose of this test script is to testify that \"*MINGW*|*CYGWIN*\"\nwill match MinGW and/or Cygwin, so that it won't fall down to the next\n2 cases.\n\n\nOn Sun, Mar 20, 2011 at 15:48, Matthieu Moy\n<Matthieu.Moy@grenoble-inp.fr> wrote:\n> ryenus ◇ <ryenus@gmail.com> writes:\n>\n>> oops, corrected the script with the test strings in upper cases\n>>\n>> #!/bin/sh\n>> echo $(uname -s)\n>> case $(uname -s) in\n>> *MINGW*|*CYGWIN*)\n>         ^\n> This \"|\" means \"or\" in a case statement...\n>\n>>   echo \"detected MinGW/Cygwin\"\n>>   ;;\n>> *MINGW*)\n>\n> ...so I can see no way to reach this point: if the string matches\n> *MINGW*, it also matches *MINGW*|*CYGWIN*.\n>\n>>   echo \"detected MinGW\"\n>>   ;;\n>> *CYGWIN*)\n>>   echo \"detected Cygwin\"\n>>   ;;\n>> esac\n>\n> But you've just showed that $(uname -s) of Cygwin did contain upper-case\n> CYGWIN, which I think was the point to verify :-).\n>\n> --\n> Matthieu Moy\n> http://www-verimag.imag.fr/~moy/\n>\n"},{"id":"163879","messageId":"AANLkTikNprk74FnSfw=n3ePvwOZT_WaeSpnKQCqD9mpa@mail.gmail.com","threadId":"26787","inReplyTo":"AANLkTinFFnm7-TKcbTdbzJHx4i4L8rdi4xogr3R7=7s1@mail.gmail.com","subject":"Re: [PATCH] repack: find -> /usr/bin/find, as for cygwin","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2011-03-21T09:36:06Z","receivedAt":"2011-03-21T09:36:06Z","isPatch":true,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Sun, Mar 20, 2011 at 1:35 AM, ryenus ◇ <ryenus@gmail.com> wrote:\n> oops, corrected the script with the test strings in upper cases\n>\n> #!/bin/sh\n> echo $(uname -s)\n> case $(uname -s) in\n> *MINGW*|*CYGWIN*)\n>  echo \"detected MinGW/Cygwin\"\n>  ;;\n> *MINGW*)\n>  echo \"detected MinGW\"\n>  ;;\n> *CYGWIN*)\n>  echo \"detected Cygwin\"\n>  ;;\n> esac\n>\n\nOutput:\nMINGW32_NT-6.1\ndetected MinGW/Cygwin\n"}]}