RFR: JDK-8036145: Solaris standard grep does not understand -qE
Dave Pointon
dpointo8 at linux.vnet.ibm.com
Tue Mar 4 12:03:50 UTC 2014
Hi Eric ,
On Mon, 2014-03-03 at 17:56 +0100, Erik Joelsson wrote:
> It seems I failed in the below fix. /usr/bin/grep on Solaris does not
> support -qE. Here is another patch, converting the regexp to work
> without the -E switch and piping to /dev/null to keep it quiet:
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8036145
>
> diff --git a/common/autoconf/configure b/common/autoconf/configure
> --- a/common/autoconf/configure
> +++ b/common/autoconf/configure
> @@ -127,11 +127,11 @@
> if [[ -n "$1" ]]; then
> # Uses only shell-safe characters? No quoting needed.
> # '=' is a zsh meta-character, but only in word-initial position.
> - if echo "$1" | grep -qE
> '^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789.:,%/+=_-]+$'
> \
> - && ! echo "$1" | grep -qE '^='; then
> + if echo "$1" | grep
> '^[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\.:,%/+=_-]\{1,\}$'
> > /dev/null \
> + && ! echo "$1" | grep '^=' > /dev/null; then
> quoted="$1"
> else
> - if echo "$1" | grep -qE "[\'!]"; then
> + if echo "$1" | grep "[\'!]" > /dev/null; then
> # csh does history expansion within single quotes, but not
> # when backslash-escaped!
> local quoted_quote="'\\''" quoted_exclam="'\\!'"
>
> /Erik
>
<snip>
Looks good, altho' I'd question the use of the '-E' switch/option anyway
- there appears to be nothing that requires the use of extended RE's
(which is what -E enables).
Rgds ,
--
Dave Pointon FIAP MBCS
Now I saw, tho' too late, the folly of beginning a work before we count
the cost and before we we judge rightly of our strength to go thro'
with it - Robinson Crusoe
More information about the build-dev
mailing list