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: Eric Blake
Subject: Re: configure fails on Maemo/OS2008 (sed: no previous regexp)
Date: Tue, 25 Mar 2008 21:30:58 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jim Meyering on 3/22/2008 12:20 PM:
|>> $ busybox sed -n '/^g''l_INCLUDE_EXCLUDE_PROG(.*
\[\(.*\)\])/{s//\1/;s/,/ /gp
|>> }' configure.ac
|>> sed: No previous regexp.
|>> [Exit 1]
|
| 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>.

Thanks for this portability analysis.  I agree that it is a violation of
POSIX; perhaps someone should report this to the busybox maintainers.
Meanwhile, I'm documenting it for future reference:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfpw3EACgkQ84KuGfSFAYC6OQCeOw1cPdjBE2ZwH++iVkpXn48j
0icAn0SljIY336+ZkVroD9J4EY7QJHu5
=ZYIO
-----END PGP SIGNATURE-----
>From 5c55fb1f4db4ce31263d71744014eddde28071fd Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Tue, 25 Mar 2008 21:19:58 -0600
Subject: [PATCH] Document busybox sed bug.

* doc/autoconf.texi (Limitations of Usual Tools): Mention
restrictions when using back-references.
Reported by Vincent Lefevre:
<http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13013>.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog         |    6 ++++++
 doc/autoconf.texi |   14 ++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0aab398..7f82ee2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2008-03-26  Eric Blake  <address@hidden>
 
+       Document busybox sed bug.
+       * doc/autoconf.texi (Limitations of Usual Tools): Mention
+       restrictions when using back-references.
+       Reported by Vincent Lefevre:
+       <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/13013>.
+
        Document Automake interaction with AC_CONFIG_MACRO_DIR.
        * doc/autoconf.texi (Input): Mention ACLOCAL_AMFLAGS for automake
        users.
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 17b9045..b72d875 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -15389,6 +15389,20 @@ flushleft
    indented
 @end example
 
+Posix requires that with an empty regular expression, the last non-empty
+regular expression from either an address specification or substitution
+command is applied.  However, busybox 1.6.1 complains when using a
+substitution command with a replacement containing a back-reference to
+an empty regular expression; the workaround is repeating the regular
+expression.
+
address@hidden
address@hidden {echo abc | busybox sed '/a\(b\)c/ s//\1/'}
+sed: No previous regexp.
address@hidden {echo abc | busybox sed '/a\(b\)c/ s/a\(b\)c/\1/'}
+b
address@hidden example
+
 
 @item @command{sed} (@samp{t})
 @c ---------------------------
-- 
1.5.4


reply via email to

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