RFR: JDK-8176033: New cygwin grep does not match \r as newline

Bradford Wetmore bradford.wetmore at oracle.com
Wed Mar 1 21:38:35 UTC 2017


Looks ok to me too, but I see it's already been pushed.

Since I doubt the JPRG machines are new enough, I will reload the new 
grep onto my machine and ensure it works.  Unless you hear from me, 
assume we're ok.

Brad




On 3/1/2017 9:24 AM, Magnus Ihse Bursie wrote:
> Looks good to me.
>
> /Magnus
>
>> 1 mars 2017 kl. 14:04 skrev Erik Joelsson <erik.joelsson at oracle.com>:
>>
>> In our configure code for rewriting cygwin paths reliably, we use this construct to find the root of the cygwin installation:
>>
>> # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
>> cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"`
>>
>> This used to work fine for a long time, but with the latest version of cygwin grep, it no longer removes \r from the string. A more robust implementation would be to instead use tr to explicitly remove both \r and \n.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8176033
>>
>> Patch:
>>
>> diff -r fe8466adaef8 common/autoconf/basics_windows.m4
>> --- a/common/autoconf/basics_windows.m4 Fri Feb 24 12:01:32 2017 +0100
>> +++ b/common/autoconf/basics_windows.m4 Wed Mar 01 10:50:44 2017 +0100
>> @@ -329,8 +329,8 @@
>>       AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path])
>>     fi
>>     AC_MSG_CHECKING([cygwin root directory as unix-style path])
>> -    # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away
>> -    cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"`
>> +    # The cmd output ends with Windows line endings (CR/LF)
>> +    cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'`
>>     # Force cygpath to report the proper root by including a trailing space, and then stripping it off again.
>>     CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "`
>>     AC_MSG_RESULT([$CYGWIN_ROOT_PATH])
>>
>> /Erik
>>
>



More information about the build-dev mailing list