mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
Yet more accumulated tweaks and cleanups
Notable changes: src/cmd/ksh93/bltins/trap.c: b_trap(): - Disable the unadvertised 'trap + SIG' feature in POSIX mode; it's not compatible as '+' is a legitimate command name. src/cmd/ksh93/data/builtins.c: - Give "pwd", "alarm" and "times" the BLT_ENV flag for better performance. There is no need for those to be stoppable. src/cmd/ksh93/sh/xec.c: - sh_eval(): Remove a "temporary tksh hack" and associated sh.fn_reset flag. - sh_exec(): - Remove now-used 'unpipe' flag and one remaining dead check for it (re:a2196f94
,4b22fd5d
). - Fix unnecessary and confusing reuse of the 'type' variable. src/lib/libast/comp/conf.sh: - trap: Use 'rm -rf' instead of 'rm -f' to remove temp executables; on macOS, they may include *.dSYM directories.
This commit is contained in:
parent
4be7e53550
commit
627058e862
16 changed files with 91 additions and 75 deletions
|
@ -39,11 +39,9 @@ MAM commands have the following basic form:
|
|||
*command* [ *argument* [ *operand string* ] ]
|
||||
|
||||
The *command* name consists of four lower-case letters.
|
||||
Any other command name is an error.
|
||||
Unrecognized commands or attributes produce a warning and are then ignored.
|
||||
|
||||
The first argument is a single word.
|
||||
The operand string is any arbitrary text until the end of the line.
|
||||
Unrecognized commands or attributes are an error.
|
||||
The *argument* is a single word.
|
||||
The *operand string* is any arbitrary text until the end of the line.
|
||||
|
||||
### Comments ###
|
||||
|
||||
|
@ -61,7 +59,7 @@ Unless the `virtual` attribute is used, *rule* names the pathname of the file ge
|
|||
Dependencies may be defined in two ways:
|
||||
1. By nesting `make`...`done` blocks:
|
||||
the enclosing *rule* is the parent
|
||||
and the enclosed *rules* are the prerequisites.
|
||||
and the enclosed *rule*s are the prerequisites.
|
||||
2. By using the `prev` command (see **Referencing previously defined rules** below)
|
||||
to reference a previous `make`...`done` block.
|
||||
The dependency is defined as if that block were repeated at the `prev` command's location.
|
||||
|
@ -111,13 +109,11 @@ However, `mamake` ignores anything after *rule*.
|
|||
Defines a new MAM *variable*, optionally assigning the initial *defaultvalue*.
|
||||
If the *defaultvalue* begins and ends with double quotes (`"`), those are discarded.
|
||||
If the variable already has a value, the `setv` command is ignored; assigning a new value is not possible.
|
||||
|
||||
When `mamake` starts, it imports all environment variables as MAM variables,
|
||||
so any variable's default value can be overridden by exporting an environment variable by its name.
|
||||
|
||||
MAM variables are referenced using the sh-style `${`...`}` syntax, though the braces are *not* optional.
|
||||
Any reference to an undefined variable is silently left unexpanded (and not replaced by the empty string).
|
||||
|
||||
Expansion of MAM variable references is recursive, i.e., the value may itself contain other variable references.
|
||||
Beware: there is no reference loop detection.
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output
|
||||
12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo()
|
||||
12-06-20 package.sh: use $KSH for rt in "results test"
|
||||
|
|
|
@ -38,8 +38,9 @@ static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";
|
|||
static const char usage[] =
|
||||
"[-?\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\n]"
|
||||
"[-author?Glenn Fowler <gsf@research.att.com>]"
|
||||
"[-author?Contributors to https://github.com/ksh93/ksh]"
|
||||
"[-copyright?(c) 1994-2012 AT&T Intellectual Property]"
|
||||
"[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh]"
|
||||
"[-copyright?(c) 2020-2022 Contributors to ksh 93u+m]"
|
||||
"[-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
"[+NAME?mamake - make abstract machine make]"
|
||||
"[+DESCRIPTION?\bmamake\b reads \amake abstract machine\a target and"
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-02-28 pty.c: change --verbose[=level] to --debug=level
|
||||
12-01-26 pty.c: fix --man docs
|
||||
10-06-21 pty.c: add 4 sec timeout for initial handshake -- fix me!!
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
This file is of historic interest. For recent changes in both ksh 93u+m and
|
||||
the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-08-01 --- Release ksh93u+ ---
|
||||
|
|
|
@ -86,7 +86,7 @@ int b_trap(int argc,char *argv[],Shbltin_t *context)
|
|||
* if function semantics can be worked out then it
|
||||
* may merit a -d/--default option
|
||||
*/
|
||||
else if(*action=='+' && action[1]==0 && sh.st.self == &sh.global)
|
||||
else if(*action=='+' && action[1]==0 && sh.st.self == &sh.global && !sh_isoption(SH_POSIX))
|
||||
{
|
||||
clear++;
|
||||
dflag++;
|
||||
|
|
|
@ -122,11 +122,11 @@ const struct shtable3 shtab_builtins[] =
|
|||
#endif /* SHOPT_MKSERVICE */
|
||||
"print", NV_BLTIN|BLT_ENV, bltin(print),
|
||||
"printf", NV_BLTIN|BLT_ENV, bltin(printf),
|
||||
"pwd", NV_BLTIN, bltin(pwd),
|
||||
"pwd", NV_BLTIN|BLT_ENV, bltin(pwd),
|
||||
"read", NV_BLTIN|BLT_ENV, bltin(read),
|
||||
"sleep", NV_BLTIN, bltin(sleep),
|
||||
"alarm", NV_BLTIN, bltin(alarm),
|
||||
"times", NV_BLTIN|BLT_SPC, bltin(times),
|
||||
"alarm", NV_BLTIN|BLT_ENV, bltin(alarm),
|
||||
"times", NV_BLTIN|BLT_ENV|BLT_SPC, bltin(times),
|
||||
"ulimit", NV_BLTIN|BLT_ENV, bltin(ulimit),
|
||||
"umask", NV_BLTIN|BLT_ENV, bltin(umask),
|
||||
#ifdef _cmd_universe
|
||||
|
|
|
@ -141,7 +141,7 @@ struct Ufunction
|
|||
#define BLT_ENV (NV_RDONLY) /* non-stoppable,
|
||||
* can modify environment */
|
||||
#define BLT_SPC (NV_LJUST) /* special built-ins */
|
||||
#define BLT_EXIT (NV_RJUST) /* exit value can be > 255 */
|
||||
#define BLT_EXIT (NV_RJUST) /* exit value can be > 255 or < 0 */
|
||||
#define BLT_DCL (NV_TAGGED) /* declaration command */
|
||||
#define BLT_NOSFIO (NV_IMPORT) /* doesn't use sfio */
|
||||
#define NV_OPTGET (NV_BINARY) /* function calls getopts */
|
||||
|
|
|
@ -337,7 +337,6 @@ struct Shell_s
|
|||
struct argnod *envlist;
|
||||
struct dolnod *arglist;
|
||||
int fn_depth; /* scoped ksh-style function call depth */
|
||||
int fn_reset;
|
||||
int dot_depth; /* dot-script and POSIX function call depth */
|
||||
int hist_depth;
|
||||
int xargmin;
|
||||
|
@ -381,14 +380,16 @@ struct Shell_s
|
|||
Namfun_t nvfun;
|
||||
char *mathnodes;
|
||||
char *bltin_dir;
|
||||
struct Regress_s*regress;
|
||||
#if SHOPT_FILESCAN
|
||||
char *cur_line;
|
||||
#endif
|
||||
#endif /* SHOPT_FILESCAN */
|
||||
#if !SHOPT_DEVFD
|
||||
char *fifo; /* FIFO name for current process substitution */
|
||||
Dt_t *fifo_tree; /* for cleaning up process substitution FIFOs */
|
||||
#endif /* !SHOPT_DEVFD */
|
||||
#if SHOPT_REGRESS
|
||||
struct Regress_s *regress;
|
||||
#endif /* SHOPT_REGRESS */
|
||||
};
|
||||
|
||||
/* used for builtins */
|
||||
|
|
|
@ -4710,7 +4710,9 @@ Remove all but the extension.
|
|||
\f3s/\fP\f2l\fP\f3/\fP\f2r\fP\f3/\fP
|
||||
Substitute \f2l\fP for \f2r\fP.
|
||||
\f2l\fP is simply a string like \f2r\fP,
|
||||
not a regular expression as in the eponymous \f2ed\fP(1) command.
|
||||
not a regular expression as in the eponymous
|
||||
.IR ed (1)
|
||||
command.
|
||||
Any character may be used as the delimiter in place of \f3/\fP;
|
||||
a \f3\\\fP can be used to quote the delimiter inside \f2l\fP and \f2r\fP.
|
||||
The character \f3&\fP in the \f2r\fP is replaced by \f2l\fP;
|
||||
|
@ -5952,7 +5954,8 @@ section from their manual page, and
|
|||
.B \-?
|
||||
as a request to print a brief usage message.
|
||||
All these are processed as error messages, so they are written on standard
|
||||
error (file descriptor 2) and to pipe them into a pager such as \fBmore\fR(1)
|
||||
error (file descriptor 2) and to pipe them into a pager such as
|
||||
.IR more (1)
|
||||
you need to add a \fB2>&1\fR redirection before the \fB|\fR. The display of
|
||||
boldface text depends on whether standard error is on a terminal, so is
|
||||
disabled when using a pager. Exporting the \fBERROR_OPTIONS\fR environment
|
||||
|
@ -9134,41 +9137,41 @@ file when the real and effective user or group ID do not match.
|
|||
.B /dev/null
|
||||
NULL device
|
||||
.SH SEE ALSO
|
||||
cat(1),
|
||||
cd(1),
|
||||
chmod(1),
|
||||
cut(1),
|
||||
date(1),
|
||||
egrep(1),
|
||||
echo(1),
|
||||
emacs(1),
|
||||
env(1),
|
||||
fgrep(1),
|
||||
gmacs(1),
|
||||
grep(1),
|
||||
stty(1),
|
||||
test(1),
|
||||
umask(1),
|
||||
vi(1),
|
||||
dup(2),
|
||||
exec(2),
|
||||
fork(2),
|
||||
getpwnam(3),
|
||||
ioctl(2),
|
||||
lseek(2),
|
||||
paste(1),
|
||||
pathconf(2),
|
||||
pipe(2),
|
||||
sysconf(3),
|
||||
umask(2),
|
||||
ulimit(2),
|
||||
wait(2),
|
||||
strftime(3),
|
||||
wctrans(3),
|
||||
rand(3),
|
||||
a.out(5),
|
||||
profile(5),
|
||||
environ(7).
|
||||
.IR cat (1),
|
||||
.IR cd (1),
|
||||
.IR chmod (1),
|
||||
.IR cut (1),
|
||||
.IR date (1),
|
||||
.IR egrep (1),
|
||||
.IR echo (1),
|
||||
.IR emacs (1),
|
||||
.IR env (1),
|
||||
.IR fgrep (1),
|
||||
.IR gmacs (1),
|
||||
.IR grep (1),
|
||||
.IR stty (1),
|
||||
.IR test (1),
|
||||
.IR umask (1),
|
||||
.IR vi (1),
|
||||
.IR dup (2),
|
||||
.IR exec (2),
|
||||
.IR fork (2),
|
||||
.IR getpwnam (3),
|
||||
.IR ioctl (2),
|
||||
.IR lseek (2),
|
||||
.IR paste (1),
|
||||
.IR pathconf (2),
|
||||
.IR pipe (2),
|
||||
.IR sysconf (3),
|
||||
.IR umask (2),
|
||||
.IR ulimit (2),
|
||||
.IR wait (2),
|
||||
.IR strftime (3),
|
||||
.IR wctrans (3),
|
||||
.IR rand (3),
|
||||
.IR a.out (5),
|
||||
.IR profile (5),
|
||||
.IR environ (7).
|
||||
.PP
|
||||
Morris I. Bolsky and David G. Korn,
|
||||
.IR "The New KornShell Command and Programming Language" ,
|
||||
|
|
|
@ -683,12 +683,6 @@ int sh_eval(register Sfio_t *iop, int mode)
|
|||
io_save = iop; /* preserve correct value across longjmp */
|
||||
sh.binscript = 0;
|
||||
sh.comsub = 0;
|
||||
#define SH_TOPFUN 0x8000 /* this is a temporary tksh hack */
|
||||
if (mode & SH_TOPFUN)
|
||||
{
|
||||
mode ^= SH_TOPFUN;
|
||||
sh.fn_reset = 1;
|
||||
}
|
||||
sh_pushcontext(buffp,SH_JMPEVAL);
|
||||
buffp->olist = pp->olist;
|
||||
jmpval = sigsetjmp(buffp->buff,0);
|
||||
|
@ -735,7 +729,6 @@ int sh_eval(register Sfio_t *iop, int mode)
|
|||
|
||||
sh_freeup();
|
||||
sh.st.staklist = saveslp;
|
||||
sh.fn_reset = 0;
|
||||
if(jmpval>SH_JMPEVAL)
|
||||
siglongjmp(*sh.jmplist,jmpval);
|
||||
return(sh.exitval);
|
||||
|
@ -925,16 +918,15 @@ static int check_exec_optimization(int type, int execflg, int execflg2, struct i
|
|||
int sh_exec(register const Shnode_t *t, int flags)
|
||||
{
|
||||
Stk_t *stkp = sh.stk;
|
||||
int unpipe=0;
|
||||
sh_sigcheck();
|
||||
if(t && !sh.st.execbrk && !sh_isoption(SH_NOEXEC))
|
||||
{
|
||||
register int type = flags;
|
||||
register int type = t->tre.tretyp;
|
||||
register char *com0 = 0;
|
||||
int errorflg = (type&sh_state(SH_ERREXIT))|OPTIMIZE;
|
||||
int execflg = (type&sh_state(SH_NOFORK));
|
||||
int execflg2 = (type&sh_state(SH_FORKED));
|
||||
int mainloop = (type&sh_state(SH_INTERACTIVE));
|
||||
int errorflg = (flags&sh_state(SH_ERREXIT))|OPTIMIZE;
|
||||
int execflg = (flags&sh_state(SH_NOFORK));
|
||||
int execflg2 = (flags&sh_state(SH_FORKED));
|
||||
int mainloop = (flags&sh_state(SH_INTERACTIVE));
|
||||
int topfd = sh.topfd;
|
||||
char *sav=stkfreeze(stkp,0);
|
||||
char *cp=0, **com=0, *comn;
|
||||
|
@ -957,7 +949,6 @@ int sh_exec(register const Shnode_t *t, int flags)
|
|||
sh_offstate(SH_DEFPATH);
|
||||
if(!(flags & sh_state(SH_ERREXIT)))
|
||||
sh_offstate(SH_ERREXIT);
|
||||
type = t->tre.tretyp;
|
||||
sh.exitval=0;
|
||||
sh.lastsig = 0;
|
||||
sh.lastpath = 0;
|
||||
|
@ -1382,6 +1373,10 @@ int sh_exec(register const Shnode_t *t, int flags)
|
|||
siglongjmp(*sh.jmplist,jmpval);
|
||||
if(sh.exitval >=0)
|
||||
goto setexit;
|
||||
/*
|
||||
* If a built-in sets sh.exitval < 0 (must be allowed by BLT_EXIT attribute),
|
||||
* then fall through to TFORK which runs the external command by that name
|
||||
*/
|
||||
np = 0;
|
||||
type=0;
|
||||
}
|
||||
|
@ -1587,8 +1582,6 @@ int sh_exec(register const Shnode_t *t, int flags)
|
|||
}
|
||||
if(sh.topfd > topfd)
|
||||
sh_iorestore(topfd,0);
|
||||
if(usepipe && tsetio && subdup && unpipe)
|
||||
sh_iounpipe();
|
||||
if(!sh_isstate(SH_MONITOR))
|
||||
sigrelease(SIGINT);
|
||||
}
|
||||
|
@ -2926,8 +2919,6 @@ pid_t _sh_fork(register pid_t parent,int flags,int *jobid)
|
|||
sh.login_sh = 0;
|
||||
sh_offoption(SH_LOGIN_SHELL);
|
||||
sh_onstate(SH_FORKED);
|
||||
if (sh.fn_reset)
|
||||
sh.fn_depth = sh.fn_reset = 0;
|
||||
#if SHOPT_ACCT
|
||||
sh_accsusp();
|
||||
#endif /* SHOPT_ACCT */
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-07-25 pathprobe.c: fix read() loop to handle EINTR
|
||||
12-06-28 vmalloc/malloc.c: use sbrk() unless VMALLOC_OPTIONS=mmap or asoinit(0,0,0)!=0 (workaround until next malloc update)
|
||||
12-06-28 aso/aso.c: asoinit(0,0,0): 0: no specific init, 1: app initialized
|
||||
|
|
|
@ -112,7 +112,7 @@ esac
|
|||
|
||||
rm -f $tmp.*
|
||||
case $debug in
|
||||
'') trap "code=\$?; rm -f $tmp.*; exit \$code" 0 1 2 ;;
|
||||
'') trap "code=\$?; rm -rf $tmp.*; exit \$code" 0 1 2 ;;
|
||||
esac
|
||||
|
||||
# determine the intmax_t printf format
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-06-25 getconf.c: don't defer to native getconf if we are it -- doh
|
||||
12-06-19 tail.c: be nice and use sh_sigcheck() and tvsleep() to verify interrupts
|
||||
12-05-31 cat,head,tee: use errno==EPIPE => ERROR_PIPE(errno)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-07-25 add debug diagnostics
|
||||
11-10-11 dll_lib.c: add { dllnames() dll_lib() }
|
||||
10-10-20 dllscan.c: version arg "-" => 0
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
This file is of historical interest only. For recent changes in both ksh 93u+m
|
||||
and the accompanying libraries, see the file NEWS in the top-level directory.
|
||||
____
|
||||
|
||||
12-02-29 sum-sha2.c: bitcount[] order reversed to allow a single noalias buffer copy
|
||||
09-09-28 sumlib.c: use simple (faster) method name match function
|
||||
08-06-05 sum-lmd.c: align context to largest int
|
||||
|
|
Loading…
Reference in a new issue