1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

New selection of default libcmd /opt/ast/bin built-ins

Note that this is only about the /opt/ast/bin built-in commands,
not about the regular pathless builtins such as printf.
To use these, either add /opt/ast/bin to your $PATH or use a
command like 'builtin cp'. As usual, --man provides info.

Removed as defaults for lack of convincing advantages over the OS's
external commands:
- chmod, cmp, head, logname, mkdir, sync, uname, wc

Remain as useful defaults:
- basename, cat, cut, dirname. These are commonly used in
  performance-sensitive code paths in scripts and having them as
  built-ins can be good for performance.
- getconf: This is the only interface to some libast internals that
  is available to ksh. It's also has better functionality than most
  OS-shipped 'getconf' commands, e.g., it can list and query all
  the configuration values.

Added as defaults:
- cp, ln, mv: Having these built in can speed up scripts that
  manage files. Also the AST versions have extended functionality
  (see cp --man, etc.).
- mktemp: External mktemp commands vary too widely and are
  incompatible, but it's important that scripts can securely make
  temporary files, so it's good to ship a known interface to this
  functionality.

As a result, the statically linked ksh binary is very slightly
smaller than before.

Resolves: https://github.com/ksh93/ksh/issues/349
This commit is contained in:
Martijn Dekker 2021-12-16 08:48:06 +01:00
parent 60e0687cec
commit 7cdb01f625
3 changed files with 13 additions and 11 deletions

6
NEWS
View file

@ -3,6 +3,12 @@ For full details, see the git log at: https://github.com/ksh93/ksh
Any uppercase BUG_* names are modernish shell bug IDs.
2021-12-16:
- Changed the default selection of compiled-in /opt/ast/bin built-in libcmd
command to: basename, cat, cp, cut, dirname, getconf, ln, mktemp, mv.
Add /opt/ast/bin to your $PATH to use these. Type 'cp --man', etc. for info.
2021-12-13:
- Fixed a bug introduced on 2020-08-09 that prevented '.' and '..' from

View file

@ -135,18 +135,14 @@ const struct shtable3 shtab_builtins[] =
#include SHOPT_CMDLIB_HDR
#else
CMDLIST(basename)
CMDLIST(chmod)
CMDLIST(cat)
CMDLIST(cp)
CMDLIST(cut)
CMDLIST(dirname)
CMDLIST(getconf)
CMDLIST(head)
CMDLIST(mkdir)
CMDLIST(logname)
CMDLIST(cat)
CMDLIST(cmp)
CMDLIST(cut)
CMDLIST(uname)
CMDLIST(wc)
CMDLIST(sync)
CMDLIST(ln)
CMDLIST(mktemp)
CMDLIST(mv)
#if !_std_malloc && !_AST_std_malloc
CMDLIST(vmstate) /* vmstate only works with vmalloc */
#endif

View file

@ -21,7 +21,7 @@
#define SH_RELEASE_FORK "93u+m" /* only change if you develop a new ksh93 fork */
#define SH_RELEASE_SVER "1.0.0-beta.2" /* semantic version number: https://semver.org */
#define SH_RELEASE_DATE "2021-12-13" /* must be in this format for $((.sh.version)) */
#define SH_RELEASE_DATE "2021-12-16" /* must be in this format for $((.sh.version)) */
#define SH_RELEASE_CPYR "(c) 2020-2021 Contributors to ksh " SH_RELEASE_FORK
/* Scripts sometimes field-split ${.sh.version}, so don't change amount of whitespace. */