Discussion:
sed: -e expression #6, char 53: unknown option to `s'
Tim Ruehsen
2018-02-03 18:25:00 UTC
Permalink
Hi,

just trying to update gnulib code for libidn and run into the error in
the subject. It's the latest gnulib from master.

Maybe I miss something ? I am not too familiar with sed to see
something obvious.


The steps I took:

$ rm -rf gl gltests

$ ../gnulib/gnulib-tool --import --local-dir=gl/override --lib=libgnu
--source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gltests --
aux-dir=build-aux --with-tests --avoid=fcntl-h-tests --avoid=stdlib-
tests --avoid=string-tests --avoid=sys_stat-tests --avoid=time-tests --
avoid=unistd-tests --avoid=update-copyright-tests --avoid=wchar-tests
--no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files
autobuild csharpcomp-script csharpexec-script error fdl-1.3 gendocs
getline getopt-gnu gnupload maintainer-makefile manywarnings
pmccabe2html progname update-copyright useless-if-before-free valgrind-
tests vc-list-files version-etc warnings

$ make
[errors]


When I cd into gltests/ and 'make -j1 V=1':

rm -f signal.h-t signal.h && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''GUARD_PREFIX''@|GL|g' \
-e 's|@''INCLUDE_NEXT''@|include_next|g' \
-e 's|@''PRAGMA_SYSTEM_HEADER''@|#pragma GCC system_header|g' \
-e 's|@''PRAGMA_COLUMNS''@||g' \
-e 's|@''NEXT_SIGNAL_H''@|<signal.h>|g' \
-e 's|@''GNULIB_PTHREAD_SIGMASK''@|(IN_LIBIDN_GNULIB_TESTS ||
IN_LIBIDN_GNULIB_TESTS)|g' \
-e 's|@''GNULIB_RAISE''@|(IN_LIBIDN_GNULIB_TESTS ||
IN_LIBIDN_GNULIB_TESTS)|g' \
-e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/0/g' \
-e 's/@''GNULIB_SIGPROCMASK''@/(IN_LIBIDN_GNULIB_TESTS ||
IN_LIBIDN_GNULIB_TESTS)/g' \
-e 's/@''GNULIB_SIGACTION''@/IN_LIBIDN_GNULIB_TESTS/g' \
-e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|1|g' \
-e 's|@''HAVE_PTHREAD_SIGMASK''@|1|g' \
-e 's|@''HAVE_RAISE''@|1|g' \
-e 's|@''HAVE_SIGSET_T''@|1|g' \
-e 's|@''HAVE_SIGINFO_T''@|1|g' \
-e 's|@''HAVE_SIGACTION''@|1|g' \
-e 's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|1|g' \
-e 's|@''HAVE_TYPE_VOLATILE_SIG_ATOMIC_T''@|1|g' \
-e 's|@''HAVE_SIGHANDLER_T''@|1|g' \
-e 's|@''REPLACE_PTHREAD_SIGMASK''@|0|g' \
-e 's|@''REPLACE_RAISE''@|0|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r ./c++defs.h' \
-e '/definition of _GL_ARG_NONNULL/r ./arg-nonnull.h' \
-e '/definition of _GL_WARN_ON_USE/r ./warn-on-use.h' \
< ./signal.in.h; \
} > signal.h-t && \
mv signal.h-t signal.h
sed: -e expression #6, char 53: unknown option to `s'
Makefile:4014: recipe for target 'signal.h' failed
make: *** [signal.h] Error 1

$ sed --version
sed (GNU sed) 4.4


Any help appreciated.

Regards, Tim
Bruno Haible
2018-02-03 18:56:51 UTC
Permalink
Post by Tim Ruehsen
sed: -e expression #6, char 53: unknown option to `s'
The template for this comes from modules/signal-h. But the values
come from Automake variables in the Makefile. It looks like gnulib
has substituted values that contain the C operator ||. The syntax
error comes from the fact that 2 out of 5 of these sed expressions
use the '|' character. They should probably use the '/' character.

