bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: configure fails on Maemo/OS2008 (sed: no previous regexp)


From: Jim Meyering
Subject: Re: configure fails on Maemo/OS2008 (sed: no previous regexp)
Date: Sat, 22 Mar 2008 19:20:37 +0100

Andreas Schwab <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>> $ busybox sed -n '/^g''l_INCLUDE_EXCLUDE_PROG(.* \[\(.*\)\])/{s//\1/;s/,/ /gp
>> }' configure.ac
>> sed: No previous regexp.
>> [Exit 1]
>
>>From (autoconf)Limitations of Usual Tools::
>      Commands inside { } brackets are further restricted.  Posix says
>      that they cannot be preceded by addresses, `!', or `;', and that
>      each command must be followed immediately by a newline, without any
>      intervening blanks or semicolons.  The closing bracket must be
>      alone on a line, other than white space preceding or following it.

Hi Andreas,

Yes, I recall the above from earlier problems with this part of
configure.ac.  However, you seem to have left out an explanation
of how that quote is relevant to this problem with busybox's sed.

This appears to be a busybox "limitation".
I expect to work around it with this patch:

        portability: work around a "busybox sed" limitation
        * configure.ac: While every other sed tested supports usage like
        '/\(re\)/{s//\1/;...<NEWLINE>}', and POSIX appears to requires this,
        busybox's sed does not support it.  So duplicate the regexp:
        '/\(re\)/{s/\(re\)/\1/;...<NEWLINE>}'.  Reported by Vincent Lefevre:
        <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13013>.

Signed-off-by: Jim Meyering <address@hidden>
---
 configure.ac |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index cc4e152..14505fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -280,7 +280,8 @@ no_install_progs_default=`echo "$t"|sed 's/ $//'`
 # The compromise is to ensure that the space-separated list extracted
 # above matches the literal 2nd argument below.
 c="$srcdir/configure.ac"
-t=`sed -n '/^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])/{s//\1/;s/,/ /gp
+re='^g''l_INCLUDE_EXCLUDE_PROG(.* [\[\(.*\)\]])'
+t=`sed -n '/'"$re"'/{s/'"$re"'/\1/;s/,/ /gp
 }' $c`
 case $t in
   $no_install_progs_default) ;;
--
1.5.5.rc0.21.g740fd




reply via email to

[Prev in Thread] Current Thread [Next in Thread]