]> git.ipfire.org Git - thirdparty/man-pages.git/commit
share/mk/: Don't pass an escaped # to grep(1)
authorAlejandro Colomar <alx@kernel.org>
Thu, 27 Feb 2025 19:13:34 +0000 (20:13 +0100)
committerAlejandro Colomar <alx@kernel.org>
Thu, 27 Feb 2025 19:13:59 +0000 (20:13 +0100)
commit46b7bcaae3cbd18b3022caa3ddd52e7be66bb21a
treec1f6fb882c5f200550d952f666124fc73c6e0fd0
parentbdf0f7bd48a440d0f83b331c541e7d8f13a5988b
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 <slyich@gmail.com>
Cc: Florian Weimer <fw@deneb.enyo.de>
Cc: Boris Pigin <boris.pigin@gmail.com>
Suggested-by: Jakub Wilk <jwilk@jwilk.net>
References: <20250227162800.36exbwmqky6d7z4t@jwilk.net>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
share/mk/configure/build-depends/cpp/cpp.mk
share/mk/src/sh.mk