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: generate date of lint.7 from err.c



details:   https://anonhg.NetBSD.org/src/rev/8102b8bfbc8f
branches:  trunk
changeset: 1023386:8102b8bfbc8f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 05 13:46:31 2021 +0000

description:
lint: generate date of lint.7 from err.c

diffstat:

 usr.bin/xlint/lint1/Makefile |  26 ++++++++++++++++++++++----
 usr.bin/xlint/lint1/makeman  |  11 ++++++-----
 2 files changed, 28 insertions(+), 9 deletions(-)

diffs (93 lines):

diff -r 9af9c27e2419 -r 8102b8bfbc8f usr.bin/xlint/lint1/Makefile
--- a/usr.bin/xlint/lint1/Makefile      Sun Sep 05 13:20:34 2021 +0000
+++ b/usr.bin/xlint/lint1/Makefile      Sun Sep 05 13:46:31 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.84 2021/08/22 22:24:12 rillig Exp $
+#      $NetBSD: Makefile,v 1.85 2021/09/05 13:46:31 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -29,16 +29,34 @@
 
 BINDIR=                /usr/libexec
 
-CLEANFILES+=   ${MAN}
+CLEANFILES+=   ${MAN} ${MAN}.date
 
 .if ${USETOOLS} == "yes"
 LINT1=         ${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-lint1
 .endif
 LINT1?=                ./${PROG}
 
-${MAN}:                makeman ${LINT1:C/^\.\///} Makefile
+${MAN}.date:   err.c
+       sed -E \
+           -e 's,.*(....)/([0-9]{2})/0?([0-9]+).*,\2 \3\, \1,' \
+           -e 's,^01,January,' \
+           -e 's,^02,February,' \
+           -e 's,^03,March,' \
+           -e 's,^04,April,' \
+           -e 's,^05,May,' \
+           -e 's,^06,June,' \
+           -e 's,^07,July,' \
+           -e 's,^08,August,' \
+           -e 's,^09,September,' \
+           -e 's,^10,October,' \
+           -e 's,^11,November,' \
+           -e 's,^12,December,' \
+           -e 1q \
+           ${.ALLSRC} > ${.TARGET}
+
+${MAN}:                makeman ${LINT1:./%=%} Makefile ${MAN}.date
        ${_MKTARGET_CREATE}
-       ${HOST_SH} ${.ALLSRC:M*makeman} ${LINT1} -m >${.TARGET}
+       ${HOST_SH} ${.ALLSRC:M*makeman} "$$(cat ${.ALLSRC:M*.date})" ${LINT1} -m >${.TARGET}
 
 LDADD+=                -lm
 .ifndef HOSTPROG
diff -r 9af9c27e2419 -r 8102b8bfbc8f usr.bin/xlint/lint1/makeman
--- a/usr.bin/xlint/lint1/makeman       Sun Sep 05 13:20:34 2021 +0000
+++ b/usr.bin/xlint/lint1/makeman       Sun Sep 05 13:46:31 2021 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh
-#      $NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
+#      $NetBSD: makeman,v 1.5 2021/09/05 13:46:31 rillig Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -29,8 +29,8 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
-cat << \__EOF
-.\"    $NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
+sed "s|@date@|$1|" << \__EOF
+.\"    $NetBSD: makeman,v 1.5 2021/09/05 13:46:31 rillig Exp $
 .\"
 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -58,14 +58,14 @@
 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
-.Dd September 5, 2021
+.Dd @date@
 .Dt LINT 7
 .Os
 .Sh NAME
 .Nm lint
 .Nd Lint error message list
 .Sh DESCRIPTION
-The following is a list of message id's and messages produced by
+The following is a list of message IDs and messages produced by
 .Xr lint 1 .
 It is intended to be used with
 .Fl X
@@ -75,6 +75,7 @@
 .Bd -ragged -offset indent -compact
 .Bl -column "XXXX"
 __EOF
+shift
 "$@" | sed -e 's/^/.It /' -e 's/\\/\\e/g' -e "s/'/\\'/"
 echo ".El"
 echo ".Ed"



Home | Main Index | Thread Index | Old Index