RFR: JDK-8176033: New cygwin grep does not match \r as newline (original) (raw)
Magnus Ihse Bursie magnus.ihse.bursie at oracle.com
Wed Mar 1 17:24:56 UTC 2017
- Previous message (by thread): RFR: JDK-8176033: New cygwin grep does not match \r as newline
- Next message (by thread): RFR: JDK-8176033: New cygwin grep does not match \r as newline
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 cygwinwinpathroot=
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/basicswindows.m4 --- a/common/autoconf/basicswindows.m4 Fri Feb 24 12:01:32 2017 +0100 +++ b/common/autoconf/basicswindows.m4 Wed Mar 01 10:50:44 2017 +0100 @@ -329,8 +329,8 @@ ACMSGERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) fi ACMSGCHECKING([cygwin root directory as unix-style path]) - # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away - cygwinwinpathroot=cd / ; cmd /c cd | $GREP ".*"
+ # The cmd output ends with Windows line endings (CR/LF) + cygwinwinpathroot=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. CYGWINROOTPATH=$CYGPATH -u "$cygwinwinpathroot " | $CUT -f 1 -d " "
ACMSGRESULT([$CYGWINROOTPATH]) /Erik
- Previous message (by thread): RFR: JDK-8176033: New cygwin grep does not match \r as newline
- Next message (by thread): RFR: JDK-8176033: New cygwin grep does not match \r as newline
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]