]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-42874: Remove grep -qE options for Solaris 10 compatibility (GH-24200)
authorPaul Ganssle <paul@ganssle.io>
Tue, 12 Jan 2021 18:17:52 +0000 (13:17 -0500)
committerGitHub <noreply@github.com>
Tue, 12 Jan 2021 18:17:52 +0000 (10:17 -0800)
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]():

Misc/NEWS.d/next/Build/2021-01-12-10-06-50.bpo-42874.XKK61g.rst [new file with mode: 0644]
configure
configure.ac

diff --git a/Misc/NEWS.d/next/Build/2021-01-12-10-06-50.bpo-42874.XKK61g.rst b/Misc/NEWS.d/next/Build/2021-01-12-10-06-50.bpo-42874.XKK61g.rst
new file mode 100644 (file)
index 0000000..c3ef7b3
--- /dev/null
@@ -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).
index 5691c27cf66febd4a72ec41362c70b62587cc942..1d81c00c6359c63f0881668f70549de771eae6b4 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index 990d6bfdd81b723a86c1986923026fb089845f46..08c462ac9f629ad8f690abc894b38944af5cbf29 100644 (file)
@@ -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