From ac1cb3023ce578c2937b4e38e7774ac93d2c6cf7 Mon Sep 17 00:00:00 2001 From: kim Date: Sun, 14 Nov 2021 22:15:13 +0000 Subject: {,standalone-,static-}tcsh: fix and document ln=target --- shells/standalone-tcsh/Makefile | 6 +++--- shells/static-tcsh/Makefile | 3 ++- shells/tcsh/Makefile | 4 +++- shells/tcsh/distinfo | 5 ++++- shells/tcsh/patches/patch-tcsh.man | 18 ++++++++++++++++++ shells/tcsh/patches/patch-tcsh.man.new | 18 ++++++++++++++++++ shells/tcsh/patches/patch-tw.color.c | 22 ++++++++++++++++++++++ 7 files changed, 70 insertions(+), 6 deletions(-) create mode 100644 shells/tcsh/patches/patch-tcsh.man create mode 100644 shells/tcsh/patches/patch-tcsh.man.new create mode 100644 shells/tcsh/patches/patch-tw.color.c diff --git a/shells/standalone-tcsh/Makefile b/shells/standalone-tcsh/Makefile index f9c41f9c724..913f401c2f7 100644 --- a/shells/standalone-tcsh/Makefile +++ b/shells/standalone-tcsh/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.32 2021/11/14 21:53:15 mrg Exp $ +# $NetBSD: Makefile,v 1.33 2021/11/14 22:15:13 kim Exp $ # # FIXME: This is because of PREFIX=/ below. @@ -6,7 +6,7 @@ CHECK_FILES_SUPPORTED= no NOT_FOR_UNPRIVILEGED= yes PKGNAME= standalone-${DISTNAME} -PKGREVISION= 0 # ALWAYS needs to be set; 0 if none. +PKGREVISION= 1 # ALWAYS needs to be set; 0 if none. WRKSRC= ${WRKDIR}/${DISTNAME} PATCHDIR= ${.CURDIR}/../../shells/tcsh/patches @@ -22,7 +22,7 @@ ONLY_FOR_PLATFORM+= NetBSD-*-* OpenBSD-*-* SunOS-*-* NOT_FOR_PLATFORM+= SunOS-*-* .endif -+# XXX This should use Makefile.common, not Makefile +# XXX This should use Makefile.common, not Makefile .include "../../shells/tcsh/Makefile" INSTALLATION_DIRS+= usr/share/man/man1 diff --git a/shells/static-tcsh/Makefile b/shells/static-tcsh/Makefile index 684148b11f1..b79e2a142be 100644 --- a/shells/static-tcsh/Makefile +++ b/shells/static-tcsh/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2021/11/11 22:47:55 kim Exp $ +# $NetBSD: Makefile,v 1.13 2021/11/14 22:15:13 kim Exp $ # .include "../../shells/tcsh/Makefile.common" @@ -13,6 +13,7 @@ DESCR_SRC= ${.CURDIR}/../../shells/tcsh/DESCR ${.CURDIR}/DESCR CONFLICTS= tcsh-[0-9]* PKGNAME= static-${DISTNAME} +PKGREVISION= 1 # SunOS 5.10 stopped shipping static libraries. NOT_FOR_PLATFORM+= SunOS-5.1[0-9]-* diff --git a/shells/tcsh/Makefile b/shells/tcsh/Makefile index 89e9d695766..9692ad94597 100644 --- a/shells/tcsh/Makefile +++ b/shells/tcsh/Makefile @@ -1,5 +1,7 @@ -# $NetBSD: Makefile,v 1.100 2021/11/11 22:47:55 kim Exp $ +# $NetBSD: Makefile,v 1.101 2021/11/14 22:15:13 kim Exp $ .include "../../shells/tcsh/Makefile.common" +PKGREVISION=1 + .include "../../mk/bsd.pkg.mk" diff --git a/shells/tcsh/distinfo b/shells/tcsh/distinfo index 67542743d40..09cc29d499b 100644 --- a/shells/tcsh/distinfo +++ b/shells/tcsh/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.53 2021/11/13 06:50:03 kim Exp $ +$NetBSD: distinfo,v 1.54 2021/11/14 22:15:13 kim Exp $ BLAKE2s (tcsh-6.23.00.tar.gz) = a61b142efc2ca927cb33ea4eb87c0530cacc0c79ff1c30d5e9022a4404cef72d SHA512 (tcsh-6.23.00.tar.gz) = 8ea491e9409f12ab113bf5551398cb827692a50340318b050d0f8278d3cd9c133ba89a407dc692d9c4bd69957ecd6d4d92db7ccfacc7064ace3b09e3bd562f30 @@ -7,3 +7,6 @@ SHA1 (patch-Makefile.in) = 16ae4c595c8e23be1acbfa0263334df569300a79 SHA1 (patch-config_f.h) = 715d939e8a8f4917bd219dccd91d5c49ae502939 SHA1 (patch-nls_Makefile.in) = 58d859e8a50e6436b9bc6514497eb876426d92d7 SHA1 (patch-sh.h) = ac6211ddd5e552e9baec2d35aed5e7e573cab04e +SHA1 (patch-tcsh.man) = 7ced0fbcc2bdae180d3e88acda44e189ca37abc6 +SHA1 (patch-tcsh.man.new) = 7669b45129a64a5c0bc5eab39e310ec6ec4ab4c4 +SHA1 (patch-tw.color.c) = 9ad72f83e6ebf21bb587cc6c83657a2b4bdee0e6 diff --git a/shells/tcsh/patches/patch-tcsh.man b/shells/tcsh/patches/patch-tcsh.man new file mode 100644 index 00000000000..21fefabc5d4 --- /dev/null +++ b/shells/tcsh/patches/patch-tcsh.man @@ -0,0 +1,18 @@ +$NetBSD: patch-tcsh.man,v 1.1 2021/11/14 22:15:13 kim Exp $ + +Document ln=target + +https://github.com/tcsh-org/tcsh/commit/b98d6544234e9258156f08c8b559ed6253f2bc49.patch + +--- tcsh.man ++++ tcsh.man +@@ -5088,6 +5088,9 @@ A few terminal programs do not recognize the default end code + properly. If all text gets colorized after you do a directory + listing, try changing the \fBno\fR and \fBfi\fR codes from 0 to the + numerical codes for your standard fore- and background colors. ++.PP ++For symbolic links the \fBln\fR keyword can be set to \fBtarget\fR, which makes ++the file color the same as the color of the link target. + .RE + .TP 8 + .B MACHTYPE \fR(+) diff --git a/shells/tcsh/patches/patch-tcsh.man.new b/shells/tcsh/patches/patch-tcsh.man.new new file mode 100644 index 00000000000..3700c588894 --- /dev/null +++ b/shells/tcsh/patches/patch-tcsh.man.new @@ -0,0 +1,18 @@ +$NetBSD: patch-tcsh.man.new,v 1.1 2021/11/14 22:15:13 kim Exp $ + +Document ln=target + +https://github.com/tcsh-org/tcsh/commit/b98d6544234e9258156f08c8b559ed6253f2bc49.patch + +--- tcsh.man.new ++++ tcsh.man.new +@@ -8997,6 +8997,9 @@ and + .Va fi + codes from 0 to the + numerical codes for your standard fore- and background colors. ++.Pp ++For symbolic links the "ln" keyword can be set to "target", which makes ++the file color the same as the color of the link target. + .RE + .TP 8 + .B MACHTYPE \fR(+) diff --git a/shells/tcsh/patches/patch-tw.color.c b/shells/tcsh/patches/patch-tw.color.c new file mode 100644 index 00000000000..49ba7ef64fa --- /dev/null +++ b/shells/tcsh/patches/patch-tw.color.c @@ -0,0 +1,22 @@ +$NetBSD: patch-tw.color.c,v 1.1 2021/11/14 22:15:13 kim Exp $ + +Fix the ln=target code by NUL terminating the result of readlink(2). + +https://github.com/tcsh-org/tcsh/commit/247a7d6649621fdc40c31ad81c4967413213b9d2.patch + +--- tw.color.c ++++ tw.color.c +@@ -482,10 +482,12 @@ print_with_color(const Char *filename, size_t len, Char suffix) + char buf[MAXPATHLEN]; + + while (c == '@') { +- if (readlink(f, buf, MAXPATHLEN) == -1) { ++ ssize_t b = readlink(f, buf, MAXPATHLEN); ++ if (b == -1) { + c = '&'; + break; + } ++ buf[b] = '\0'; + + c = filetype(STRNULL, str2short(buf)); + f = buf; -- cgit v1.2.3