From b5127b03bee1ca2c97580acf34886cc8692ccdd0 Mon Sep 17 00:00:00 2001 From: tg Date: Sat, 25 Jun 2016 23:49:13 +0000 Subject: [PATCH] deprecate *not* using MKSH_CONSERVATIVE_FDS; named fds coming soon partially reverts commitid 10048752E6271CABA24 (the manpage, mostly) and adds a deprecation warning at build time; suggested by izabera --- Build.sh | 13 ++++++++----- mksh.1 | 17 ++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Build.sh b/Build.sh index f2ed0d7..de9a777 100644 --- a/Build.sh +++ b/Build.sh @@ -1,5 +1,5 @@ #!/bin/sh -srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.697 2016/03/04 18:28:39 tg Exp $' +srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.698 2016/06/25 23:49:12 tg Exp $' #- # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012, 2013, 2014, 2015, 2016 @@ -1646,9 +1646,12 @@ ac_ifcpp 'ifdef MKSH_NOPROSPECTOFWORK' isset_MKSH_NOPROSPECTOFWORK '' \ check_categories="$check_categories arge nojsig" ac_ifcpp 'ifdef MKSH_ASSUME_UTF8' isset_MKSH_ASSUME_UTF8 '' \ 'if the default UTF-8 mode is specified' && : "${HAVE_SETLOCALE_CTYPE=0}" -ac_ifcpp 'ifdef MKSH_CONSERVATIVE_FDS' isset_MKSH_CONSERVATIVE_FDS '' \ - 'if traditional/conservative fd use is requested' && \ - check_categories="$check_categories convfds" +if ac_ifcpp 'ifdef MKSH_CONSERVATIVE_FDS' isset_MKSH_CONSERVATIVE_FDS '' \ + 'if traditional/conservative fd use is requested'; then + check_categories="$check_categories convfds" +else + echo >&2 "WARNING: not building with -DMKSH_CONSERVATIVE_FDS is deprecated" +fi #ac_ifcpp 'ifdef MKSH_DISABLE_DEPRECATED' isset_MKSH_DISABLE_DEPRECATED '' \ # "if deprecated features are to be omitted" && \ # check_categories="$check_categories nodeprecated" @@ -2653,7 +2656,7 @@ MKSH_BINSHPOSIX if */sh or */-sh, enable set -o posix MKSH_BINSHREDUCED if */sh or */-sh, enable set -o sh MKSH_CLRTOEOL_STRING "\033[K" MKSH_CLS_STRING "\033[;H\033[J" -MKSH_CONSERVATIVE_FDS fd 0-9 for scripts, shell only up to 31 +MKSH_CONSERVATIVE_FDS fd 0-9 for scripts, shell only up to 31 (soon default) MKSH_DEFAULT_EXECSHELL "/bin/sh" (do not change) MKSH_DEFAULT_PROFILEDIR "/etc" (do not change) MKSH_DEFAULT_TMPDIR "/tmp" (do not change) diff --git a/mksh.1 b/mksh.1 index c43139e..a80ea56 100644 --- a/mksh.1 +++ b/mksh.1 @@ -1,4 +1,4 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.396 2016/06/25 23:48:10 tg Exp $ +.\" $MirOS: src/bin/mksh/mksh.1,v 1.397 2016/06/25 23:49:13 tg Exp $ .\" $OpenBSD: ksh.1,v 1.160 2015/07/04 13:27:04 feinerer Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, @@ -2456,16 +2456,19 @@ This is called a here string. Standard input is duplicated from file descriptor .Ar fd . .Ar fd -can be a number, indicating the number of an existing file descriptor; +can be a single digit, indicating the number of an existing file descriptor; the letter .Ql p , indicating the file descriptor associated with the output of the current co-process; or the character .Ql \- , indicating standard input is to be closed. -Note that -.Ar fd -is limited to a single digit in most shell implementations. +.Pp +Note that the current version of +.Nm +supports some two-digit fd numbers in some environments; +this feature is deprecated and will be removed from a subsequent release +in favour of a ksh93-/perl-style "named file descriptors" feature. .It \*(Gt& Ns Ar fd Same as .Ic \*(Lt& , @@ -2477,7 +2480,7 @@ This is a deprecated (legacy) GNU .Nm bash extension supported by .Nm -which also supports the preceding explicit fd number, for example, +which also supports the preceding explicit fd digit, for example, .Ic 3&\*(Gt Ns Ar file is the same as .Ic 3\*(Gt Ns Ar file 2\*(Gt&3 @@ -2506,7 +2509,7 @@ extensions. In any of the above redirections, the file descriptor that is redirected (i.e. standard input or standard output) can be explicitly given by preceding the -redirection with a number (portably, only a single digit). +redirection with a single digit. Parameter, command, and arithmetic substitutions, tilde substitutions, and (if the shell is interactive) file name generation are all performed on the