]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
syntax-check: fix sed syntax errors
authorPavel Raiskup <praiskup@redhat.com>
Sat, 31 Oct 2015 14:49:01 +0000 (15:49 +0100)
committerPavel Raiskup <praiskup@redhat.com>
Wed, 4 Nov 2015 05:47:21 +0000 (06:47 +0100)
Multi-line single-quoted shell arguments defined within makefile
rules end up having the trailing backslash.  This caused problem
in some sc_* rules as GNU sed does not interpret trailing
backslash the same way as SHELL (== appending next line).
Switching to double quotes means that SHELL will remove the
trailing backslash for subsequent sed call.  This silences a lot
of GNU sed warnings seen before like:

  sed: -e expression #1, char 96: unterminated address regex

* cfg.mk (sc_libtool_m4_cc_basename): Use $(SED) instead of sed,
use double quotes for sed's multi-line argument.
(sc_prohibit_set_dummy_without_shift): Likewise.
(sc_prohibit_test_const_follows_var): Likewise.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index c04248f1a3a091978b3ae1814453f2591da35b55..42eea189f916012fb4bd4967cf1e39591ef5b4e2 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -70,9 +70,9 @@ local-checks-to-skip =                                \
 
 # Check for correct usage of $cc_basename in libtool.m4.
 sc_libtool_m4_cc_basename:
-       @sed -n '/case \$$cc_basename in/,/esac/ {                      \
+       @$(SED) -n "/case \\\$$cc_basename in/,/esac/ {                 \
          /^[    ]*[a-zA-Z][a-zA-Z0-9+]*[^*][    ]*)/p;                 \
-       }' '$(srcdir)/$(macro_dir)/libtool.m4' | grep . && {            \
+       }" '$(srcdir)/$(macro_dir)/libtool.m4' | grep . && {            \
          msg="\$$cc_basename matches should include a trailing '*'."   \
          $(_sc_say_and_exit) } || :
 
@@ -142,12 +142,12 @@ sc_prohibit_set_dummy_without_shift:
        @files=$$($(VC_LIST_EXCEPT));                                   \
        if test -n "$$files"; then                                      \
          grep -nE '(set dummy|shift)' $$files |                        \
-           sed -n '/set[        ][      ]*dummy/{                      \
+           $(SED) -n "/set[     ][      ]*dummy/{                      \
              /set.*dummy.*;.*shift/d;                                  \
              N;                                                        \
              /\n.*shift/D;                                             \
              p;                                                        \
-            }' | grep -n . && {                                                \
+           }" | grep -n . && {                                         \
            msg="use 'shift' after 'set dummy'"                         \
            $(_sc_say_and_exit) } || :;                                 \
        else :;                                                         \
@@ -216,11 +216,11 @@ sc_prohibit_test_const_follows_var:
 exclude_file_name_regexp--sc_require_function_nl_brace = (^HACKING|\.[ch]|\.texi)$$
 sc_require_function_nl_brace:
        @for file in $$($(VC_LIST_EXCEPT)); do                          \
-         sed -n '/^func_[^      ]*[     ]*(/{                          \
+         $(SED) -n "/^func_[^   ]*[     ]*(/{                          \
            N;                                                          \
            /^func_[^    ]* ()\n{$$/d;                                  \
            p;                                                          \
-         }' $$file | grep -E . && {                                    \
+         }" $$file | grep -E . && {                                    \
            msg="found malformed function_definition in $$file"         \
            $(_sc_say_and_exit) } || :;                                 \
        done