GNU bug report logs -
#62896
[Configure] Bug with check for PERL when path has spaces (i.e. Windows)
Previous Next
Reported by: Dan Rosser <danoli3 <at> gmail.com>
Date: Mon, 17 Apr 2023 06:54:02 UTC
Severity: normal
Done: Paul Eggert <eggert <at> cs.ucla.edu>
Bug is archived. No further changes may be made.
Full log
Message #37 received at 62896 <at> debbugs.gnu.org (full text, mbox):
echo "$PERL" | grep '[ \t]'
I don't think there's any portable way to use \t to insert a tab in a
shell string, besides literally. There's something like
tab=`printf '\t'`
.. "$tab" ...
but I don't see a need to go that far here. I just used a literal tab char.
also, can we really not trust the exit status of grep ?
if echo "$PERL" | grep -q '[\t ]'; then
Exit status yes, but at least historically, grep -q has been considered
non-portable, in favor of grep ... >/dev/null.
I committed the change as below. --thanks, karl.
--
configure: better check for the perl patch containing whitespace.
More for https://bugs.gnu.org/62896.
* configure.ac: quote "$PERL" and check directly with grep.
diff --git a/configure.ac b/configure.ac
index 23a9f97f5..946fecb67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,8 +70,8 @@ AC_PROG_LN_S
AC_PATH_PROG([PERL], [perl])
if test -z "$PERL"; then
AC_MSG_ERROR([perl not found])
-elif test x"`echo $PERL | grep ' '`" != "x"; then
- AC_MSG_ERROR([The path to your Perl contains spaces.
+elif echo "$PERL" | grep '[ ]' >/dev/null; then
+ AC_MSG_ERROR([The path to your Perl contains spaces or tabs.
This would cause build failures later or unusable programs.
Please use a path without spaces and try again.])
fi
compile finished at Sat Dec 2 14:52:38 2023
This bug report was last modified 1 year and 222 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.