Skip to content

Commit

Permalink
Remove grep -qE options for Solaris 10 compatibility
Browse files Browse the repository at this point in the history
According to bpo-42874, some versions of grep do not support the -q and
-E options. Although both options are used elsewhere in the configure
script, this particular bit of validation can be achieved without them,
so there's no real harm in using a grep call with no flags.

bpo-42874: https://bugs.python.org/issue42874
  • Loading branch information
pganssle committed Jan 12, 2021
1 parent 11d13e8 commit 32e1d4f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Removed the grep -q and -E flags in the tzpath validation section of the
configure script to better accomodate users of some platforms (specifically
Solaris 10).
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -10252,7 +10252,7 @@ validate_tzpath() {
fi

# Bad paths are those that don't start with /
if ( echo $1 | grep -qE '(^|:)([^/]|$)' ); then
if ( echo $1 | grep '\(^\|:\)\([^/]\|$\)' > /dev/null); then
as_fn_error $? "--with-tzpath must contain only absolute paths, not $1" "$LINENO" 5
return 1;
fi
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2980,7 +2980,7 @@ validate_tzpath() {

# Bad paths are those that don't start with /
dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
if ( echo $1 | grep -qE '(^|:)(@<:@^/@:>@|$)' ); then
if ( echo $1 | grep '\(^\|:\)\(@<:@^/@:>@\|$\)' > /dev/null); then
AC_MSG_ERROR([--with-tzpath must contain only absolute paths, not $1])
return 1;
fi
Expand Down

0 comments on commit 32e1d4f

Please sign in to comment.