Package: libtool / 2.4.6-10

0015-syntax-check-fix-sed-syntax-errors.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From a3c6e99c9cde0f786fa3df88360c84cf33ddc278 Mon Sep 17 00:00:00 2001
From: Pavel Raiskup <praiskup@redhat.com>
Date: Sat, 31 Oct 2015 15:49:01 +0100
Subject: [PATCH 15/20] syntax-check: fix sed syntax errors

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 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Index: libtool-2.4.6/cfg.mk
===================================================================
--- libtool-2.4.6.orig/cfg.mk
+++ libtool-2.4.6/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) } || :
 
@@ -135,12 +135,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 :;								\
@@ -208,11 +208,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