git: 736e2d7674d1 - main - shells/ksh-devel: Start tracking ksh93 development again

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Sun, 28 Aug 2022 21:19:52 UTC
The branch main has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=736e2d7674d192002c328231bdc2e29447c18ee8

commit 736e2d7674d192002c328231bdc2e29447c18ee8
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2022-08-28 19:10:20 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2022-08-28 21:16:44 +0000

    shells/ksh-devel: Start tracking ksh93 development again
    
    Now that ksh development has resumed under a new account on github.
    grab our first update from the ksh93 project from their ksh repo.
---
 shells/ksh-devel/Makefile                          | 13 ++--
 shells/ksh-devel/distinfo                          |  6 +-
 .../files/patch-src_cmd_std_features_procfs        | 36 ---------
 shells/ksh-devel/files/patch-src_cmd_std_pss-kvm.c | 12 ---
 .../files/patch-src_lib_libast_features_common     | 38 ----------
 .../files/patch-src_lib_libast_features_mmap       | 36 ---------
 .../files/patch-src_lib_libast_features_standards  | 23 ------
 .../files/patch-src_lib_libast_features_vmalloc    | 10 ---
 .../files/patch-src_lib_libast_port_astcopy.c      | 17 -----
 .../files/patch-src_lib_libast_sfio_sfhdr.h        | 12 ---
 .../files/patch-src_lib_libast_sfio_sfseek.c       | 24 ------
 .../files/patch-src_lib_libast_string_strexpr.c    | 87 ----------------------
 shells/ksh-devel/pkg-plist                         |  6 +-
 13 files changed, 12 insertions(+), 308 deletions(-)

diff --git a/shells/ksh-devel/Makefile b/shells/ksh-devel/Makefile
index 41495c285e2e..8819a458368c 100644
--- a/shells/ksh-devel/Makefile
+++ b/shells/ksh-devel/Makefile
@@ -8,11 +8,10 @@
 # program.  If you are really unconvinced, go ahead but do not
 # complain to me about it.
 
-PORTNAME=	ksh93
+PORTNAME=	ksh
 PORTVERSION=	${AST_COMMIT_DATE}
 CATEGORIES=	shells
 PKGNAMESUFFIX=	-devel
-DIST_SUBDIR=	ksh93
 
 MAINTAINER=	cy@FreeBSD.org
 COMMENT=	Development branch of AT&T KornShell 93
@@ -22,14 +21,14 @@ LICENSE=	EPL
 BROKEN_aarch64=		Fails to link: missing sbrk
 BROKEN_riscv64=		Fails to link: missing sbrk
 
-HASH=		cc1bca27
-AST_COMMIT_DATE=	2020.06.30
+HASH=		53669678
+AST_COMMIT_DATE=	2022.08.26
 
 USES=		compiler:c11
 
 USE_GITHUB=	yes
-GH_ACCOUNT=	att
-GH_PROJECT=	ast
+GH_ACCOUNT=	ksh93
+GH_PROJECT=	ksh
 GH_TAGNAME=	${HASH}
 
 # IMPORTANT:	Disabling conflicts, i.e. -DDISABLE_CONFLICTS will result in