Please try this patch:

diff --git a/modules/signal-h b/modules/signal-h
index fe9af81..810e2bf 100644
--- a/modules/signal-h
+++ b/modules/signal-h
@@ -28,8 +28,8 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
- -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
- -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \
+ -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \
+ -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \
-e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
-e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
-e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
Tim Ruehsen
2018-02-03 19:30:29 UTC
Permalink
Post by Bruno Haible
Post by Tim Ruehsen
sed: -e expression #6, char 53: unknown option to `s'
IN_LIBIDN_GNULIB_TESTS)|g' \
IN_LIBIDN_GNULIB_TESTS)|g' \
IN_LIBIDN_GNULIB_TESTS)/g' \
The template for this comes from modules/signal-h. But the values
come from Automake variables in the Makefile. It looks like gnulib
has substituted values that contain the C operator ||. The syntax
error comes from the fact that 2 out of 5 of these sed expressions
use the '|' character. They should probably use the '/' character.
diff --git a/modules/signal-h b/modules/signal-h
index fe9af81..810e2bf 100644
--- a/modules/signal-h
+++ b/modules/signal-h
@@ -28,8 +28,8 @@ signal.h: signal.in.h $(top_builddir)/config.status
$(CXXDEFS_H) $(ARG_NONNULL_H
@|g' \
- -e
+ -e
-e
-e
Hi Bruno,

thanks, with this patch the build completes !

Regards, Tim
Bruno Haible
2018-02-04 09:45:41 UTC
Permalink
Post by Tim Ruehsen
thanks, with this patch the build completes !
ok, I pushed the fix:


2018-02-04 Bruno Haible <***@clisp.org>

signal-h, monetary, strings: Fix build failure in some cases.
Reported by Tim Rühsen <***@gmx.de>.
* modules/signal-h (Makefile.am): In the GNULIB_* substitutions, use '/'
as delimiter in sed command, not '|'.
* modules/monetary (Makefile.am): Likewise.
* modules/strings (Makefile.am): Likewise.

diff --git a/modules/monetary b/modules/monetary
index c8be360..8afe1d8 100644
--- a/modules/monetary
+++ b/modules/monetary
@@ -30,7 +30,7 @@ monetary.h: monetary.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_MONETARY_H''@|$(NEXT_MONETARY_H)|g' \
-e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
- -e 's|@''GNULIB_STRFMON_L''@|$(GNULIB_STRFMON_L)|g' \
+ -e 's/@''GNULIB_STRFMON_L''@/$(GNULIB_STRFMON_L)/g' \
-e 's|@''HAVE_STRFMON_L''@|$(HAVE_STRFMON_L)|g' \
-e 's|@''REPLACE_STRFMON_L''@|$(REPLACE_STRFMON_L)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
diff --git a/modules/signal-h b/modules/signal-h
index fe9af81..810e2bf 100644
--- a/modules/signal-h
+++ b/modules/signal-h
@@ -28,8 +28,8 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
- -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
- -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \
+ -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GNULIB_PTHREAD_SIGMASK)/g' \
+ -e 's/@''GNULIB_RAISE''@/$(GNULIB_RAISE)/g' \
-e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
-e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
-e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
diff --git a/modules/strings b/modules/strings
index ced757d..919b49d 100644
--- a/modules/strings
+++ b/modules/strings
@@ -29,7 +29,7 @@ strings.h: strings.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_STRINGS_H''@|$(NEXT_STRINGS_H)|g' \
- -e 's|@''GNULIB_FFS''@|$(GNULIB_FFS)|g' \
+ -e 's/@''GNULIB_FFS''@/$(GNULIB_FFS)/g' \
-e 's|@''HAVE_FFS''@|$(HAVE_FFS)|g' \
-e 's|@''HAVE_STRCASECMP''@|$(HAVE_STRCASECMP)|g' \
-e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \

Loading...