Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: use TOOL_SED instead of sed



details:   https://anonhg.NetBSD.org/src/rev/21f9bfe874d4
branches:  trunk
changeset: 378132:21f9bfe874d4
user:      lukem <lukem%NetBSD.org@localhost>
date:      Fri Jul 21 15:00:32 2023 +0000

description:
lint: use TOOL_SED instead of sed

Use ${TOOL_SED} instead of (the host) sed, as the
latter doesn't necessarily support the non-POSIX -E.

PR bin/57533

diffstat:

 usr.bin/xlint/lint1/Makefile |   7 ++++---
 usr.bin/xlint/lint1/makeman  |  10 ++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (66 lines):

diff -r ed7b96ef7fc5 -r 21f9bfe874d4 usr.bin/xlint/lint1/Makefile
--- a/usr.bin/xlint/lint1/Makefile      Fri Jul 21 11:28:50 2023 +0000
+++ b/usr.bin/xlint/lint1/Makefile      Fri Jul 21 15:00:32 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.99 2023/07/15 13:51:36 rillig Exp $
+#      $NetBSD: Makefile,v 1.100 2023/07/21 15:00:32 lukem Exp $
 
 .include <bsd.own.mk>
 
@@ -41,7 +41,8 @@ LINT1=                ${TOOLDIR}/libexec/${MACHINE_GNU
 LINT1?=                ./${PROG}
 
 ${MAN}.date:   err.c
-       sed -E \
+       ${_MKTARGET_CREATE}
+       ${TOOL_SED} -E \
            -e 's,.*(....)/([0-9]{2})/0?([0-9]+).*,\2 \3\, \1,' \
            -e 's,^01,January,' \
            -e 's,^02,February,' \
@@ -67,7 +68,7 @@ cgram.ln: cgram.c
 
 ${MAN}:                makeman err.c Makefile ${MAN}.date
        ${_MKTARGET_CREATE}
-       ${HOST_SH} ${.ALLSRC:M*makeman} \
+       SED=${TOOL_SED:Q} ${HOST_SH} ${.ALLSRC:M*makeman} \
            "$$(cat ${.ALLSRC:M*.date})" ${.ALLSRC:M*err.c} \
            >${.TARGET}
 
diff -r ed7b96ef7fc5 -r 21f9bfe874d4 usr.bin/xlint/lint1/makeman
--- a/usr.bin/xlint/lint1/makeman       Fri Jul 21 11:28:50 2023 +0000
+++ b/usr.bin/xlint/lint1/makeman       Fri Jul 21 15:00:32 2023 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: makeman,v 1.6 2022/07/05 22:50:41 rillig Exp $
+#      $NetBSD: makeman,v 1.7 2023/07/21 15:00:32 lukem Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,14 +28,16 @@
 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 # POSSIBILITY OF SUCH DAMAGE.
 
+: ${SED:=sed}
+
 tab='  '
 
 list_messages() {
-       sed -E -n \
+       ${SED} -E -n \
            -e 's|^'"$tab"'"(.+)",.*/\* '"$2"'([0-9]+) \*/$|\2'"$tab"'\1|p' \
            -e 's|^'"$tab"'"",.*/\* '"$2"'[0-9]+ \*/$|---'"$tab"'(no longer used)|p' \
            "$1" \
-       | sed -E \
+       | ${SED} -E \
            -e 's|\\"|"|g' \
            -e 's|\\\\|\\e|g' \
            -e "s|'|\\'|g" \
@@ -43,7 +45,7 @@ list_messages() {
 }
 
 # shellcheck disable=SC2016
-cvsid='$NetBSD: makeman,v 1.6 2022/07/05 22:50:41 rillig Exp $'
+cvsid='$NetBSD: makeman,v 1.7 2023/07/21 15:00:32 lukem Exp $'
 date="$1"
 year="${date##* }"
 messages="$(list_messages "$2" "")"



Home | Main Index | Thread Index | Old Index