Skip to content

Commit 0f66498

Browse files
authored
bpo-42874: Remove grep -qE options for Solaris 10 compatibility (GH-24200)
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. Would be good to get some people taking advantage of the `--with-tzpath` arguments in the wild to try this out.. Local testing seems to indicate that this does the same thing, but I don't know that we have any buildbots using this option. Maybe @pablogsal? [bpo-42874]():
1 parent 4db8988 commit 0f66498

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Removed the grep -q and -E flags in the tzpath validation section of the
2+
configure script to better accomodate users of some platforms (specifically
3+
Solaris 10).

configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10252,7 +10252,7 @@ validate_tzpath() {
1025210252
fi
1025310253

1025410254
# Bad paths are those that don't start with /
10255-
if ( echo $1 | grep -qE '(^|:)([^/]|$)' ); then
10255+
if ( echo $1 | grep '\(^\|:\)\([^/]\|$\)' > /dev/null); then
1025610256
as_fn_error $? "--with-tzpath must contain only absolute paths, not $1" "$LINENO" 5
1025710257
return 1;
1025810258
fi

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2980,7 +2980,7 @@ validate_tzpath() {
29802980

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

0 commit comments

Comments
 (0)