From: Alejandro Colomar Date: Thu, 27 Feb 2025 19:13:34 +0000 (+0100) Subject: share/mk/: Don't pass an escaped # to grep(1) X-Git-Tag: man-pages-6.13~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46b7bcaae3cbd18b3022caa3ddd52e7be66bb21a;p=thirdparty%2Fman-pages.git share/mk/: Don't pass an escaped # to grep(1) We need to escape the # for old versions of make(1). However, new versions of grep(1) diagnose if it receives an escaped #. To keep both make(1) and grep(1) happy in both their old and new versions, we need to take advantage of # not being a comment in bash(1) when not preceeded by a space, and also of \# being translated into # by bash(1). alx@debian:~$ echo ''\# # alx@debian:~$ echo ''# # Fixes: 76f12e3fd3ea (2025-02-10; "share/mk/: Escape '#' in regexes") Reported-by: Sergei Trofimovich Cc: Florian Weimer Cc: Boris Pigin Suggested-by: Jakub Wilk References: <20250227162800.36exbwmqky6d7z4t@jwilk.net> Signed-off-by: Alejandro Colomar --- diff --git a/share/mk/configure/build-depends/cpp/cpp.mk b/share/mk/configure/build-depends/cpp/cpp.mk index ef12a848a..4b2b20baa 100644 --- a/share/mk/configure/build-depends/cpp/cpp.mk +++ b/share/mk/configure/build-depends/cpp/cpp.mk @@ -21,7 +21,7 @@ endif CPP_HAS_ALREADY_D_FORTIFY_SOURCE := \ $(shell \ $(CPP) -dM - -Wno-error /dev/null \ + | $(GREP) ''\#'define _FORTIFY_SOURCE ' >/dev/null \ && $(ECHO) yes \ || $(ECHO) no; \ ) diff --git a/share/mk/src/sh.mk b/share/mk/src/sh.mk index 05c9e0449..019d5c03b 100644 --- a/share/mk/src/sh.mk +++ b/share/mk/src/sh.mk @@ -14,7 +14,7 @@ include $(MAKEFILEDIR)/configure/directory_variables/src.mk BIN_sh := $(shell $(FIND) $(SRCBINDIR) -type f \ - | $(XARGS) $(GREP) -l '^\#!/bin/\(sh\|bash\)\>' \ + | $(XARGS) $(GREP) -l '^'\#'!/bin/\(sh\|bash\)\>' \ | $(SORT))