@@ -66,7 +65,7 @@ post-patch:
 	@${REINPLACE_CMD} -e 's|SF_FLAGS|SFIO_FLAGS|g' ${WRKSRC}/src/lib/libast/include/sfio*.h ${WRKSRC}/src/lib/libast/sfio/*.c
 
 do-build:
-	@cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make ksh93
+	@cd ${WRKSRC}/ && ${SETENV} -i ${MAKE_ENV} ${SH} bin/package flat make
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/bin/ksh ${STAGEDIR}${PREFIX}/bin/${PNAME}
diff --git a/shells/ksh-devel/distinfo b/shells/ksh-devel/distinfo
index 0408414b48e6..43813d419146 100644
--- a/shells/ksh-devel/distinfo
+++ b/shells/ksh-devel/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1596656748
-SHA256 (ksh93/att-ast-2020.06.30-cc1bca27_GH0.tar.gz) = a6a35966f726ad27fe5c6d32fdda47668001cc79d378c4d6f34c474b038b5cce
-SIZE (ksh93/att-ast-2020.06.30-cc1bca27_GH0.tar.gz) = 12999551
+TIMESTAMP = 1661711566
+SHA256 (ksh93-ksh-2022.08.26-53669678_GH0.tar.gz) = db42ec1935b08d75e8c8946c4684e3d773335adffea27ebbc1e633a56798e089
+SIZE (ksh93-ksh-2022.08.26-53669678_GH0.tar.gz) = 2106478
diff --git a/shells/ksh-devel/files/patch-src_cmd_std_features_procfs b/shells/ksh-devel/files/patch-src_cmd_std_features_procfs
deleted file mode 100644
index 7fc3c1fc8113..000000000000
--- a/shells/ksh-devel/files/patch-src_cmd_std_features_procfs
+++ /dev/null
@@ -1,36 +0,0 @@
---- src/cmd/std/features/procfs.orig	2017-11-30 22:35:04 UTC
-+++ src/cmd/std/features/procfs
-@@ -1,6 +1,6 @@
- hdr	kvm,procinfo,pstat,asm/param
- 
--sys	procfs,sysctl
-+sys	procfs,sysctl,user
- 
- lib	getprocs
- lib	kvm_open,kvm_getprocs kvm.h sys/time.h sys/param.h sys/proc.h sys/sysctl.h -lkvm
-@@ -10,7 +10,11 @@ mem	extern_proc.p_pid,extern_proc.p_star
- mem	procsinfo64.pi_pri procinfo.h
- mem	prpsinfo.pr_clname,prpsinfo.pr_cstime,prpsinfo.pr_cstime.tv_sec,prpsinfo.pr_ctime,prpsinfo.pr_cutime,prpsinfo.pr_gid,prpsinfo.pr_lttydev,prpsinfo.pr_ntpid,prpsinfo.pr_pgid,prpsinfo.pr_pgrp,prpsinfo.pr_psargs,prpsinfo.pr_refcount,prpsinfo.pr_rssize,prpsinfo.pr_sid,prpsinfo.pr_sonproc,prpsinfo.pr_start,prpsinfo.pr_start.tv_sec,prpsinfo.pr_starttime,prpsinfo.pr_starttime.tv_sec,prpsinfo.pr_state,prpsinfo.pr_stime,prpsinfo.pr_tgrp,prpsinfo.pr_time,prpsinfo.pr_time.tv_sec,prpsinfo.pr_utime,prpsinfo.pr_zomb,prpsinfo.pr_pctcpu,prpsinfo.pr_cpu,prpsinfo.pr_lwp.pr_pctcpu,prpsinfo.pr_lwp.pr_cpu -D_STRUCTURED_PROC -Dprpsinfo=psinfo sys/types.h sys/procfs.h
- 
-+num	PIOCPSINFO
-+
- typ	struct.prpsinfo -D_STRUCTURED_PROC -Dprpsinfo=psinfo sys/types.h sys/procfs.h
-+typ	struct.kinfo_proc sys/types.h sys/procfs.h sys/user.h
-+typ	struct.kp_proc sys/types.h sys/procfs.h sys/user.h
- 
- tst	lib_info note{ info(2) kernel table api }end link{
- 	#include <info.h>
-@@ -587,11 +591,11 @@ cat{
- #define PSS_METHOD		PSS_METHOD_getprocs
- #endif
- 
--#if !PSS_METHOD && defined(_PS_dir)
-+#if !PSS_METHOD && defined(_PS_dir) && (_PS_scan_binary || _num_PIOCPSINFO)
- #define PSS_METHOD		PSS_METHOD_procfs
- #endif
- 
--#if !PSS_METHOD && _hdr_kvm && _sys_sysctl && _lib_kvm_open && _lib_kvm_getprocs
-+#if !PSS_METHOD && _hdr_kvm && _sys_sysctl && _lib_kvm_open && _lib_kvm_getprocs && _typ_struct_kinfo_proc && _typ_struct_kp_proc
- #define PSS_METHOD		PSS_METHOD_kvm
- #endif
- 
diff --git a/shells/ksh-devel/files/patch-src_cmd_std_pss-kvm.c b/shells/ksh-devel/files/patch-src_cmd_std_pss-kvm.c
deleted file mode 100644
index 4bd842573d48..000000000000
--- a/shells/ksh-devel/files/patch-src_cmd_std_pss-kvm.c
+++ /dev/null
@@ -1,12 +0,0 @@
---- src/cmd/std/pss-kvm.c.orig	2017-11-30 22:35:04 UTC
-+++ src/cmd/std/pss-kvm.c
-@@ -43,6 +43,9 @@ NoN(pss_kvm)
- #if _sys_proc
- #include <sys/proc.h>
- #endif
-+#if _sys_user
-+#include <sys/user.h>
-+#endif
- #include <sys/sysctl.h>
- #include <sys/tty.h>
- 
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_features_common b/shells/ksh-devel/files/patch-src_lib_libast_features_common
deleted file mode 100644
index 60007aea5563..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_features_common
+++ /dev/null
@@ -1,38 +0,0 @@
---- src/lib/libast/features/common.orig	2017-11-09 11:01:26.000000000 -0800
-+++ src/lib/libast/features/common	2020-02-22 20:00:11.166985000 -0800
-@@ -518,29 +518,12 @@
- 		printf("#include <varargs.h>\n");
- 		printf("#endif\n");
- 		printf("#endif\n");
--	#if TRY == 4
--		printf("#define va_listref(p) (&(p))\t");
--			printf("/* pass va_list to varargs function */\n");
--		printf("#define va_listval(p) (*(p))\t");
--			printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n");
--		printf("#define va_listarg va_list*\t");
--			printf("/* va_arg() va_list type */\n");
--	#else
--		varyfunny(&r);
--		printf("#define va_listref(p) (p)\t");
--			printf("/* pass va_list to varargs function */\n");
--		if (sizeof(va_list) > sizeof(void*))
--			printf("#define va_listval(p) (*(p))\t");
--		else
--			printf("#define va_listval(p) (p)\t");
--			printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n");
--	#if TRY == 2
--		printf("#define va_listarg va_list*\t");
--	#else
--		printf("#define va_listarg va_list\t");
--	#endif /*TRY == 2*/
--			printf("/* va_arg() va_list type */\n");
--	#endif /*TRY == 4*/
-+	printf("#define va_listref(p) (&(p))\t");
-+		printf("/* pass va_list to varargs function */\n");
-+	printf("#define va_listval(p) (*(p))\t");
-+		printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n");
-+	printf("#define va_listarg va_list*\t");
-+		printf("/* va_arg() va_list type */\n");
- 	
- 	#if _UWIN
- 		printf("#ifndef va_copy\n");
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_features_mmap b/shells/ksh-devel/files/patch-src_lib_libast_features_mmap
deleted file mode 100644
index 9690f24cc355..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_features_mmap
+++ /dev/null
@@ -1,36 +0,0 @@
---- src/lib/libast/features/mmap.orig	2020-02-08 10:39:38.000000000 -0800
-+++ src/lib/libast/features/mmap	2020-02-08 20:49:37.791733000 -0800
-@@ -16,14 +16,7 @@
- 
- 	#define Failed(file)	(remove(file),1)
- 
--	int
--	#if _STD_
--	main(int argc, char** argv)
--	#else
--	main(argc,argv)
--	int     argc;
--	char**  argv;
--	#endif
-+	int main(int argc, char** argv)
- 	{
- 		caddr_t		mm;
- 		char		*t, *u, *f;
-@@ -326,17 +319,12 @@
- cat{
- 
- 	/* some systems get it wrong but escape concise detection */
--	#ifndef _NO_MMAP
- 	#if __CYGWIN__
- 	#define _NO_MMAP	1
- 	#endif
--	#endif
- 
- 	#if _NO_MMAP
- 	#undef	_lib_mmap
- 	#undef	_lib_mmap64
--	#undef	_mmap_anon
--	#undef	_mmap_devzero
--	#undef	_mmap_worthy
- 	#endif
- }end
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_features_standards b/shells/ksh-devel/files/patch-src_lib_libast_features_standards
deleted file mode 100644
index 166362409d66..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_features_standards
+++ /dev/null
@@ -1,23 +0,0 @@
---- src/lib/libast/features/standards.orig	2020-02-08 10:39:38.000000000 -0800
-+++ src/lib/libast/features/standards	2020-02-08 21:58:23.687268000 -0800
-@@ -1,5 +1,19 @@
- set stdio
--if tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{
-+# In FreeBSD, definitions like _POSIX_SOURCE and such are used to *limit*
-+# functionality to known API; they don't enable anything. The general intent in
-+# BSD is to enable everything by default (effectively, providing the
-+# _KITCHEN_SINK_SOURCE mentioned below). So we look for that here, but stay
-+# careful that we don't get fooled by presence of FreeBSD that underpins some
-+# subsystems in Mac OS X; there are other Apple-specific portability hacks
-+# elsewhere we should not interfere with.
-+if tst note{ FreeBSD }end compile{
-+		#include <sys/param.h>
-+		#if !defined(__FreeBSD__) || defined(APPLE)
-+		#error not a FreeBSD system
-+		#endif
-+	}end {
-+	}
-+elif tst note{ _ALL_SOURCE & _POSIX_SOURCE & _POSIX_C_SOURCE & _XOPEN_SOURCE & __EXTENSIONS__ works }end compile{
- 		#define _ALL_SOURCE	1
- 		#define _POSIX_SOURCE	1
- 		#define _POSIX_C_SOURCE	21000101L
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_features_vmalloc b/shells/ksh-devel/files/patch-src_lib_libast_features_vmalloc
deleted file mode 100644
index a90f1e720ef3..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_features_vmalloc
+++ /dev/null
@@ -1,10 +0,0 @@
---- src/lib/libast/features/vmalloc.orig	2016-02-28 17:09:23 UTC
-+++ src/lib/libast/features/vmalloc
-@@ -217,7 +217,4 @@ cat{
- 	#if _mmap_anon
- 	#define _mem_mmap_anon	1
- 	#endif
--	#if _mmap_devzero
--	#define _mem_mmap_zero	1
--	#endif
- }end
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_port_astcopy.c b/shells/ksh-devel/files/patch-src_lib_libast_port_astcopy.c
deleted file mode 100644
index c0bef96c2a0e..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_port_astcopy.c
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/lib/libast/port/astcopy.c.orig	2016-02-28 17:09:23 UTC
-+++ src/lib/libast/port/astcopy.c
-@@ -30,14 +30,10 @@
- #include <ast.h>
- #include <ast_mmap.h>
- 
--#if _mmap_worthy > 1
--
- #include <ls.h>
- 
- #define MAPSIZE		(1024*256)
- 
--#endif
--
- #undef	BUFSIZ
- #define BUFSIZ		4096
- 
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_sfio_sfhdr.h b/shells/ksh-devel/files/patch-src_lib_libast_sfio_sfhdr.h
deleted file mode 100644
index ed668e576208..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_sfio_sfhdr.h
+++ /dev/null
@@ -1,12 +0,0 @@
---- src/lib/libast/sfio/sfhdr.h.orig	2016-02-28 17:09:23 UTC
-+++ src/lib/libast/sfio/sfhdr.h
-@@ -209,9 +209,6 @@
- 
- /* see if we can use memory mapping for io */
- #if _LARGEFILE64_SOURCE && !_lib_mmap64
--#undef _mmap_worthy
--#endif
--#if !_mmap_worthy
- #undef _hdr_mman
- #undef _sys_mman
- #endif
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_sfio_sfseek.c b/shells/ksh-devel/files/patch-src_lib_libast_sfio_sfseek.c
deleted file mode 100644
index 41e5cd15271a..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_sfio_sfseek.c
+++ /dev/null
@@ -1,24 +0,0 @@
---- src/lib/libast/sfio/sfseek.c.orig	2020-02-08 10:39:38.000000000 -0800
-+++ src/lib/libast/sfio/sfseek.c	2020-02-09 20:01:11.420655000 -0800
-@@ -204,18 +204,9 @@
- #ifdef MAP_TYPE
- 	if(f->bits&SF_MMAP)
- 	{	/* if mmap is not great, stop mmaping if moving around too much */
--#if _mmap_worthy < 2
--		if((f->next - f->data) < ((f->endb - f->data)/4) )
--		{	SFSETBUF(f,(Void_t*)f->tiny,(size_t)SF_UNBOUND);
--			hardseek = 1; /* this forces a hard seek below */
--		}
--		else
--#endif
--		{	/* for mmap, f->here can be virtual except for hardseek */
--			newpos(f,p);
--			if(!hardseek)
--				goto done;
--		}
-+		newpos(f,p);
-+		if(!hardseek)
-+			goto done;
- 	}
- #endif
- 
diff --git a/shells/ksh-devel/files/patch-src_lib_libast_string_strexpr.c b/shells/ksh-devel/files/patch-src_lib_libast_string_strexpr.c
deleted file mode 100644
index d4f706b9b147..000000000000
--- a/shells/ksh-devel/files/patch-src_lib_libast_string_strexpr.c
+++ /dev/null
@@ -1,87 +0,0 @@
---- src/lib/libast/string/strexpr.c.orig	2017-11-30 22:35:04 UTC
-+++ src/lib/libast/string/strexpr.c
-@@ -44,7 +44,7 @@
- #define peekchr(ex)	(*(ex)->nextchr)
- #define ungetchr(ex)	((ex)->nextchr--)
- 
--#define error(ex,msg)	return(seterror(ex,msg))
-+#define err(ex,msg)	return(seterror(ex,msg))
- 
- typedef struct				/* expression handle		*/
- {
-@@ -87,7 +87,7 @@ expr(register Expr_t* ex, register int p
- 	case 0:
- 		ungetchr(ex);
- 		if (!precedence) return(0);
--		error(ex, "more tokens expected");
-+		err(ex, "more tokens expected");
- 	case '-':
- 		n = -expr(ex, 13);
- 		break;
-@@ -113,17 +113,17 @@ expr(register Expr_t* ex, register int p
- 		case 0:
- 			goto done;
- 		case ')':
--			if (!precedence) error(ex, "too many )'s");
-+			if (!precedence) err(ex, "too many )'s");
- 			goto done;
- 		case '(':
- 			n = expr(ex, 1);
- 			if (getchr(ex) != ')')
- 			{
- 				ungetchr(ex);
--				error(ex, "closing ) expected");
-+				err(ex, "closing ) expected");
- 			}
- 		gotoperand:
--			if (operand) error(ex, "operator expected");
-+			if (operand) err(ex, "operator expected");
- 			operand = 1;
- 			continue;
- 		case '?':
-@@ -140,7 +140,7 @@ expr(register Expr_t* ex, register int p
- 				if (getchr(ex) != ':')
- 				{
- 					ungetchr(ex);
--					error(ex, ": expected for ? operator");
-+					err(ex, ": expected for ? operator");
- 				}
- 				if (n)
- 				{
-@@ -189,7 +189,7 @@ expr(register Expr_t* ex, register int p
- 			break;
- 		case '=':
- 		case '!':
--			if (peekchr(ex) != '=') error(ex, "operator syntax error");
-+			if (peekchr(ex) != '=') err(ex, "operator syntax error");
- 			if (precedence > 7) goto done;
- 			getchr(ex);
- 			x = expr(ex, 8);
-@@ -237,7 +237,7 @@ expr(register Expr_t* ex, register int p
- 			if (precedence > 11) goto done;
- 			x = expr(ex, 12);
- 			if (c == '*') n *= x;
--			else if (x == 0) error(ex, "divide by zero");
-+			else if (x == 0) err(ex, "divide by zero");
- 			else if (c == '/') n /= x;
- 			else n %= x;
- 			break;
-@@ -246,15 +246,15 @@ expr(register Expr_t* ex, register int p
- 			pos = --ex->nextchr;
- 			if (isdigit(c)) n = strton(ex->nextchr, &ex->nextchr, NiL, 0);
- 			else if (ex->convert) n = (*ex->convert)(ex->nextchr, &ex->nextchr, ex->handle);
--			if (ex->nextchr == pos) error(ex, "syntax error");
-+			if (ex->nextchr == pos) err(ex, "syntax error");
- 			goto gotoperand;
- 		}
- 		if (ex->errmsg) return(0);
--		if (!operand) error(ex, "operand expected");
-+		if (!operand) err(ex, "operand expected");
- 	}
-  done:
- 	ungetchr(ex);
--	if (!operand) error(ex, "operand expected");
-+	if (!operand) err(ex, "operand expected");
- 	return(n);
- }
- 
diff --git a/shells/ksh-devel/pkg-plist b/shells/ksh-devel/pkg-plist
index 86dc0057f028..39bd9a3d8408 100644
--- a/shells/ksh-devel/pkg-plist
+++ b/shells/ksh-devel/pkg-plist
@@ -1,6 +1,6 @@
 @shell bin/ksh%%93%%
 man/man1/ksh%%93%%.1.gz
-share/examples/ksh93/dirs
-share/examples/ksh93/popd
-share/examples/ksh93/pushd
+share/examples/ksh/dirs
+share/examples/ksh/popd
+share/examples/ksh/pushd