dtksh: Upgrade ksh93 to 1.0.0-beta.2 2021-12-28
Patch from current ksh93 maintainer <https://github.com/ksh93/ksh>. cde/programs/dtksh/ksh93/**: - Upgraded. A load of bugs fixed, some minor features added. See NEWS from 2021-02-01 upwards. cde/programs/dtksh/Makefile.am: - Don't cd into ksh93 any more to invoke the package or shtests scripts; they now automatically find their directories. - Pass $(CFLAGS) to build ksh with optimisation. - Remove -D_std_malloc flag as vmalloc is now deprecated and disabled by default. - Add a 'make check' target to Makefile.am that runs the ksh93 regression tests on dtksh to make sure the additions don't interfere with anything. It skips running the tests with shcomp because CDE doesn't use that. The tests all pass here on Slackware 14.2. :-) cde/programs/dtksh/init.patch: - Removed; I've upstreamed it. It was the only one that wasn't upstreamed yet, and more code cleanups are coming, breaking downstream patches. If something needs updating, just email me a diff. cde/programs/dtksh/dtkcmds.h: - Update the ADDBUILTIN macro to remove the __PROTO__ macro use. The proto(1) tool, responsible for all such pre-C89 K&R C compatibility voodoo, has been removed, so that macro is no longer defined. cde/programs/dtksh/setup.sh: - Workaround script removed. I rewrote 'bin/package flat make' in a way that works correctly and changed Makefile.am to use that instead. Hope this helps. Happy new year.
This commit is contained in:
committed by
Jon Trulson
parent
d5e651ecf3
commit
bf00d3b274
@@ -1,260 +0,0 @@
|
||||
/*
|
||||
* {automake|configure} => {nmake|iffe} conversion support
|
||||
*
|
||||
* The first command line target overrides the default original source
|
||||
* directory name $(MAKEFILE:D). The hard work is in the makefile using
|
||||
* these assertions, since it must (manually) provide the nmake makefiles
|
||||
* and config equivalent iffe scripts. The conversion makefile is typically
|
||||
* named lib/package/PACKAGE.cvt in an ast package $PACKAGEROOT directory,
|
||||
* and the conversion is run from the $PACKAGEROOT directory, e.g.:
|
||||
*
|
||||
* nmake -I lib/package -f PACKAGE-VERSION/PACKAGE.cvt
|
||||
*
|
||||
* The conversion requires the ast nmake, pax and tw commands.
|
||||
*
|
||||
* After the conversion you will be liberated from ./configure, *.in,
|
||||
* *.am, automake, autom4te, libtool, make depend, and makefile
|
||||
* recursion ordering. You can build from $PACKAGEROOT using the ast
|
||||
* package(1) (which sets up the { HOSTTYPE PATH VPATH } environment):
|
||||
*
|
||||
* package make
|
||||
*
|
||||
* or cd into any arch/$HOSTTYPE/src subdirectory and rebuild that portion
|
||||
* of the hierarchy with the ast nmake(1) (after setting PATH and VPATH):
|
||||
*
|
||||
* nmake
|
||||
*
|
||||
* The conversion assertions are:
|
||||
*
|
||||
* package :CONVERT: file ...
|
||||
*
|
||||
* files in the original source directory are copied
|
||||
* and converted into the ./src and ./lib subdirectories
|
||||
* the default original source directory is ./original
|
||||
*
|
||||
* package package name
|
||||
* file original source file that must exist
|
||||
*
|
||||
* :OMIT: pattern
|
||||
*
|
||||
* files matching pattern are not copied into the converted
|
||||
* directory
|
||||
*
|
||||
* pattern ksh pattern of files to omit
|
||||
*
|
||||
* :COPY: from to [ file ... ]
|
||||
*
|
||||
* files in the from directory are copied to the to directory
|
||||
* the action may contain :MOVE: exceptions to the copy
|
||||
*
|
||||
* from original directory subdirectory
|
||||
* . names the original directory
|
||||
* .. names the
|
||||
* to converted subdirectory
|
||||
* libNAME => src/lib/libNAME
|
||||
* NAME => src/cmd/NAME
|
||||
* file files or files in subdirectories to be copied;
|
||||
* explicit files are copied to the to directory;
|
||||
* if no files are specified then the from hierarchy
|
||||
* is recursively copied to the converted directory
|
||||
*
|
||||
* :MOVE: to file ...
|
||||
*
|
||||
* :COPY: assertion exceptions placed in the assertion's action
|
||||
*
|
||||
* to files or subdirectory files are copied to this directory
|
||||
* file file or files in subdirectories to be copied
|
||||
*
|
||||
* :FILE: to file <<!
|
||||
* contents
|
||||
* !
|
||||
*
|
||||
* the :FILE: action is copied to the named file in the to directory
|
||||
* the :FILE: action is usually specified using the here syntax to
|
||||
* avoid make comment, quote and variable expansion
|
||||
*
|
||||
* :EDIT: to file ... | - pattern <<!
|
||||
* edit script
|
||||
* !
|
||||
*
|
||||
* the :EDIT: action is an ed(1) script applied to each file in the
|
||||
* to directory after it has been copied from the original source
|
||||
* directory; if to is - then the :EDIT: action is a sed(1) script
|
||||
* that is applied to all files matching the file pattern during the
|
||||
* copy from the original source directory; a file may be subject to
|
||||
* both a sed(1) and ed(1) :EDIT:; the :EDIT: action is usually
|
||||
* specified using the here syntax to avoid make comment, quote and
|
||||
* variable expansion
|
||||
*/
|
||||
|
||||
.CONVERT.ID. = "@(#)$Id: CONVERT (AT&T Research) 2004-03-19 $"
|
||||
|
||||
set nojobs noscan nowriteobject writestate=$$(MAKEFILE).ms
|
||||
|
||||
package = $(PWD:B)
|
||||
here = !-=-=-=-=-!
|
||||
hierarchy = src src/cmd src/lib
|
||||
omit = .*|*.?(l)[ao]
|
||||
original = $(MAKEFILE:D)
|
||||
showedit = $(-debug:?p??)
|
||||
|
||||
CPFLAGS = -u
|
||||
PAXFLAGS = -u -v
|
||||
STDEDFLAGS = -
|
||||
TW = tw
|
||||
TWFLAGS = -CP
|
||||
|
||||
all : .VIRTUAL file
|
||||
file : .VIRTUAL edit
|
||||
edit : .VIRTUAL copy
|
||||
copy : .VIRTUAL init
|
||||
init : .VIRTUAL
|
||||
|
||||
.MAKEINIT : .cvt.init
|
||||
|
||||
.cvt.init : .MAKE .VIRTUAL .FORCE
|
||||
local D
|
||||
if D = "$(~.ARGS:O=1)"
|
||||
if "$(D:T>FD)"
|
||||
original := $(D)
|
||||
.ARGS : .CLEAR $(~.ARGS:O>1)
|
||||
end
|
||||
end
|
||||
|
||||
.cvt.filter =
|
||||
.cvt.package =
|
||||
|
||||
.cvt.atom : .FUNCTION
|
||||
local N V
|
||||
V := $(%:O=1)
|
||||
let .cvt.$(V) = .cvt.$(V) + 1
|
||||
return .cvt.$(V).$(.cvt.$(V))
|
||||
|
||||
.cvt.omit : .FUNCTION
|
||||
return -s',^\(\(?K)?(*/)($(omit))?(/*))$,,$(showedit)'
|
||||
|
||||
.cvt.to : .FUNCTION
|
||||
if "$(%)" == "."
|
||||
return src
|
||||
end
|
||||
if "$(%)" == "*/*"
|
||||
return src/$(%)
|
||||
end
|
||||
if "$(%)" == "lib*"
|
||||
return src/lib/$(%)
|
||||
end
|
||||
return src/cmd/$(%)
|
||||
|
||||
":CONVERT:" : .MAKE .OPERATOR
|
||||
local I
|
||||
package := $(<)
|
||||
I := $(hierarchy:C,$,/Makefile)
|
||||
init : .cvt.verify $(I)
|
||||
$(I) : .ACCEPT
|
||||
test -d $(<:D) || $(MKDIR) -p $(<:D)
|
||||
echo :MAKE: > $(<)
|
||||
.cvt.verify : .MAKE .FORCE .REPEAT
|
||||
local I
|
||||
if I = "$(.cvt.package:T!=F)"
|
||||
error 3 $(original): not a $(package) source directory: missing $(I)
|
||||
end
|
||||
.cvt.package := $(>:C,^,$$(original)/,)
|
||||
|
||||
":COPY:" : .MAKE .OPERATOR
|
||||
local F T I A
|
||||
F := $(>:O=1)
|
||||
T := $(.cvt.to $(>:O=2))
|
||||
A := $(.cvt.atom copy)
|
||||
copy : $(A)
|
||||
$(A) : .VIRTUAL
|
||||
if F == "."
|
||||
$(A) : $(T)
|
||||
$(T) :
|
||||
test -d $(<) || $(MKDIR) -p $(<)
|
||||
for I $(>:O>2)
|
||||
eval
|
||||
$$(A) : $(I:D=$(T):B:S)
|
||||
$(I:D=$(T):B:S) : $$(original)/$(I)
|
||||
$$(CP) $$(CPFLAGS) $$(*) $$(<)
|
||||
end
|
||||
end
|
||||
elif "$(F:T=FF)" || "$(F:N=*.(pax|t[bg]z))"
|
||||
eval
|
||||
$$(A) : $$(F)
|
||||
test -d $(T) || $$(MKDIR) -p $(T)
|
||||
cd $(T)
|
||||
$$(PAX) $$(PAXFLAGS) -rf $$(*:P=A) -s ',^$(>:O=2)/*,,' $(.cvt.omit) $(.cvt.filter)
|
||||
end
|
||||
else
|
||||
F := $$(original)/$(F)
|
||||
if ! "$(@:V)"
|
||||
eval
|
||||
$$(A) : .FORCE
|
||||
test -d $(T) || $$(MKDIR) -p $(T)
|
||||
cd $(F:V)
|
||||
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.filter) $(T:P=A)
|
||||
end
|
||||
else
|
||||
.cvt.move =
|
||||
: $(@:V:@R)
|
||||
eval
|
||||
$$(A) : .FORCE
|
||||
test -d $(T) || $$(MKDIR) -p $(T)
|
||||
cd $(F:V)
|
||||
$$(TW) $$(TWFLAGS) | $$(PAX) $$(PAXFLAGS) -rw $(.cvt.omit) $(.cvt.move) $(.cvt.filter) $(T:P=A)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
":EDIT:" : .MAKE .OPERATOR
|
||||
local A D F
|
||||
D := $(>:O=1)
|
||||
if D == "-"
|
||||
A := ^$(>:O=2)^$$(SED) -e $(@:Q:/'\n'/ -e /G)
|
||||
.cvt.filter += --action=$(A:@Q)
|
||||
else
|
||||
D := $(.cvt.to $(D))
|
||||
F := $(>:O>1:C,^,$(D)/,)
|
||||
edit : $(F)
|
||||
eval
|
||||
$$(F) :
|
||||
$$(STDED) $$(STDEDFLAGS) $$(<) <<'$(here)'
|
||||
$(@:V)
|
||||
w
|
||||
q
|
||||
$(here)
|
||||
end
|
||||
end
|
||||
|
||||
":FILE:" : .MAKE .OPERATOR
|
||||
local ( D F ) $(>)
|
||||
local A
|
||||
A := $(.cvt.atom file)
|
||||
$(A) := $(@:V)
|
||||
D := $(.cvt.to $(D))
|
||||
file : $(D)/$(F)
|
||||
eval
|
||||
$$(D)/$$(F) :
|
||||
test -d $$(<:D) || $$(MKDIR) -p $$(<:D)
|
||||
cat > $$(<) <<'$(here)'
|
||||
$$($(A):V)
|
||||
$(here)
|
||||
end
|
||||
|
||||
":MOVE:" : .MAKE .OPERATOR
|
||||
local T I
|
||||
T := ../../../$(.cvt.to $(>:O=1))
|
||||
for I $(>:O>1)
|
||||
if I == "*/"
|
||||
.cvt.move += -s',^\(\(?K)$(I)),$(T)/,$(showedit)'
|
||||
.cvt.move += -s',^\(\(?K)$(I:C%/$%%))$,,$(showedit)'
|
||||
else
|
||||
.cvt.move += -s',^\(\(?K)$(I))$,$(T)/$(I:B:S),$(showedit)'
|
||||
end
|
||||
end
|
||||
|
||||
":OMIT:" : .MAKE .OPERATOR
|
||||
local P
|
||||
for P $(>)
|
||||
omit := $(omit)|$(P)
|
||||
end
|
||||
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* normalize local -l* library conventions
|
||||
*
|
||||
* L [ [ G11 ... G1n ] ... [ Gg1 ... Ggn ] ] :MAPLIB: T1.c ... Tn.c
|
||||
*
|
||||
* if Giji not specified then G11 == L
|
||||
* the first Ti.c that compiles/links with group -lGi1 ... -lGin
|
||||
* but does not compile/link with no libraries maps
|
||||
* -lL to require -lGi1 ... -lGin
|
||||
* otherwise -lL is not required and maps to "no library required"
|
||||
*/
|
||||
|
||||
":MAPLIB:" : .MAKE .OPERATOR
|
||||
local L P
|
||||
L := $(<:B:O=1)
|
||||
if ! ( P = "$(<:B:O>1)" )
|
||||
P := $(L)
|
||||
end
|
||||
$(LIBDIR)/lib/$(L) :INSTALL: $(L).req
|
||||
eval
|
||||
$(L).req : (CC) $$(>)
|
||||
set -
|
||||
r='-'
|
||||
for i in $$(*)
|
||||
do if $$(CC) -c $i > /dev/null
|
||||
then g=
|
||||
for p in $(P) -
|
||||
do case $p in
|
||||
-) if $$(CC) -o $$(<:B:S=.exe) $i $g > /dev/null 2>&1
|
||||
then $$(CC) -o $$(<:B:S=.exe) $i > /dev/null 2>&1 || {
|
||||
r="$g"
|
||||
break 2
|
||||
}
|
||||
fi
|
||||
g=
|
||||
;;
|
||||
*) g="$g -l$p"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
done 2>/dev/null
|
||||
echo " $r" > $$(<)
|
||||
rm -f $$(<:B:S=.exe) $$(*:B:S=$$(CC.SUFFIX.OBJECT))
|
||||
end
|
||||
@@ -1,2 +0,0 @@
|
||||
/* stub for pre-2000-05-01 nmake */
|
||||
":MSGFUN:" : .MAKE .OPERATOR
|
||||
@@ -1,2 +0,0 @@
|
||||
/* stub for pre-2000-05-01 nmake */
|
||||
":MSGKEY:" : .MAKE .OPERATOR
|
||||
@@ -10,88 +10,19 @@ note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~g
|
||||
note *
|
||||
setv INSTALLROOT ../../..
|
||||
setv PACKAGEROOT ../../../../..
|
||||
setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS}
|
||||
setv ARFLAGS rc
|
||||
setv AS as
|
||||
setv ASFLAGS
|
||||
setv CC cc
|
||||
setv mam_cc_FLAGS
|
||||
setv KSH_RELFLAGS
|
||||
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
|
||||
setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??}
|
||||
setv COTEMP $$
|
||||
setv CPIO cpio
|
||||
setv CPIOFLAGS
|
||||
setv CPP "${CC} -E"
|
||||
setv F77 f77
|
||||
setv HOSTCC ${CC}
|
||||
setv IGNORE
|
||||
setv LD ld
|
||||
setv LDFLAGS
|
||||
setv LEX lex
|
||||
setv LEXFLAGS
|
||||
setv LPR lpr
|
||||
setv LPRFLAGS
|
||||
setv M4FLAGS
|
||||
setv NMAKE nmake
|
||||
setv NMAKEFLAGS
|
||||
setv PR pr
|
||||
setv PRFLAGS
|
||||
setv SHELL /bin/sh
|
||||
setv SILENT
|
||||
setv TAR tar
|
||||
setv YACC yacc
|
||||
setv YACCFLAGS -d
|
||||
make ${PACKAGEROOT}/lib/package/ast.lic
|
||||
done ${PACKAGEROOT}/lib/package/ast.lic
|
||||
make install
|
||||
make hurl
|
||||
make hurl.sh
|
||||
done hurl.sh
|
||||
meta hurl %.sh>% hurl.sh hurl
|
||||
prev hurl.sh
|
||||
setv LICENSE -DLICENSE="since=2003,author=gsf"
|
||||
exec - case static,port:$OPTIND:$RANDOM in
|
||||
exec - ?*:*:*|*::*|*:*:$RANDOM)
|
||||
exec - ;;
|
||||
exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null
|
||||
exec - then if grep '### .*archaic.* ###' >/dev/null
|
||||
exec - then : hurl contains archaic constructs :
|
||||
exec - else ENV= LC_ALL=C $SHELL -n hurl.sh
|
||||
exec - fi
|
||||
exec - fi
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - case '${mam_cc_SHELLMAGIC}' in
|
||||
exec - "") case 184 in
|
||||
exec - 0) cp hurl.sh hurl
|
||||
exec - ;;
|
||||
exec - *) {
|
||||
exec - i=`(read x; echo $x) < hurl.sh`
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - hurl.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - } > hurl
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - hurl.sh > hurl <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2003-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - test -w hurl -a -x hurl || chmod u+w,+x hurl
|
||||
done hurl generated
|
||||
make iffe
|
||||
make iffe.sh
|
||||
done iffe.sh
|
||||
meta iffe %.sh>% iffe.sh iffe
|
||||
prev iffe.sh
|
||||
setv LICENSE -DLICENSE="since=1994,author=gsf+kpv"
|
||||
exec - case static,port:$OPTIND:$RANDOM in
|
||||
exec - ?*:*:*|*::*|*:*:$RANDOM)
|
||||
exec - ;;
|
||||
@@ -112,16 +43,13 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - iffe.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Phong Vo <kpv@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat iffe.sh
|
||||
exec - } > iffe
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - iffe.sh > iffe <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Phong Vo <kpv@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
@@ -132,7 +60,6 @@ make install
|
||||
done mktest.sh
|
||||
meta mktest %.sh>% mktest.sh mktest
|
||||
prev mktest.sh
|
||||
setv LICENSE -DLICENSE="since=2005,author=gsf"
|
||||
exec - case static,port:$OPTIND:$RANDOM in
|
||||
exec - ?*:*:*|*::*|*:*:$RANDOM)
|
||||
exec - ;;
|
||||
@@ -153,16 +80,13 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - mktest.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat mktest.sh
|
||||
exec - } > mktest
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - mktest.sh > mktest <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
@@ -193,16 +117,13 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - package.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat package.sh
|
||||
exec - } > package
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - package.sh > package <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
@@ -213,7 +134,6 @@ make install
|
||||
done regress.sh
|
||||
meta regress %.sh>% regress.sh regress
|
||||
prev regress.sh
|
||||
setv LICENSE -DLICENSE="since=1995,author=gsf"
|
||||
exec - case static,port:$OPTIND:$RANDOM in
|
||||
exec - ?*:*:*|*::*|*:*:$RANDOM)
|
||||
exec - ;;
|
||||
@@ -234,16 +154,13 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - regress.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat regress.sh
|
||||
exec - } > regress
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - regress.sh > regress <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
@@ -254,7 +171,6 @@ make install
|
||||
done rt.sh
|
||||
meta rt %.sh>% rt.sh rt
|
||||
prev rt.sh
|
||||
setv LICENSE -DLICENSE="since=2005,author=gsf"
|
||||
exec - case static,port:$OPTIND:$RANDOM in
|
||||
exec - ?*:*:*|*::*|*:*:$RANDOM)
|
||||
exec - ;;
|
||||
@@ -275,16 +191,13 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - rt.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat rt.sh
|
||||
exec - } > rt
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - rt.sh > rt <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
@@ -315,68 +228,23 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - crossexec.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat crossexec.sh
|
||||
exec - } > crossexec
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - crossexec.sh > crossexec <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - test -w crossexec -a -x crossexec || chmod u+w,+x crossexec
|
||||
done crossexec generated
|
||||
make ditto
|
||||
make ditto.sh
|
||||
done ditto.sh
|
||||
meta ditto %.sh>% ditto.sh ditto
|
||||
prev ditto.sh
|
||||
setv LICENSE -DLICENSE="since=2001,author=gsf+ek"
|
||||
exec - case static,port:$OPTIND:$RANDOM in
|
||||
exec - ?*:*:*|*::*|*:*:$RANDOM)
|
||||
exec - ;;
|
||||
exec - *) if ENV= LC_ALL=C x= $SHELL -nc '[[ a || b ]] && : ${list[level]} !(pattern)' 2>/dev/null
|
||||
exec - then if grep '### .*archaic.* ###' >/dev/null
|
||||
exec - then : ditto contains archaic constructs :
|
||||
exec - else ENV= LC_ALL=C $SHELL -n ditto.sh
|
||||
exec - fi
|
||||
exec - fi
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - case '${mam_cc_SHELLMAGIC}' in
|
||||
exec - "") case 232 in
|
||||
exec - 0) cp ditto.sh ditto
|
||||
exec - ;;
|
||||
exec - *) {
|
||||
exec - i=`(read x; echo $x) < ditto.sh`
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - ditto.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Lefty Koutsofios <ek@research.att.com>][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - } > ditto
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - ditto.sh > ditto <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-author?Lefty Koutsofios <ek@research.att.com>][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - test -w ditto -a -x ditto || chmod u+w,+x ditto
|
||||
done ditto generated
|
||||
make execrate
|
||||
make execrate.sh
|
||||
done execrate.sh
|
||||
meta execrate %.sh>% execrate.sh execrate
|
||||
prev execrate.sh
|
||||
setv LICENSE -DLICENSE="since=2002,author=gsf"
|
||||
exec - case static,port:$OPTIND:$RANDOM in
|
||||
exec - ?*:*:*|*::*|*:*:$RANDOM)
|
||||
exec - ;;
|
||||
@@ -397,16 +265,13 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - execrate.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat execrate.sh
|
||||
exec - } > execrate
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - execrate.sh > execrate <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
@@ -437,16 +302,13 @@ make install
|
||||
exec - case $i in
|
||||
exec - '#!'*|*'||'*|':'*|'":"'*|"':'"*) echo "$i" ;;
|
||||
exec - esac
|
||||
exec - cat - filter.sh <<'!'
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - cat filter.sh
|
||||
exec - } > filter
|
||||
exec - ;;
|
||||
exec - esac
|
||||
exec - ;;
|
||||
exec - *) cat - filter.sh > filter <<'!'
|
||||
exec - ${mam_cc_SHELLMAGIC}
|
||||
exec - USAGE_LICENSE="[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
exec - !
|
||||
exec - ;;
|
||||
exec - esac
|
||||
@@ -542,56 +404,10 @@ make install
|
||||
done mamake.c
|
||||
meta mamake.o %.c>%.o mamake.c mamake
|
||||
prev mamake.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"\" -c mamake.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c mamake.c
|
||||
done mamake.o generated
|
||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o mamake mamake.o
|
||||
done mamake generated
|
||||
make proto
|
||||
make proto.o
|
||||
make proto.c
|
||||
done proto.c
|
||||
meta proto.o %.c>%.o proto.c proto
|
||||
prev proto.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c proto.c
|
||||
done proto.o generated
|
||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o proto proto.o
|
||||
done proto generated
|
||||
make ratz
|
||||
make ratz.o
|
||||
make ratz.c
|
||||
make unix.h implicit
|
||||
done unix.h dontcare virtual
|
||||
make alloc.h implicit
|
||||
done alloc.h dontcare virtual
|
||||
make unixio.h implicit
|
||||
done unixio.h dontcare virtual
|
||||
make ast_std.h implicit
|
||||
done ast_std.h dontcare virtual
|
||||
make windows.h implicit
|
||||
done windows.h dontcare virtual
|
||||
make io.h implicit
|
||||
done io.h dontcare virtual
|
||||
make direct.h implicit
|
||||
done direct.h dontcare virtual
|
||||
prev ast.h implicit
|
||||
done ratz.c
|
||||
meta ratz.o %.c>%.o ratz.c ratz
|
||||
prev ratz.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -c ratz.c
|
||||
done ratz.o generated
|
||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o ratz ratz.o
|
||||
done ratz generated
|
||||
make release
|
||||
make release.o
|
||||
make release.c
|
||||
prev ast.h implicit
|
||||
done release.c
|
||||
meta release.o %.c>%.o release.c release
|
||||
prev release.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]"\" -c release.c
|
||||
done release.o generated
|
||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -o release release.o
|
||||
done release generated
|
||||
make mprobe
|
||||
make mprobe.sh
|
||||
done mprobe.sh
|
||||
@@ -682,11 +498,6 @@ make install
|
||||
exec - then mkdir -p ${INSTALLROOT}/bin
|
||||
exec - fi
|
||||
done ${INSTALLROOT}/bin generated
|
||||
make ${INSTALLROOT}/bin/hurl
|
||||
prev ${INSTALLROOT}/bin
|
||||
prev hurl
|
||||
exec - test '' = 'hurl' || ${STDCMP} 2>/dev/null -s hurl ${INSTALLROOT}/bin/hurl || { ${STDMV} ${INSTALLROOT}/bin/hurl ${INSTALLROOT}/bin/hurl.old 2>/dev/null || true; ${STDCP} hurl ${INSTALLROOT}/bin/hurl ;}
|
||||
done ${INSTALLROOT}/bin/hurl generated
|
||||
make ${INSTALLROOT}/bin/iffe
|
||||
prev iffe
|
||||
exec - test '' = 'iffe' || ${STDCMP} 2>/dev/null -s iffe ${INSTALLROOT}/bin/iffe || { ${STDMV} ${INSTALLROOT}/bin/iffe ${INSTALLROOT}/bin/iffe.old 2>/dev/null || true; ${STDCP} iffe ${INSTALLROOT}/bin/iffe ;}
|
||||
@@ -775,86 +586,24 @@ make install
|
||||
prev crossexec
|
||||
exec - test '' = 'crossexec' || ${STDCMP} 2>/dev/null -s crossexec ${INSTALLROOT}/bin/crossexec || { ${STDMV} ${INSTALLROOT}/bin/crossexec ${INSTALLROOT}/bin/crossexec.old 2>/dev/null || true; ${STDCP} crossexec ${INSTALLROOT}/bin/crossexec ;}
|
||||
done ${INSTALLROOT}/bin/crossexec generated
|
||||
make ${INSTALLROOT}/bin/ditto
|
||||
prev ditto
|
||||
exec - test '' = 'ditto' || ${STDCMP} 2>/dev/null -s ditto ${INSTALLROOT}/bin/ditto || { ${STDMV} ${INSTALLROOT}/bin/ditto ${INSTALLROOT}/bin/ditto.old 2>/dev/null || true; ${STDCP} ditto ${INSTALLROOT}/bin/ditto ;}
|
||||
done ${INSTALLROOT}/bin/ditto generated
|
||||
make ${INSTALLROOT}/bin/filter
|
||||
prev filter
|
||||
exec - test '' = 'filter' || ${STDCMP} 2>/dev/null -s filter ${INSTALLROOT}/bin/filter || { ${STDMV} ${INSTALLROOT}/bin/filter ${INSTALLROOT}/bin/filter.old 2>/dev/null || true; ${STDCP} filter ${INSTALLROOT}/bin/filter ;}
|
||||
done ${INSTALLROOT}/bin/filter generated
|
||||
make ${PACKAGEROOT}/lib/package
|
||||
exec - if test ! -d ${PACKAGEROOT}/lib/package
|
||||
exec - then mkdir -p ${PACKAGEROOT}/lib/package
|
||||
exec - fi
|
||||
done ${PACKAGEROOT}/lib/package generated
|
||||
make ${PACKAGEROOT}/lib/package/package.mk
|
||||
prev ${PACKAGEROOT}/lib/package
|
||||
make package.mk
|
||||
done package.mk
|
||||
exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${PACKAGEROOT}/lib/package/package.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/package.mk ${PACKAGEROOT}/lib/package/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${PACKAGEROOT}/lib/package/package.mk ;}
|
||||
done ${PACKAGEROOT}/lib/package/package.mk generated
|
||||
make ${PACKAGEROOT}/lib/package/CONVERT.mk
|
||||
make CONVERT.mk
|
||||
done CONVERT.mk
|
||||
exec - test '' = 'CONVERT.mk' || ${STDCMP} 2>/dev/null -s CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk || { ${STDMV} ${PACKAGEROOT}/lib/package/CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk.old 2>/dev/null || true; ${STDCP} CONVERT.mk ${PACKAGEROOT}/lib/package/CONVERT.mk ;}
|
||||
done ${PACKAGEROOT}/lib/package/CONVERT.mk generated
|
||||
make ${INSTALLROOT}/lib/make
|
||||
exec - if test ! -d ${INSTALLROOT}/lib/make
|
||||
exec - then mkdir -p ${INSTALLROOT}/lib/make
|
||||
exec - fi
|
||||
done ${INSTALLROOT}/lib/make generated
|
||||
make ${INSTALLROOT}/lib/make/package.mk
|
||||
prev ${INSTALLROOT}/lib/make
|
||||
prev package.mk
|
||||
exec - test '' = 'package.mk' || ${STDCMP} 2>/dev/null -s package.mk ${INSTALLROOT}/lib/make/package.mk || { ${STDMV} ${INSTALLROOT}/lib/make/package.mk ${INSTALLROOT}/lib/make/package.mk.old 2>/dev/null || true; ${STDCP} package.mk ${INSTALLROOT}/lib/make/package.mk ;}
|
||||
done ${INSTALLROOT}/lib/make/package.mk generated
|
||||
make ${INSTALLROOT}/lib/make/PROBE.mk
|
||||
make PROBE.mk
|
||||
done PROBE.mk
|
||||
exec - test '' = 'PROBE.mk' || ${STDCMP} 2>/dev/null -s PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk || { ${STDMV} ${INSTALLROOT}/lib/make/PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk.old 2>/dev/null || true; ${STDCP} PROBE.mk ${INSTALLROOT}/lib/make/PROBE.mk ;}
|
||||
done ${INSTALLROOT}/lib/make/PROBE.mk generated
|
||||
make ${INSTALLROOT}/lib/make/TEST.mk
|
||||
make TEST.mk
|
||||
done TEST.mk
|
||||
exec - test '' = 'TEST.mk' || ${STDCMP} 2>/dev/null -s TEST.mk ${INSTALLROOT}/lib/make/TEST.mk || { ${STDMV} ${INSTALLROOT}/lib/make/TEST.mk ${INSTALLROOT}/lib/make/TEST.mk.old 2>/dev/null || true; ${STDCP} TEST.mk ${INSTALLROOT}/lib/make/TEST.mk ;}
|
||||
done ${INSTALLROOT}/lib/make/TEST.mk generated
|
||||
make ${INSTALLROOT}/lib/make/WWW.mk
|
||||
make WWW.mk
|
||||
done WWW.mk
|
||||
exec - test '' = 'WWW.mk' || ${STDCMP} 2>/dev/null -s WWW.mk ${INSTALLROOT}/lib/make/WWW.mk || { ${STDMV} ${INSTALLROOT}/lib/make/WWW.mk ${INSTALLROOT}/lib/make/WWW.mk.old 2>/dev/null || true; ${STDCP} WWW.mk ${INSTALLROOT}/lib/make/WWW.mk ;}
|
||||
done ${INSTALLROOT}/lib/make/WWW.mk generated
|
||||
make ${INSTALLROOT}/lib/make/MSGFUN.mk
|
||||
make MSGFUN.mk
|
||||
done MSGFUN.mk
|
||||
exec - test '' = 'MSGFUN.mk' || ${STDCMP} 2>/dev/null -s MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk.old 2>/dev/null || true; ${STDCP} MSGFUN.mk ${INSTALLROOT}/lib/make/MSGFUN.mk ;}
|
||||
done ${INSTALLROOT}/lib/make/MSGFUN.mk generated
|
||||
make ${INSTALLROOT}/lib/make/MSGKEY.mk
|
||||
make MSGKEY.mk
|
||||
done MSGKEY.mk
|
||||
exec - test '' = 'MSGKEY.mk' || ${STDCMP} 2>/dev/null -s MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk.old 2>/dev/null || true; ${STDCP} MSGKEY.mk ${INSTALLROOT}/lib/make/MSGKEY.mk ;}
|
||||
done ${INSTALLROOT}/lib/make/MSGKEY.mk generated
|
||||
make ${INSTALLROOT}/lib/make/MAPLIB.mk
|
||||
make MAPLIB.mk
|
||||
done MAPLIB.mk
|
||||
exec - test '' = 'MAPLIB.mk' || ${STDCMP} 2>/dev/null -s MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk || { ${STDMV} ${INSTALLROOT}/lib/make/MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk.old 2>/dev/null || true; ${STDCP} MAPLIB.mk ${INSTALLROOT}/lib/make/MAPLIB.mk ;}
|
||||
done ${INSTALLROOT}/lib/make/MAPLIB.mk generated
|
||||
make ${INSTALLROOT}/bin/mamake
|
||||
prev mamake
|
||||
exec - test '' = 'mamake' || ${STDCMP} 2>/dev/null -s mamake ${INSTALLROOT}/bin/mamake || { ${STDMV} ${INSTALLROOT}/bin/mamake ${INSTALLROOT}/bin/mamake.old 2>/dev/null || true; ${STDCP} mamake ${INSTALLROOT}/bin/mamake ;}
|
||||
done ${INSTALLROOT}/bin/mamake generated
|
||||
make ${INSTALLROOT}/bin/proto
|
||||
prev proto
|
||||
exec - test '' = 'proto' || ${STDCMP} 2>/dev/null -s proto ${INSTALLROOT}/bin/proto || { ${STDMV} ${INSTALLROOT}/bin/proto ${INSTALLROOT}/bin/proto.old 2>/dev/null || true; ${STDCP} proto ${INSTALLROOT}/bin/proto ;}
|
||||
done ${INSTALLROOT}/bin/proto generated
|
||||
make ${INSTALLROOT}/bin/ratz
|
||||
prev ratz
|
||||
exec - test '' = 'ratz' || ${STDCMP} 2>/dev/null -s ratz ${INSTALLROOT}/bin/ratz || { ${STDMV} ${INSTALLROOT}/bin/ratz ${INSTALLROOT}/bin/ratz.old 2>/dev/null || true; ${STDCP} ratz ${INSTALLROOT}/bin/ratz ;}
|
||||
done ${INSTALLROOT}/bin/ratz generated
|
||||
make ${INSTALLROOT}/bin/release
|
||||
prev release
|
||||
exec - test '' = 'release' || ${STDCMP} 2>/dev/null -s release ${INSTALLROOT}/bin/release || { ${STDMV} ${INSTALLROOT}/bin/release ${INSTALLROOT}/bin/release.old 2>/dev/null || true; ${STDCP} release ${INSTALLROOT}/bin/release ;}
|
||||
done ${INSTALLROOT}/bin/release generated
|
||||
make __proto_stub
|
||||
note *
|
||||
note * proto(1) has been removed, but install a backwards compatibility stub
|
||||
note * that allows old Mamfiles containing proto commands to keep working.
|
||||
note *
|
||||
exec - src=${PACKAGEROOT}/src/cmd/INIT/proto.sh
|
||||
exec - dst=${INSTALLROOT}/bin/proto
|
||||
exec - ${STDCMP} 2>/dev/null -s $src $dst || { ${STDMV} $dst $dst.old 2>/dev/null || true; ${STDCP} $src $dst ;}
|
||||
exec - test -w $dst && test -x $dst || chmod u+w,+x $dst
|
||||
done __proto_stub dontcare virtual
|
||||
make ${INSTALLROOT}/bin/mkdir
|
||||
make mkdir.sh
|
||||
done mkdir.sh
|
||||
@@ -1089,18 +838,6 @@ make install
|
||||
exec - then mkdir -p ${INSTALLROOT}/include/ast
|
||||
exec - fi
|
||||
done ${INSTALLROOT}/include/ast generated
|
||||
make ${INSTALLROOT}/include/ast/prototyped.h
|
||||
prev ${INSTALLROOT}/include/ast
|
||||
make prototyped.h
|
||||
prev ${INSTALLROOT}/bin/proto
|
||||
exec - proto -f /dev/null > h.${COTEMP}.h
|
||||
exec - if cmp 2>/dev/null -s h.${COTEMP}.h prototyped.h
|
||||
exec - then rm -f h.${COTEMP}.h
|
||||
exec - else mv h.${COTEMP}.h prototyped.h
|
||||
exec - fi
|
||||
done prototyped.h generated
|
||||
exec - test '' = 'prototyped.h' || ${STDCMP} 2>/dev/null -s prototyped.h ${INSTALLROOT}/include/ast/prototyped.h || { ${STDMV} ${INSTALLROOT}/include/ast/prototyped.h ${INSTALLROOT}/include/ast/prototyped.h.old 2>/dev/null || true; ${STDCP} prototyped.h ${INSTALLROOT}/include/ast/prototyped.h ;}
|
||||
done ${INSTALLROOT}/include/ast/prototyped.h generated
|
||||
make ${INSTALLROOT}/lib/lib
|
||||
exec - if test ! -d ${INSTALLROOT}/lib/lib
|
||||
exec - then mkdir -p ${INSTALLROOT}/lib/lib
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
/*
|
||||
* @(#)probe (AT&T Bell Laboratories) 11/11/91
|
||||
*
|
||||
* <lang> <tool> :PROBE: *.probe *.sh *
|
||||
*
|
||||
* common probe script installation
|
||||
* generates probe.sh and probe in .
|
||||
*/
|
||||
|
||||
":PROBE:" : .MAKE .OPERATOR
|
||||
probe.sh : $(LIBDIR)/probe/$(<:O=1)/probe $(>:N=*.(probe|sh))
|
||||
cat $(*) > $(<)
|
||||
$(LIBDIR)/probe/$(<:O=1)/$(<:O=2) :INSTALLDIR: probe $(>:N!=*.(probe|sh))
|
||||
@@ -8,7 +8,7 @@
|
||||
12-06-06 iffe.sh: check for -l* in reverse and accumulative order (e.g., for -last & -lm)
|
||||
12-06-04 package.sh: always check $INSTALLROOT/lib/package/profile
|
||||
12-05-31 Makefile: ID=ast; $(INSTALLROOT)/prototyped.h => $(INSTALLROOT)/$(ID)/prototyped.h
|
||||
12-05-28 iffe.sh: api foo YYYYMMDD => FOOAPI(rel) test macro
|
||||
12-05-28 iffe.sh: API foo YYYYMMDD => FOOAPI(rel) test macro
|
||||
12-05-24 package.sh: change admin.db comment => owner attributes
|
||||
12-04-25 ratz.c: add sear -k option to keep installation tmp dir on exit
|
||||
12-04-17 package.sh: skip sh version logic for ``use''
|
||||
@@ -90,14 +90,14 @@
|
||||
09-10-21 iffe.sh,Makefile: test -e is not in ksh88!
|
||||
09-10-06 iffe.sh: handle cc -E #error with 0 exit status (sgi)
|
||||
09-10-06 package.sh: stub in ar intercept checks -- not used yet
|
||||
09-10-06 ar.ibm.risc: add ar intercept because some aix require -Xfoo first!!
|
||||
09-10-06 ar.ibm.risc: add ar intercept because some AIX require -Xfoo first!!
|
||||
09-09-24 regress.sh: fix UMASK logic to create test support files before umask
|
||||
09-08-28 release.c: change docs to mention stdin if no file operands
|
||||
09-08-24 package.sh: fix isascii() bug that failed on od(1) trailing space
|
||||
09-08-20 make.probe: add CC.SHARED.NAME
|
||||
09-08-20 regress.sh: add { JOB CONTINUE EXITED KILL FIFO }
|
||||
09-08-11 package.sh: filter lines containing : for package results
|
||||
09-07-31 make.probe: add CC.AR.ARFLAGS (for aix ar -xany)
|
||||
09-07-31 make.probe: add CC.AR.ARFLAGS (for AIX ar -xany)
|
||||
09-07-31 package.sh,cc.*: fix -dumpmachine to handle 32/64/* bit options
|
||||
09-06-24 package.sh: fix admin.db output formatting
|
||||
09-05-05 package.sh: export dll hackery environment vars
|
||||
@@ -145,7 +145,7 @@
|
||||
08-04-28 regress.sh: fix EXPORT quoting
|
||||
08-04-28 regress.sh: fix UNIT set check args too
|
||||
08-04-24 rt.sh: exit code > 256 => signal termination
|
||||
08-04-10 C+probe: change probe_so order to check .so last (macos ld workaround)
|
||||
08-04-10 C+probe: change probe_so order to check .so last (Mac OS X ld workaround)
|
||||
08-04-01 package.sh: handle multiple admin HOSTTYPEs per HOST
|
||||
08-03-28 C+probe: add C++ #include <iostream> (no extension) dir probes
|
||||
08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally
|
||||
@@ -153,8 +153,8 @@
|
||||
08-02-02 make.probe: add CC.RUNPATH to match default -L order
|
||||
08-01-31 package.sh: check lib64 for LD_LIBRARY_PATH
|
||||
08-01-31 iffe.sh: tweak ancient /bin/sh workarounds
|
||||
08-01-28 make.probe: darwin ld export dynamic is -force_flat_namespace
|
||||
08-01-28 C+probe: handle sgi cc error message but exit 0 botch(es)
|
||||
08-01-28 make.probe: Darwin ld export dynamic is -force_flat_namespace
|
||||
08-01-28 C+probe: handle SGI cc error message but exit 0 botch(es)
|
||||
08-01-23 package.sh: fix checksum doc typo
|
||||
08-01-09 C+probe: add __FUNCTION__ to the undef (don't check) list
|
||||
07-12-14 iffe.sh: add set nooptimize
|
||||
@@ -222,8 +222,8 @@
|
||||
06-03-05 make.probe: work around pedantic bash 3.1 mismatched " in `.`
|
||||
06-02-14 package.sh: "results failed test" == "results test failed"
|
||||
cc.sgi.*: add _AST_cc_OPTIONS parameterization, -OPT:Olimit=0
|
||||
cc.linux.ia64-icc: add for intel cc
|
||||
06-02-02 package.sh: freebsd stuck with os version for all arch
|
||||
cc.linux.ia64-icc: add for Intel cc
|
||||
06-02-02 package.sh: FreeBSD stuck with OS version for all arch
|
||||
06-02-01 package.mk: fix locale logic (tw -d requires dir arg)
|
||||
06-01-31 package.sh: require $CC only for make|test
|
||||
06-01-30 package.sh,hurl.sh: use the backwards-compatible --http-passwd
|
||||
@@ -233,9 +233,9 @@
|
||||
hurl.sh: wget --http-pass => --http-password
|
||||
06-01-11 package.mk: pass package.license.class to make --mam too
|
||||
package.mk: variants=pattern => --variants=pattern
|
||||
package.sh: darwin rel<=7 => darwin7.ppc
|
||||
package.sh: freebsd rel<=4 => freebsd4
|
||||
package.sh: freebsd rel<=5 => freebsd5
|
||||
package.sh: Darwin rel<=7 => darwin7.ppc
|
||||
package.sh: FreeBSD rel<=4 => freebsd4
|
||||
package.sh: FreeBSD rel<=5 => freebsd5
|
||||
05-12-07 iffe.sh: don't emit <stdio.h> if <sfio.h>|<ast.h> (XXX)
|
||||
05-12-05 make.probe: disable readonly.exe core dump via ulimit -c 0
|
||||
05-09-22 mktest.sh: add EXEC [ ++NOOUTPUT ++NOERROR ++NOEXIT ]
|
||||
@@ -261,7 +261,7 @@
|
||||
iffe.sh: fix 'op var - ... - ...' grouping logic
|
||||
05-04-15 rt.sh: handle autom4ate style
|
||||
05-04-11 regress.sh: fix unit name when command line unit also specified
|
||||
rt.sh: handle all ast package test output formats
|
||||
rt.sh: handle all AST package test output formats
|
||||
package.sh: fix make docs for options passed to underlying make
|
||||
05-04-08 package.sh: cp -p makerules.mo to $OK to preserve mtime
|
||||
regress.sh: add "TITLE name" to change TEST output title
|
||||
@@ -276,7 +276,7 @@
|
||||
package.sh: admin action now properly resets sibling remote logs
|
||||
package.mk: relax unknown/unwritten package messages to warnings
|
||||
package.sh: handle space in command line name=value
|
||||
make.probe: add mvs -Wc,dll,exportall,longname,rent to CC.DLL probe
|
||||
make.probe: add MVS -Wc,dll,exportall,longname,rent to CC.DLL probe
|
||||
05-02-24 package.sh: hosttype *.powerpc => *.ppc
|
||||
cc.lynxos.ppc,ldd.lynxos.ppc: add
|
||||
05-02-22 mamake.c: fix { -G --debug-symbols -S --strip-symbols } MAMAKEFLAGS bug
|
||||
@@ -329,7 +329,7 @@
|
||||
package.mk: add the runtime package type (no *.[ah])
|
||||
iffe.sh: fix key test reports
|
||||
04-08-26 Makefile: { add m2.c m3.c } -lm tests for { frexp[l] ldexp[l] }
|
||||
04-08-11 package.mk: handle HOSTTYPE for solaris > 9
|
||||
04-08-11 package.mk: handle HOSTTYPE for Solaris > 9
|
||||
package.sh: add `checkaout proto' for { make view }
|
||||
package.sh: check for { md5sum md5 }
|
||||
iffe.sh: add {if|elif|else|endif} test ...
|
||||
@@ -355,7 +355,7 @@
|
||||
regress.sh: INPUT and OUTPUT handle -f for printf instead of print
|
||||
04-06-11 package.sh: make sure $INSTALLROOT/bin is in front of $PATH
|
||||
package.sh: skip nmake if older than 2000-10-31
|
||||
04-05-20 package.sh: fix arg vs. package parse with - or '' to disambuguate
|
||||
04-05-20 package.sh: fix arg vs. package parse with - or '' to disambiguate
|
||||
04-05-11 package.sh: package verbose update lists closure for package setup
|
||||
package.sh: add src/lib/libardir to nmake proto bootstrap
|
||||
regress.sh: probe for rm -u vs. chmod -R u+rwx
|
||||
@@ -387,7 +387,7 @@
|
||||
04-03-18 iffe.sh: -d2 does not remove core dumps on exit
|
||||
04-03-17 package.sh: fix make recurse arg/action order
|
||||
04-02-29 package.sh: add regress action to compare current and previous tests
|
||||
package.sh: fix sgi.mips[23] HOSTTYPE test for old irix cc
|
||||
package.sh: fix sgi.mips[23] HOSTTYPE test for old IRIX cc
|
||||
package.sh: add `export variable ...'
|
||||
package.sh: admin action now handles host name with non-id chars
|
||||
package.sh: non-numeric M T W in admin.db disables that action
|
||||
@@ -423,7 +423,7 @@
|
||||
03-09-23 ratz.c: fix tar header number parse bug that skipped to next number
|
||||
regress.sh: rm cleanup now handles files matching -*
|
||||
03-09-11 iffe.sh: add unnamed { ... } blocks
|
||||
regress.sh: add COPY from to, like MOVE but comprison still done
|
||||
regress.sh: add COPY from to, like MOVE but comparison still done
|
||||
regress.sh: rm -rfu to handle test dirs w/o u+rwx
|
||||
03-08-14 Makefile: add hello.c to the manifest
|
||||
03-08-11 package.sh: fix `html binary' generation
|
||||
@@ -447,9 +447,9 @@
|
||||
03-06-04 make.probe: add +forceread +noforceread
|
||||
03-05-11 hurl.sh: handle http://host:port/path
|
||||
03-05-06 package.sh: fix setup action PACKAGEROOT and INIT logic
|
||||
03-05-05 package.mk: fix cygwin tarball names
|
||||
03-05-05 package.mk: fix Cygwin tarball names
|
||||
03-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile
|
||||
03-04-27 make.probe: fix mvs CC.PREFIX.SHARED "lib" => ""
|
||||
03-04-27 make.probe: fix MVS CC.PREFIX.SHARED "lib" => ""
|
||||
make.probe: add CC.DLL.DIR = $(BINDIR) or $(LIBDIR)
|
||||
make.probe: add { CC.LD.LAZY CC.LD.NOLAZY CC.LD.RECORD CC.LD.NORECORD }
|
||||
probe.win32: sync with latest CC.*
|
||||
@@ -467,7 +467,7 @@
|
||||
03-04-11 package.mk: tidy up cyg tarballs
|
||||
package.sh: fix old shell clash between get() and $get
|
||||
03-04-05 package.mk: restore *.inx generation somehow lost during cyg additions
|
||||
package.sh: add pthread_num_processors_np() last resort for cpu count
|
||||
package.sh: add pthread_num_processors_np() last resort for CPU count
|
||||
package.sh: use `make believe' to accept mamake generated files
|
||||
package.sh: handle `make [make-flags] [target ...]'
|
||||
mamake.c: ignore -e
|
||||
@@ -475,14 +475,14 @@
|
||||
package.sh: switch to `package setup' instructions
|
||||
03-03-19 package.sh: add registry checks for `host cpu'
|
||||
package.sh: `results failed' now lists core dump messages
|
||||
03-03-17 package.sh: on cygwin verify 'ntsec binmode' in $CYGWIN or die
|
||||
03-03-17 package.sh: on Cygwin verify 'ntsec binmode' in $CYGWIN or die
|
||||
Makefile: install gcc wrapper if no cc
|
||||
package.mk: add :DETAILS: { :README: :EXPORT: :INSTALL: :TEST: } ops
|
||||
03-03-12 package.mk: add :DETAILS: for style-specific details
|
||||
03-03-11 package.sh: add beta setup/update support
|
||||
TEST.mk: add (TESTCC) prereq for .sh tests
|
||||
03-03-07 hurl.sh: add
|
||||
03-03-06 iffe.sh: fix lib win32 test cygwin vs native incompatibility
|
||||
03-03-06 iffe.sh: fix lib Win32 test Cygwin vs native incompatibility
|
||||
iffe.sh: change internal stdio.h guard to handle C++ inline vs. macro
|
||||
03-03-03 package.sh: check for curl or wget for update
|
||||
package.sh: add setup action == update read make
|
||||
@@ -490,7 +490,7 @@
|
||||
mamake.c: treat name+=value args like name=value
|
||||
mamake.c: add ${var?*|value?match?no-match?}
|
||||
mamake.c: fix archive vs. dynamic bind logic
|
||||
03-02-28 package.sh: add the "cyg" (cygwin) package type
|
||||
03-02-28 package.sh: add the "cyg" (Cygwin) package type
|
||||
package.mk: add "cyg" stubs, :CATEGORY: for category name(s)
|
||||
03-02-25 mamake.c: add -D4 system(3) debug trace
|
||||
03-02-24 package.mk: change --mismatch to --corrupt=accept
|
||||
@@ -522,12 +522,12 @@
|
||||
make.probe: add CC.LD.STRIP for link time a.out strip
|
||||
package.sh: fix package_use vs. PACKAGE_USE check
|
||||
02-10-24 WWW.mk: fix bug that required a :WWWBIN: assertion to post
|
||||
02-10-23 mamake.c: fix unuinitialized time in make()
|
||||
02-10-23 mamake.c: fix uninitialized time in make()
|
||||
ratz.c: fix meter buffer overflow
|
||||
02-10-20 package.sh: fix lib/probe/C/make/probe update test
|
||||
02-10-18 probe.win32: update for mingw
|
||||
make.probe: add bash workaround to SHELLMAGIC test
|
||||
package.sh: work around yet another cygwin hassle
|
||||
package.sh: work around yet another Cygwin hassle
|
||||
02-10-17 iffe.sh: short circuit id check for *[-+/\\]*
|
||||
02-10-08 regress.sh: unset FIGNORE to avoid rm . errors
|
||||
package.sh: unset FIGNORE to avoid rm . errors
|
||||
@@ -543,7 +543,7 @@
|
||||
iffe.sh: fix bug that didn't define mac variable on success
|
||||
02-09-22 package.sh: handle admin_action=ditto
|
||||
iffe.sh: --config sizeof(foo) macro is SIZEOF_foo
|
||||
iffe.sh: fix long.long test so it doesn't defeat uwin "typ long.long"
|
||||
iffe.sh: fix long.long test so it doesn't defeat UWIN "typ long.long"
|
||||
mamprobe.sh: convert $("foo") nmake string constants
|
||||
02-09-21 mamprobe.sh: "-" info-path writes probe info to stdout
|
||||
02-09-11 make.probe: move from nmake src to be part of mamprobe.sh
|
||||
@@ -564,7 +564,7 @@
|
||||
Makefile: add LICENSE:.DONTCARE to workaround mam
|
||||
02-08-11 iffe.sh: provide defaults for LD_* additions
|
||||
02-08-07 ratz.c: change -m to use * instead of non-portable inverse video
|
||||
02-07-17 mamprobe.sh: close tmp file in trap before rm for cygwin
|
||||
02-07-17 mamprobe.sh: close tmp file in trap before rm for Cygwin
|
||||
package.sh: fix "type" to handle i1586 (P4)
|
||||
package.sh: add the view action
|
||||
02-06-28 package.sh: handle multiple packages for release action
|
||||
@@ -595,7 +595,7 @@
|
||||
package.mk: add { :COVERS: :DESCRIPTION: :REQUIRES: }
|
||||
package.sh: handle { :COVERS: :DESCRIPTION: :REQUIRES: }
|
||||
Makefile: move proto.c generation to the proto component dir
|
||||
02-02-02 execrate.sh: add for .exe challenged win32 systems/commands
|
||||
02-02-02 execrate.sh: add for .exe challenged Win32 systems/commands
|
||||
mamprobe.sh: add STD* commands/flags
|
||||
mamake.c: update mamprobe info when older than mamprobe executable
|
||||
package.sh: move ed/ex workaround to mamprobe.sh
|
||||
@@ -604,7 +604,7 @@
|
||||
package.sh: add check for { cc ar nm yacc/bison } before make
|
||||
ratz.c: fix "rb" vs. "r" macro tests
|
||||
iffe.sh: add nxt, similar to lcl but defines _nxt_foo for #include
|
||||
iffe.sh,package.sh: remove vaibale from sccs,cvs ident strings -- duh
|
||||
iffe.sh,package.sh: remove variable from sccs,cvs ident strings -- duh
|
||||
02-01-24 C+probe: check CC.DYNAMIC to handle cc that accept but ignore -B*
|
||||
iffe.sh: handle 'mem struct.a.b'
|
||||
02-01-22 iffe.sh: cache (internal) `foo vs. struct foo' test results
|
||||
@@ -680,14 +680,14 @@
|
||||
01-04-25 package.mk: include non cc-g variants by default
|
||||
package.sh: *[._]* => *?[_.]* for mvs.390 /bin/sh
|
||||
01-04-24 TEST.mk: no tests for VARIANT=="DLL"
|
||||
01-04-22 package.mk,package.sh: tarball text members are ascii encoded
|
||||
01-04-22 package.mk,package.sh: tarball text members are ASCII encoded
|
||||
01-04-18 package.mk: allow package name to be the same as one of its components
|
||||
cc.mvs.390: handle .C .cpp .cxx
|
||||
cc.mvs.390: compensate for -o that does not overwrite
|
||||
01-04-01 regress: fix SAME that just skipped it -- we should regress regress!
|
||||
iffe: fix bug that didn't emit _hdr_foo for internal hdr tests
|
||||
iffe: fix lcl bug for cc -E that doesn't emit line syncs
|
||||
ratz: add ascii=>ebcdic conversion for text archive members
|
||||
ratz: add ASCII=>EBCDIC conversion for text archive members
|
||||
mamake: fix buffer overlap bug that clobbered the probe file path
|
||||
01-03-17 iffe: handle : separator as first arg
|
||||
01-03-15 mamake.c,ratz.c,release.c: add <stdlib.h> and <string.h>
|
||||
@@ -700,7 +700,7 @@
|
||||
package.sh: fix INIT a.out updates for knr cc
|
||||
package.sh: package list now handles large tgz dirs
|
||||
package.sh: *-ok executables moved to ok/* for *.dll systems
|
||||
iffe.sh: change "exec >&-" to "exec >/dev/null" else linux mkdir fails!
|
||||
iffe.sh: change "exec >&-" to "exec >/dev/null" else Linux mkdir fails!
|
||||
mamake: handle `bind -lx [dontcare]'
|
||||
01-02-12 ratz.c: fix _PACKAGE_ast includes
|
||||
package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/
|
||||
@@ -713,13 +713,13 @@
|
||||
01-02-02 package.sh: fix package use for $INSTALLROOT != */$HOSTTYPE
|
||||
package.sh: create intermediate recursion makefiles when needed
|
||||
package.sh: add $SECONDS to the DEBUG trace prompt
|
||||
01-01-01 ratz.c: #ifdef for uwin ncc
|
||||
01-01-01 ratz.c: #ifdef for UWIN ncc
|
||||
iffe.sh,package.sh: check PACKAGE_PATH for local installations
|
||||
package.sh: add psrinfo for osf.alpha host cpu
|
||||
package.sh: change pax --meter probe; some hang on /dev/tty
|
||||
package.sh: fix `install flat ARCH'
|
||||
mamake: eliminate loops from scan order
|
||||
C+probe: add probe_verbose -V for aix cc=xlc
|
||||
C+probe: add probe_verbose -V for AIX cc=xlc
|
||||
cc.ibm.risc,ldd.ibm.risc: add
|
||||
package.mk: list refs to top-level licenses only
|
||||
package.mk: add local link table to change log html
|
||||
@@ -753,7 +753,7 @@
|
||||
00-10-22 regress: fix VIEW to skip empty dirs
|
||||
00-10-19 package.mk: $(PACKAGEROOT)/bin/nmake => $(PACKAGEROOT)/bin/manmake
|
||||
iffe: validate #define identifiers
|
||||
00-10-18 C+probe: mac os10 additions
|
||||
00-10-18 C+probe: Mac OS X additions
|
||||
package: add DYLD_LIBRARY_PATH initialization
|
||||
add ldd.$(CC.HOSTTYPE)
|
||||
00-10-01 iffe: handle -I* -L* options
|
||||
@@ -800,7 +800,7 @@
|
||||
package.mk: beef up source and binary help => html
|
||||
00-02-08 package: mkdir man/man[138] in the new arch to cover MAM bug
|
||||
00-01-28 package,release: add -rcount to release
|
||||
package: fix linux "host cpu" and "host rating"
|
||||
package: fix Linux "host cpu" and "host rating"
|
||||
package: copy *.lic to $PACKAGEBIN for "make" and "write binary"
|
||||
package: fix 'release change log' case match
|
||||
00-01-24 package: add copyright action
|
||||
@@ -851,11 +851,11 @@
|
||||
98-10-01 hostinfo: add unixware.*
|
||||
use: export PACKAGE_*
|
||||
98-08-11 C.probe: add /usr/include check (for sco CC)
|
||||
hostinfo: handle uwin uname update
|
||||
hostinfo: handle UWIN uname update
|
||||
98-05-01 regress: fix bug sometimes didn't list last test
|
||||
98-04-01 hostinfo: add cc path arg
|
||||
hostinfo: now works with /bin/sh
|
||||
Makefile: strengthed -lm probe
|
||||
Makefile: strengthen -lm probe
|
||||
98-01-23 Makefile: check for -ldl -lm
|
||||
C.probe: handle gcc -v -E phony include dirs
|
||||
iffe: fix lcl by dropping sort -u -- we need the real first
|
||||
@@ -885,15 +885,15 @@
|
||||
mm2html: differentiate mm/man in some non-obvious cases
|
||||
hostinfo: r5000 is not mips4
|
||||
97-02-14 hostinfo: validate type with cc
|
||||
96-12-25 C.probe: uwin tweaks
|
||||
96-12-25 C.probe: UWIN tweaks
|
||||
iffe: use `...` instead of $(...) for alpha /bin/sh
|
||||
iffe: fix `typ' divide by 0
|
||||
iffe: `lcl' now drops X: prefix
|
||||
iffe: +l* -> -l*
|
||||
iffe: eval around ${...#%...} for bsd /bin/sh
|
||||
iffe: eval around ${...#%...} for BSD /bin/sh
|
||||
use: add sgi.mips LD_LIBRARY<abi>_PATH variants
|
||||
use: add -e to list exports
|
||||
iffe: lcl leaves leading [a-zA-Z]: for dos
|
||||
iffe: lcl leaves leading [a-zA-Z]: for DOS
|
||||
iffe: fix no{link|output|execute} logic
|
||||
C.probe: don't automatically add /usr/include for non-hosted compilers
|
||||
C.probe: don't automatically place /usr/include last
|
||||
@@ -904,10 +904,10 @@
|
||||
hostinfo: fix ncr.i386 tests
|
||||
96-10-31 iffe: work around old bsh here doc bug by running separate sh
|
||||
96-10-11 iffe: *.iffe and *.iff for iffe src files
|
||||
hostinfo: tighten sgi.mips cpu type check
|
||||
hostinfo: tighten sgi.mips CPU type check
|
||||
96-10-01 C.probe: add probe_libdir to catch alpha /usr/shlib
|
||||
96-09-17 iffe: fix typ bug that failed for single id types!
|
||||
96-08-31 hostinfo: handle recent sgi hinv cpu changes
|
||||
96-08-31 hostinfo: handle recent SGI hinv CPU changes
|
||||
96-07-17 make sure sizeof(long xxx)>sizeof(xxx) for typ long.xxx
|
||||
96-05-09 C.probe: drop multiple / in stdinclude
|
||||
96-02-29 use: package root must have bin and lib subdir
|
||||
@@ -917,8 +917,8 @@
|
||||
96-01-31 use: add pkg dir
|
||||
hostinfo: add tandem
|
||||
96-01-01 hostinfo: windows_nt|windows[0-9][0-9] -> win32
|
||||
95-11-24 hostinfo: linux-aout.* for non-elf linux
|
||||
95-11-11 use: add aix LIBPATH
|
||||
95-11-24 hostinfo: linux-aout.* for non-ELF Linux
|
||||
95-11-11 use: add AIX LIBPATH
|
||||
95-10-11 hostinfo: no args prints type
|
||||
95-08-11 use: add
|
||||
95-05-09 save original PATH in _probe_PATH
|
||||
@@ -926,7 +926,7 @@
|
||||
95-04-01 use c source suffix if it still preserves the dialect
|
||||
add hostinfo
|
||||
add lib/hostinfo/typemap user type map
|
||||
add sol.sun4 cpu count
|
||||
add sol.sun4 CPU count
|
||||
fix C.probe to properly handle C/C++ combined compiler drivers
|
||||
add NeXT to hostinfo
|
||||
bummer: mach has /usr/bin/hostinfo
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
* regression test support
|
||||
*
|
||||
* @(#)TEST.mk (AT&T Research) 2010-05-19
|
||||
*
|
||||
* test management is still in the design phase
|
||||
*/
|
||||
|
||||
/*
|
||||
* three forms for :TEST:
|
||||
*
|
||||
* :TEST: xxx yyy ...
|
||||
*
|
||||
* $(REGRESS) $(REGRESSFLAGS) xxx.tst
|
||||
* $(REGRESS) $(REGRESSFLAGS) yyy.tst
|
||||
*
|
||||
* :TEST: xxx.tst yyy ...
|
||||
*
|
||||
* $(REGRESS) $(REGRESSFLAGS) xxx.tst yyy ...
|
||||
*
|
||||
* :TEST: xxx.c [ :: test-prereq ... :: ] [ args [ : args ... ] ]
|
||||
*
|
||||
* :TEST: xxx.sh [ :: test-prereq ... :: ] [ args [ : args ... ] ]
|
||||
*
|
||||
* xxx :TEST: prereq ...
|
||||
* [ action ]
|
||||
*
|
||||
* $(*) if no action
|
||||
*/
|
||||
|
||||
":TEST:" : .MAKE .OPERATOR
|
||||
local B G P S T
|
||||
test : .INSERT .TESTINIT
|
||||
if "$("tests":T=FD)"
|
||||
.SOURCE : tests
|
||||
end
|
||||
P := $(>:O=1)
|
||||
if "$(P:N=*.tst)" && ! "$(@:V)"
|
||||
B := $(P:B)
|
||||
if ! ( T = "$(<:V)" )
|
||||
T := $(B)
|
||||
end
|
||||
test : - test.$(T)
|
||||
eval
|
||||
test.$$(T) : $$(B).tst
|
||||
$$(REGRESS) $$(REGRESSFLAGS) $$(*) $(>:V:O>1)
|
||||
:SAVE: $$(B).tst
|
||||
end
|
||||
elif "$(P:N=*@(.sh|$(.SUFFIX.c:/ /|/G)|$(.SUFFIX.C:/ /|/G)))"
|
||||
B := $(P:B)
|
||||
if ! ( T = "$(<:V)" )
|
||||
T := $(B)
|
||||
end
|
||||
:INSTALLDIR: $(B)
|
||||
$(B) :: $(P) $(*:-l*|*$(CC.SUFFIX.ARCHIVE))
|
||||
if "$(P:N=*.sh)"
|
||||
TESTCC == $(CC)
|
||||
$(B) : (TESTCC)
|
||||
end
|
||||
test : - test.$(T)
|
||||
if "$(@:V)"
|
||||
eval
|
||||
test.$$(T) : $$(B) $(>:V:O>1)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(@:V)
|
||||
end
|
||||
elif "$(>:V:O>1)"
|
||||
local I A V X S R=0
|
||||
for A $(>:V:O>1)
|
||||
if A == "::"
|
||||
let R = !R
|
||||
elif A == ":"
|
||||
let I = I + 1
|
||||
test.$(T).$(I) := $(V:V)
|
||||
V =
|
||||
X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*)
|
||||
S = $("\n")
|
||||
elif A != "-l*|*$(CC.SUFFIX.ARCHIVE)"
|
||||
if R
|
||||
test.$(A) : .VIRTUAL .FORCE
|
||||
test.$(T) : test.$(A)
|
||||
else
|
||||
V += $(A:V)
|
||||
end
|
||||
end
|
||||
end
|
||||
if V
|
||||
let I = I + 1
|
||||
test.$(T).$(I) := $(V:V)
|
||||
X := $(X:V)$(S)$$(*) $$(test.$(T).$(I):T=*)
|
||||
end
|
||||
eval
|
||||
test.$$(T) : $$(B)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(X:V)
|
||||
end
|
||||
else
|
||||
eval
|
||||
test.$$(T) : $$(B)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$$(*)
|
||||
end
|
||||
end
|
||||
elif ! "$(<:V)"
|
||||
G = 1
|
||||
for B $(>)
|
||||
if B == "-|--"
|
||||
let G = !G
|
||||
else
|
||||
if ! G
|
||||
T =
|
||||
elif ! ( T = "$(B:A=.COMMAND)" ) && ! "$(B:A=.TARGET)"
|
||||
for S .c .sh
|
||||
if "$(B:B:S=$(S):T=F)"
|
||||
:INSTALLDIR: $(B)
|
||||
$(B) :: $(B:B:S=$(S))
|
||||
T := $(B)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
test : - test.$(B)
|
||||
test.$(B) : $(T) - $(B).tst
|
||||
$(REGRESS) $(REGRESSFLAGS) $(*:N=*.tst) $(*:N!=*.tst)
|
||||
:SAVE: $(B).tst
|
||||
end
|
||||
end
|
||||
else
|
||||
if "$(>:V)" || "$(@:V)"
|
||||
P := $(>)
|
||||
T := $(P:O=1)
|
||||
B := $(T:B)
|
||||
if "$(T)" != "$(B)" && "$(T:G=$(B))"
|
||||
:INSTALLDIR: $(B)
|
||||
$(B) :: $(T) $(P:O>1:N=-*)
|
||||
T := $(B)
|
||||
P := $(B) $(P:O>1:N!=-*)
|
||||
end
|
||||
if "$(<:V)"
|
||||
T := $(<:V)
|
||||
end
|
||||
test : - test.$(T)
|
||||
if "$(@:V)"
|
||||
eval
|
||||
test.$$(T) : $$(P) $(>:V:O>1)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(@:V)
|
||||
end
|
||||
else
|
||||
test.$(T) : $(P)
|
||||
set +x; (ulimit -c 0) >/dev/null 2>&1 && ulimit -c 0; set -x
|
||||
$(*)
|
||||
end
|
||||
else
|
||||
test : - test.$(<)
|
||||
test.$(<) : $(<).tst $(<:A=.COMMAND)
|
||||
$(REGRESS) $(REGRESSFLAGS) $(*)
|
||||
end
|
||||
end
|
||||
|
||||
.TESTINIT : .MAKE .VIRTUAL .FORCE .REPEAT
|
||||
if VARIANT == "DLL"
|
||||
error 1 :DLL: tests skipped
|
||||
exit 0
|
||||
end
|
||||
set keepgoing
|
||||
REGRESSFLAGS &= $(TESTS:@/ /|/G:/.*/--test=&/:@Q)
|
||||
|
||||
.SCAN.tst : .SCAN
|
||||
$(@.SCAN.sh)
|
||||
I| INCLUDE@ % |
|
||||
|
||||
.ATTRIBUTE.%.tst : .SCAN.tst
|
||||
|
||||
MKTEST = mktest
|
||||
MKTESTFLAGS = --style=regress
|
||||
|
||||
/*
|
||||
* test scripts are only regenerated from *.rt when --force
|
||||
* is specified or the .rt file is newer than the script
|
||||
* otherwise the script is accepted if it exists
|
||||
*
|
||||
* this avoids the case where a fresh build with no state
|
||||
* would regenerate the test script and capture current
|
||||
* behavior instead of expected behavior
|
||||
*/
|
||||
|
||||
%.tst : %.rt
|
||||
if [[ "$(-force)" || "$(>)" -nt "$(^|<)" ]]
|
||||
then $(MKTEST) $(MKTESTFLAGS) $(>) > $(<)
|
||||
fi
|
||||
|
||||
test%.sh test%.out : %.rt
|
||||
if [[ "$(-force)" || "$(>)" -nt "$(^|<:O=1)" ]]
|
||||
then $(MKTEST) --style=shell $(>) > $(<:N=*.sh)
|
||||
$(SHELL) $(<:N=*.sh) --accept > $(<:N=*.out)
|
||||
fi
|
||||
@@ -1,450 +0,0 @@
|
||||
/*
|
||||
* post stuff to WWWDIR for web access
|
||||
* index generated from *.mm
|
||||
*/
|
||||
|
||||
WWWDIR = wwwfiles public_html
|
||||
WWWSAVE =
|
||||
WWWSTYLE =
|
||||
WWWTYPES =
|
||||
|
||||
.WWW.semaphore : .SEMAPHORE
|
||||
|
||||
.EXPORT : WWWSTYLE WWWTYPES
|
||||
|
||||
/*
|
||||
* item :WWW: [style=frame] [save=pattern] file ...
|
||||
*
|
||||
* `item'.mm generates index.html
|
||||
* other files copied to $(WWWDIR)/`item'
|
||||
* sets up www.bin
|
||||
*/
|
||||
|
||||
":WWW:" : .MAKE .OPERATOR
|
||||
local A B D I J L X E P R M
|
||||
.WWW.LOCAL .WWW.REMOTE : .DO.NOTHING
|
||||
WWWDIR := $(HOME:X=$(WWWDIR):T=F:O=1)
|
||||
B := $(*:N=*.mm::O=1:B)
|
||||
D := $(WWWDIR)/$(B)
|
||||
M := $(WWWDIR)/man/man1
|
||||
R := $(>:N!=*=*)
|
||||
for I $(>:N=*=*)
|
||||
A := WWW$(I:/=.*//:F=%(upper)s)
|
||||
$(A) := $(I:/.*=//)
|
||||
end
|
||||
(html_info) : $$(MM2HTMLINFO) $$(MM2HTMLINIT)
|
||||
if WWWSTYLE == "frame"
|
||||
%.html %-index.html : %.mm (html_info)
|
||||
$(MM2HTML) $(MM2HTMLFLAGS) $(%:N=faq.*:?> $(<:O=1)?-f $(%) -x?) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(WWWSOURCE.$(%)) $(>)
|
||||
else
|
||||
%.html : %.mm (html_info)
|
||||
$(MM2HTML) $(MM2HTMLFLAGS) -o WWWTYPES=$(WWWTYPES:@Q:@Q) $(>) $(WWWSOURCE.$(%)) > $(<)
|
||||
end
|
||||
%.html : %.1 (html_info)
|
||||
$(MM2HTML) $(MM2HTMLFLAGS) $(>) $(WWWSOURCE.$(%)) > $(<)
|
||||
%-man.html : $(BINDIR)/% (html_info)
|
||||
ignore $(>) --html 2> $(<)
|
||||
.DO.WWW.MAN : .USE
|
||||
if { test '' = '$(*)' || { strings $(*) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.' ;} ;} && [[ "$( $(<:B) '--???html' -- 2>&1 )" == version=[1-9]* ]]
|
||||
then ( $(<:B) '--??html' -- 2>$(<) ) || true
|
||||
fi
|
||||
if 0
|
||||
$(M)/%.html : .DONTCARE $(INSTALLROOT)/bin/%
|
||||
$(@.DO.WWW.MAN)
|
||||
end
|
||||
if "$(<)"
|
||||
D := $(<)
|
||||
elif ! "$(R)"
|
||||
return
|
||||
end
|
||||
.WWW .WWW.BIN : $(D) $(M) -
|
||||
$(D) $(M) :
|
||||
$(SILENT) test -d $(<) || mkdir $(<)
|
||||
if ( J = "$(R:N=*.mm)" )
|
||||
for I $(J:G=%.html)
|
||||
if I == "*-index.html"
|
||||
O := $(D)/index.html
|
||||
else
|
||||
O := $(I:D=$(D):B:S)
|
||||
end
|
||||
.WWW : $(O)
|
||||
$(O) :COPY: $(I)
|
||||
end
|
||||
end
|
||||
.WWW.req : .FUNCTION
|
||||
return $(*$(%:T=SR):N=-l*:T=F:P=B:N!=-l*|/*)
|
||||
A = 0
|
||||
for I $(R:N!=*.mm)
|
||||
if I == "-"
|
||||
let A = ! A
|
||||
elif I == "-l*"
|
||||
L := $(I:/-l//)
|
||||
if J = "$(.DLL.NAME. $(L) $($(L).VERSION):T=F)"
|
||||
X += $(J)
|
||||
end
|
||||
elif A || "$(I:A=.COMMAND|.ARCHIVE)" || "$(I:D:D:N=$(INSTALLROOT))" || "$(I:N=*-www)"
|
||||
X += $(I)
|
||||
if "$(I:A=.COMMAND)"
|
||||
X += $$(.WWW.req $(I))
|
||||
J := $(I:/-www$//)
|
||||
eval
|
||||
.WWW : $(J:D=$(M):B:S=.html)
|
||||
$(J:D=$(M):B:S=.html) : $(I) $(I:B:S=.1:T=F:?$(I:B:S=.1)??)
|
||||
if strings $$(*:O=1) | egrep -q '\[\+NAME\?|libcmd\.|cmd[0-9][0-9]\.'
|
||||
then $$(IGNORE) $$(*:O=1) '--??html' -- 2>&1
|
||||
elif test '' != '$$(*:N=*.1)'
|
||||
then $$(MM2HTML) $$(*:N=*.1)
|
||||
fi > $$(<)
|
||||
end
|
||||
end
|
||||
else
|
||||
if I == "*.html"
|
||||
$(I) : .TERMINAL
|
||||
end
|
||||
.WWW : $(D)/$(I)
|
||||
$(D)/$(I) :COPY: $(I)
|
||||
end
|
||||
end
|
||||
if "$(X:V)"
|
||||
.WWW.EDIT. : .FUNCTION
|
||||
local E I J
|
||||
for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*)
|
||||
for J $(%)
|
||||
if "$(I:B:S)" == "$(J:B:S)"
|
||||
E += -s ',^$(J)$,$(I),'
|
||||
end
|
||||
end
|
||||
end
|
||||
return $(E)
|
||||
.WWW.LIST. : .FUNCTION
|
||||
local E I J
|
||||
for I $(.INSTALL.LIST.:C,^$(INSTALLROOT)/,,:N!=lib/lib/*)
|
||||
for J $(%)
|
||||
if "$(I:B:S)" == "$(J:B:S)"
|
||||
E += $(I)
|
||||
end
|
||||
end
|
||||
end
|
||||
return $(E)
|
||||
.WWW .WWW.BIN : $(D)/$(B)-$(CC.HOSTTYPE).tgz
|
||||
$(D)/$(B)-$(CC.HOSTTYPE).tgz : $(X:V)
|
||||
cat > X.$(tmp).X <<!
|
||||
This archive contains $(CC.HOSTTYPE) binaries for
|
||||
$(.WWW.LIST. $(*))
|
||||
Add the bin directory to PATH and the lib directory
|
||||
to LD_LIBRARY_PATH or its equivalent for your system.
|
||||
Use the --?help and --man options for online help,
|
||||
documentation and contact info.
|
||||
!
|
||||
$(PAX) -wvf $(<) -x tar:gzip -s "/X.$(tmp).X/README/" $(.WWW.EDIT. $(*)) -s ',\(.*\)-www$,bin/\1,' -s ',.*/lib/,lib/,' X.$(tmp).X $(*:N!=-l*)
|
||||
$(RM) -f X.$(tmp).X
|
||||
end
|
||||
|
||||
/*
|
||||
* item ... :WWWBIN: index.mm file ... host:arch ...
|
||||
*
|
||||
* home page control
|
||||
* `host' of type `arch' for www.bin files
|
||||
*/
|
||||
|
||||
":WWWBIN:" : .MAKE .OPERATOR
|
||||
local HOST ITEM ARCH BINS DIRS G
|
||||
.WWW.NOMAN. += $(<)
|
||||
for HOST $(>)
|
||||
TYPE := $(HOST:/.*://)
|
||||
HOST := $(HOST:/:.*//)
|
||||
WWWTYPES += $(TYPE)
|
||||
ARCH := $(PWD:D:C,/$(CC.HOSTTYPE)/,/$(TYPE)/)
|
||||
BINS :=
|
||||
DIRS :=
|
||||
for ITEM $(<)
|
||||
if TYPE == "$(CC.HOSTTYPE)"
|
||||
G := $("index.mm":G=%.html:D=$(WWWDIR)/$(ITEM):B:S)
|
||||
.WWW.LOCAL : $(G)
|
||||
eval
|
||||
$(G) : .JOINT $(ARCH)/$(ITEM)/$(ITEM).mm (html_info) .WWW.semaphore .FORCE
|
||||
cd $$(*:D)
|
||||
$$(MAKE) $$(-) $$(=) www
|
||||
end
|
||||
else
|
||||
BINS += $(WWWDIR)/$(ITEM)/$(ITEM)-$(TYPE).tgz
|
||||
DIRS += $(ARCH)/$(ITEM)
|
||||
end
|
||||
end
|
||||
.WWW.REMOTE : $(BINS)
|
||||
ARCH := $(ARCH:C,/src/.*,,)
|
||||
eval
|
||||
$(BINS) :JOINT: .FORCE .WWW.semaphore
|
||||
rsh $(HOST) "
|
||||
eval \"\`bin/package debug use\`\"
|
||||
PATH=\$PATH:$(PATH):/usr/ccs/bin
|
||||
umask 022
|
||||
for dir in $(DIRS)
|
||||
do cd \$dir
|
||||
$(MAKE) $(-) $(=) --errorid=\$dir www.bin
|
||||
done
|
||||
"
|
||||
end
|
||||
end
|
||||
|
||||
/*
|
||||
* :WWWPOST: [ host [ dir [ tmp ] ] ]
|
||||
*
|
||||
* post local $(WWWDIR) to host:dir putting archives in host:tmp/www-*.pax
|
||||
* defaults: host=www dir=$(WWWDIR) tmp=tmp
|
||||
*/
|
||||
|
||||
":WWWPOST:" : .MAKE .OPERATOR
|
||||
local ( host dir tmp ignore ... ) $(>) www $(WWWDIR:B:S) tmp ignore
|
||||
:ALL: delta.pax
|
||||
.WWW.ALL : .WWW.REMOTE - .WWW.LOCAL
|
||||
eval
|
||||
.POST : .VIRTUAL base.pax delta.pax
|
||||
case "$$(>)" in
|
||||
'') ;;
|
||||
*) $$(>:C,.*,rcp & $(host):$(tmp)/$(dir)-&;,)
|
||||
rsh $(host) '
|
||||
umask 022
|
||||
PATH=$HOME/bin:$PATH
|
||||
cd $(dir)
|
||||
pax -rvf $HOME/$(tmp)/$(dir)-delta.pax -z $HOME/$(tmp)/$(dir)-base.pax
|
||||
'
|
||||
;;
|
||||
esac
|
||||
end
|
||||
base.pax :
|
||||
cd $(WWWDIR)
|
||||
pax -wvf $(<:P=A) .
|
||||
.base.list. : .FUNCTION
|
||||
local X
|
||||
X := $(sh pax -f $(%:N=*.pax):C,\n, ,G:C,^,$$(WWWDIR)/,)
|
||||
$(X) : .DONTCARE
|
||||
return $(X)
|
||||
delta.pax : .WWW.ALL base.pax $$(.base.list. $$(*))
|
||||
cd $(WWWDIR)
|
||||
pax -wvf $(<:P=A) -z $(*:N=*.pax:P=A) .
|
||||
|
||||
.WWW.FAQ : .USE
|
||||
{
|
||||
set -o noglob
|
||||
print .xx title=\"$(<:B:/\..*//) FAQ index\"
|
||||
print .MT 4
|
||||
print .TL
|
||||
print
|
||||
print .H 1 \"$(<:B:/\..*//) FAQ index\"
|
||||
print .BL
|
||||
for i in $(*)
|
||||
do exec < $i || exit 1
|
||||
e=0 l=0 x=y
|
||||
while read -r op a1 a2
|
||||
do case $op in
|
||||
.H) case $e in
|
||||
0) e=1 ;;
|
||||
1) print .LE ;;
|
||||
esac
|
||||
print .sp
|
||||
print .LI
|
||||
a2=${a2//\"/}
|
||||
a2=${a2%\ [Ff][Aa][Qq]}
|
||||
f=${i%.*}.html
|
||||
f=${f#*/}
|
||||
print .xx link=\"$f' '$a2\"
|
||||
print .sp
|
||||
print .NL
|
||||
;;
|
||||
.AL|.BL|.NL)
|
||||
case $x in
|
||||
y) x=x ;;
|
||||
*) x=xx$x ;;
|
||||
esac
|
||||
;;
|
||||
.LE) x=${x%xx}
|
||||
;;
|
||||
.LI) case $x in
|
||||
x) x=
|
||||
print .LI
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
.sp) case $x in
|
||||
'') x=x ;;
|
||||
esac
|
||||
;;
|
||||
*) case $x in
|
||||
'') print -r -- $op $a1 $a2 ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
case $e in
|
||||
1) print .LE ;;
|
||||
esac
|
||||
done
|
||||
print .LE
|
||||
} > $(<)
|
||||
|
||||
/*
|
||||
* [ dir ] :WWWPAGE: [ source ... ] file.mm file
|
||||
*
|
||||
* *.mm generates *.html
|
||||
* faq.*.mm generates faq.mm
|
||||
* other files copied to $(WWWDIR)[/dir]
|
||||
* files after - (toggle) are just asserted on ::
|
||||
*/
|
||||
|
||||
":WWWPAGE:" : .MAKE .OPERATOR
|
||||
local B D I J O P Q S X G A
|
||||
A = 0
|
||||
D := $(<:O=1)
|
||||
P := $(>:N!=*=*)
|
||||
S := $(>:N=*=*)
|
||||
if X = "$(P:B:S:N=faq.*.mm)"
|
||||
Q := $(D:+$(D).)faq.mm
|
||||
$(Q) : .WWW.FAQ $(X)
|
||||
P += $(Q)
|
||||
end
|
||||
if D
|
||||
B := $(D:B)
|
||||
if D != "/*"
|
||||
D := $(WWWDIR)/$(D)
|
||||
$(D) :INSTALLDIR:
|
||||
.WWW.LOCAL : $(D)
|
||||
end
|
||||
for I $(<:B)
|
||||
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html
|
||||
$(WWWDIR)/man/man1/$(I).html : .DONTCARE
|
||||
end
|
||||
for I $(P)
|
||||
if I == "-"
|
||||
let A = !A
|
||||
continue
|
||||
end
|
||||
if A || I == "$(WWWSAVE)"
|
||||
:: $(I)
|
||||
continue
|
||||
end
|
||||
if "$(I:T=FD)"
|
||||
.SOURCE : $(I)
|
||||
if "$(<)"
|
||||
WWWSOURCE.$(<:O=1) += $(I:T=F:P=L=*)
|
||||
end
|
||||
continue
|
||||
end
|
||||
if I == "*.html"
|
||||
$(I) : .TERMINAL
|
||||
O := $(I)
|
||||
X := $(I)
|
||||
elif ( G = "$(I:G=%.html)" )
|
||||
$(G) : .IMPLICIT $(S) $(I)
|
||||
if $(G:O) > 1
|
||||
for J $(G)
|
||||
if J == "*-index.html"
|
||||
if J == "faq.*.*"
|
||||
continue
|
||||
end
|
||||
O := index.html
|
||||
else
|
||||
O := $(J)
|
||||
end
|
||||
.WWW.LOCAL : $(D)/$(O)
|
||||
$(D)/$(O) :INSTALL: $(J)
|
||||
end
|
||||
continue
|
||||
end
|
||||
if X
|
||||
X := $(I)
|
||||
else
|
||||
X := index
|
||||
end
|
||||
I := $(I:B:S=.html)
|
||||
O := $(X:B:S=.html)
|
||||
else
|
||||
O := $(I)
|
||||
end
|
||||
$(D)/$(O) :INSTALL: $(I)
|
||||
.WWW.LOCAL : $(D)/$(O)
|
||||
end
|
||||
else
|
||||
for I $(P)
|
||||
if I == "-"
|
||||
let A = !A
|
||||
continue
|
||||
end
|
||||
if A || I == "$(WWWSAVE)"
|
||||
:: $(I)
|
||||
continue
|
||||
end
|
||||
if "$(I:T=FD)"
|
||||
.SOURCE : $(I)
|
||||
continue
|
||||
end
|
||||
if I == "*.html"
|
||||
$(I) : .TERMINAL
|
||||
O := $(I)
|
||||
elif ( O = "$(I:G=%.html)" )
|
||||
$(O) : $(S) .IMPLICIT $(I)
|
||||
end
|
||||
for J $(O)
|
||||
if J == "*-index.html"
|
||||
X := index.html
|
||||
else
|
||||
X := $(J)
|
||||
end
|
||||
X := $(WWWDIR)/$(X)
|
||||
.WWW.LOCAL : $(X)
|
||||
$(X) :COPY: $(J)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
/*
|
||||
* rhs done by default
|
||||
*/
|
||||
|
||||
":WWWALL:" : .MAKE .OPERATOR
|
||||
.WWW.ALL : $(>)
|
||||
|
||||
":WWWMAN:" : .MAKE .OPERATOR
|
||||
.INIT : .WWW.MAN
|
||||
.WWW.MAN. := $(>)
|
||||
.WWW.MAN : .MAKE .FORCE
|
||||
local H I
|
||||
for I $(.WWW.MAN.)
|
||||
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I:B).html
|
||||
$(WWWDIR)/man/man1/$(I:B).html : .DO.WWW.MAN $(I)
|
||||
end
|
||||
for I $(sh builtin:B)
|
||||
.WWW.LOCAL : $(WWWDIR)/man/man1/$(I).html
|
||||
$(WWWDIR)/man/man1/$(I).html : .DO.WWW.MAN -
|
||||
end
|
||||
for I $("$(BINDIR)/*([!-.])":P=G:B)
|
||||
if I != "*_*"
|
||||
H := $(WWWDIR)/man/man1/$(I).html
|
||||
if ! "$(*$(H))" && I != "$(.WWW.NOMAN.:/ /|/G)"
|
||||
.WWW.LOCAL : $(H)
|
||||
end
|
||||
elif "$(PATH:/:/ /G:X=$(I:/.*_//):T=F:O=1)"
|
||||
H := $(WWWDIR)/man/man1/$(I:/.*_//).html
|
||||
.WWW.LOCAL : $(H)
|
||||
$(H) : .DO.WWW.MAN $(BINDIR)/$(I)
|
||||
end
|
||||
end
|
||||
|
||||
.WWW.SED. : .FUNCTION
|
||||
local E T
|
||||
E = s/^\(\.xx.link=.*\)%HOSTTYPE%\(.*\)%HOSTTYPE%\(.*\)/
|
||||
for T $(%)
|
||||
E := $(E:V)\$$("\n").LI\$$("\n")\1$(T)\2$(T)\3
|
||||
end
|
||||
return $(E:V)/
|
||||
|
||||
/*
|
||||
* mm scan support
|
||||
*/
|
||||
|
||||
.SCAN.mm : .SCAN
|
||||
O|S|
|
||||
I|.sn %|A.DONTCARE|M$$(%)|
|
||||
I|.so %|A.DONTCARE|M$$(%)|
|
||||
|
||||
.ATTRIBUTE.%.mm : .SCAN.mm
|
||||
@@ -1,6 +0,0 @@
|
||||
: linux.i386-64 ar wrapper
|
||||
|
||||
case $1 in
|
||||
*x*) /usr/bin/ar "$@" ;;
|
||||
*) /usr/bin/ar U"$@" ;;
|
||||
esac
|
||||
@@ -1,6 +0,0 @@
|
||||
: linux.i386-64 ar wrapper
|
||||
|
||||
case $1 in
|
||||
*x*) /usr/bin/ar "$@" ;;
|
||||
*) /usr/bin/ar U"$@" ;;
|
||||
esac
|
||||
@@ -1,52 +0,0 @@
|
||||
: unix wrapper for macOS cc : 2020-07-17 :
|
||||
|
||||
HOSTTYPE=darwin.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
CC=/usr/bin/cc
|
||||
op=init
|
||||
for arg
|
||||
do case $op in
|
||||
init) op=ld
|
||||
set ''
|
||||
;;
|
||||
esac
|
||||
case $arg in
|
||||
-c) op=cc
|
||||
;;
|
||||
-E) op=cpp
|
||||
continue
|
||||
;;
|
||||
-G) op=dll
|
||||
continue
|
||||
;;
|
||||
-lc) continue
|
||||
;;
|
||||
-lm) continue
|
||||
;;
|
||||
esac
|
||||
set "$@" "$arg"
|
||||
done
|
||||
case $# in
|
||||
0) ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
case $* in
|
||||
-v) $CC "$@"; exit ;;
|
||||
esac
|
||||
case $op in
|
||||
init) echo "cc: arguments expected" >&2
|
||||
exit 1
|
||||
;;
|
||||
cpp) $CC -E "$@"
|
||||
;;
|
||||
cc) $CC -D_ast_int8_t=int64_t -D_lib_memccpy "$@"
|
||||
;;
|
||||
dll) $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@"
|
||||
;;
|
||||
ld) $CC -Wl,-search_paths_first "$@"
|
||||
;;
|
||||
esac
|
||||
@@ -1,71 +0,0 @@
|
||||
: unix wrapper for Mac OS X 10.3-10.6 (Darwin 7-10) cc : 2020-07-17 :
|
||||
|
||||
HOSTTYPE=darwin07.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
CC=/usr/bin/cc
|
||||
op=init
|
||||
for arg
|
||||
do case $op in
|
||||
init) op=ld
|
||||
set ''
|
||||
;;
|
||||
esac
|
||||
case $arg in
|
||||
-c) op=cc
|
||||
;;
|
||||
-E) op=cpp
|
||||
continue
|
||||
;;
|
||||
-G) op=dll
|
||||
continue
|
||||
;;
|
||||
-lc) continue
|
||||
;;
|
||||
-lm) continue
|
||||
;;
|
||||
esac
|
||||
set "$@" "$arg"
|
||||
done
|
||||
case $# in
|
||||
0) ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
case $* in
|
||||
-v) $CC "$@"; exit ;;
|
||||
esac
|
||||
case $op in
|
||||
init) echo "cc: arguments expected" >&2
|
||||
exit 1
|
||||
;;
|
||||
cpp) $CC -E "$@"
|
||||
;;
|
||||
cc) $CC -DCLK_TCK=100 "$@"
|
||||
;;
|
||||
dll) # what a compatibility mess -- surely they can get the apis to play nice
|
||||
tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
case `MACOSX_DEPLOYMENT_TARGET=10.3 ld -undefined dynamic_lookup 2>&1` in
|
||||
*undefined*dynamic_lookup*)
|
||||
ld -m -flat_namespace -undefined suppress -dylib -dynamic \
|
||||
-ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
*) MACOSX_DEPLOYMENT_TARGET=10.3 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
esac
|
||||
egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
$CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
esac
|
||||
@@ -1,71 +0,0 @@
|
||||
: unix wrapper for Mac OS X 10.7 (Darwin 11) cc : 2020-07-17 :
|
||||
|
||||
HOSTTYPE=darwin11.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
CC=/usr/bin/cc
|
||||
op=init
|
||||
for arg
|
||||
do case $op in
|
||||
init) op=ld
|
||||
set ''
|
||||
;;
|
||||
esac
|
||||
case $arg in
|
||||
-c) op=cc
|
||||
;;
|
||||
-E) op=cpp
|
||||
continue
|
||||
;;
|
||||
-G) op=dll
|
||||
continue
|
||||
;;
|
||||
-lc) continue
|
||||
;;
|
||||
-lm) continue
|
||||
;;
|
||||
esac
|
||||
set "$@" "$arg"
|
||||
done
|
||||
case $# in
|
||||
0) ;;
|
||||
*) shift ;;
|
||||
esac
|
||||
case $* in
|
||||
-v) $CC "$@"; exit ;;
|
||||
esac
|
||||
case $op in
|
||||
init) echo "cc: arguments expected" >&2
|
||||
exit 1
|
||||
;;
|
||||
cpp) $CC -E "$@"
|
||||
;;
|
||||
cc) $CC -DCLK_TCK=100 "$@"
|
||||
;;
|
||||
dll) # what a compatibility mess -- surely they can get the apis to play nice
|
||||
tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
case `MACOSX_DEPLOYMENT_TARGET=10.7 ld -undefined dynamic_lookup 2>&1` in
|
||||
*undefined*dynamic_lookup*)
|
||||
ld -m -flat_namespace -undefined suppress -dylib -dynamic \
|
||||
-ldylib1.o "$@" -lcc_dynamic -framework System >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
*) MACOSX_DEPLOYMENT_TARGET=10.7 $CC -Wl,-flat_namespace -dynamiclib -undefined dynamic_lookup "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
;;
|
||||
esac
|
||||
egrep -v ' (warning .*multiple definitions|definition) of ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
ld) tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
|
||||
trap "rm -f $tmp" EXIT
|
||||
$CC -Wl,-m -DCLK_TCK=100 "$@" >$tmp 2>&1
|
||||
status=$?
|
||||
egrep -v ' (warning .*multiple definitions of|definition of|as lazy binding|not from earlier dynamic) ' $tmp >&2
|
||||
exit $status
|
||||
;;
|
||||
esac
|
||||
@@ -1,9 +0,0 @@
|
||||
: FreeBSD cc wrapper
|
||||
|
||||
HOSTTYPE=freebsd.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
exec /usr/bin/cc -P "$@"
|
||||
@@ -1,8 +1,8 @@
|
||||
: hp.ia64 cc wrapper for reasonable ansi C defaults : 2011-01-25 :
|
||||
: hp.ia64 cc wrapper for reasonable ANSI C defaults : 2011-01-25 :
|
||||
|
||||
[ /usr/bin/cc -ef /usr/ccs/bin/cc ] || exit 1
|
||||
|
||||
: bundled cc -- really, in the face of gcc you ship a sub-par /usr/bin/cc? :
|
||||
: bundled cc -- really, in the face of gcc you ship a subpar /usr/bin/cc? :
|
||||
|
||||
HOSTTYPE=hp.ia64
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: hp.pa cc wrapper for reasonable ansi C defaults : 2004-02-29 :
|
||||
: hp.pa cc wrapper for reasonable ANSI C defaults : 2004-02-29 :
|
||||
|
||||
HOSTTYPE=hp.pa
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: hp.pa64 cc wrapper for reasonable ansi C defaults : 2001-02-11 :
|
||||
: hp.pa64 cc wrapper for reasonable ANSI C defaults : 2001-02-11 :
|
||||
|
||||
HOSTTYPE=hp.pa64
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: cc wrapper for aix risc xlc : 2012-04-17 :
|
||||
: cc wrapper for AIX RISC xlc : 2012-04-17 :
|
||||
|
||||
hosttype=ibm.risc
|
||||
|
||||
@@ -33,7 +33,7 @@ case " $@ " in
|
||||
;;
|
||||
esac
|
||||
if test -x $bin/c99
|
||||
then # the xlc optimizer vintage that supports c99 is flawed and causes the ast build to fail #
|
||||
then # the xlc optimizer vintage that supports c99 is flawed and causes the AST build to fail #
|
||||
case " $* " in
|
||||
*" -O "*)
|
||||
set '' "$@" ''
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: cc wrapper for aix risc gcc : 2012-04-17 :
|
||||
: cc wrapper for AIX RISC gcc : 2012-04-17 :
|
||||
|
||||
hosttype=ibm.risc
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
: linux.aarch64 cc wrapper : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=linux.aarch64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/usr/bin/cc -P "$@"
|
||||
@@ -1,9 +0,0 @@
|
||||
: linux.i386-64 cc wrapper : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=linux.i386-64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
/usr/bin/cc -P "$@"
|
||||
@@ -1,22 +0,0 @@
|
||||
: linux.i386-64 icc wrapper : 2011-10-18 :
|
||||
|
||||
HOSTTYPE=linux.i386-64-icc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") if test -f /etc/profile.d/icc.sh
|
||||
then . /etc/profile.d/icc.sh
|
||||
fi
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") echo icc: not found >&2
|
||||
exit 127
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$icc "$@"
|
||||
@@ -1,22 +0,0 @@
|
||||
: linux.ia64 icc wrapper : 2011-10-18 :
|
||||
|
||||
HOSTTYPE=linux.ia64-icc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") if test -f /etc/profile.d/icc.sh
|
||||
then . /etc/profile.d/icc.sh
|
||||
fi
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") echo icc: not found >&2
|
||||
exit 127
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$icc "$@"
|
||||
@@ -1,22 +0,0 @@
|
||||
: linux.ia64 icc wrapper : 2011-10-18 :
|
||||
|
||||
HOSTTYPE=linux.ia64-icc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") if test -f /etc/profile.d/icc.sh
|
||||
then . /etc/profile.d/icc.sh
|
||||
fi
|
||||
icc=$(which icc 2>/dev/null)
|
||||
case $icc in
|
||||
"") echo icc: not found >&2
|
||||
exit 127
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
$icc "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
: mvs.390 cc wrapper for unix message and exit code semantics : 2012-01-20 :
|
||||
: mvs.390 cc wrapper for Unix message and exit code semantics : 2012-01-20 :
|
||||
|
||||
HOSTTYPE=mvs.390
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: next.i386 cc wrapper for unix message and exit code semantics : 1995-05-09 :
|
||||
: next.i386 cc wrapper for Unix message and exit code semantics : 1995-05-09 :
|
||||
|
||||
HOSTTYPE=next.i386
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: next.m68k cc wrapper that enables posix : 2000-12-15 :
|
||||
: next.m68k cc wrapper that enables POSIX : 2000-12-15 :
|
||||
|
||||
HOSTTYPE=next.m68k
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
: OpenBSD cc wrapper
|
||||
|
||||
HOSTTYPE=openbsd.generic
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
exec /usr/bin/cc -P "$@"
|
||||
@@ -1,4 +1,4 @@
|
||||
: sgi.mips2 cc wrapper that generates mips2 binaries : 2006-02-14 :
|
||||
: sgi.mips2 cc wrapper that generates MIPS II binaries : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=sgi.mips2
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: sgi.mips3 cc wrapper that generates mips3 binaries : 2007-04-27 :
|
||||
: sgi.mips3 cc wrapper that generates MIPS III binaries : 2007-04-27 :
|
||||
|
||||
HOSTTYPE=sgi.mips3
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: sgi.mips3-o32 cc wrapper that generates mips3 o32 binaries : 2006-02-14 :
|
||||
: sgi.mips3-o32 cc wrapper that generates MIPS III O32 binaries : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=sgi.mips3-o32
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: sgi.mips4 cc wrapper that generates mips4 binaries : 2007-04-27 :
|
||||
: sgi.mips4 cc wrapper that generates MIPS IV binaries : 2007-04-27 :
|
||||
|
||||
HOSTTYPE=sgi.mips4
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
: sgi.mips4-n32 cc wrapper that generates mips4 n32 binaries : 2006-02-14 :
|
||||
: sgi.mips4-n32 cc wrapper that generates MIPS IV N32 binaries : 2006-02-14 :
|
||||
|
||||
HOSTTYPE=sgi.mips4-n32
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
: solaris.i386 cc wrapper for reasonable ansi C defaults and 32 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.i386
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m32 -xc99 "$@"
|
||||
@@ -1,18 +0,0 @@
|
||||
: solaris.i386-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.i386-64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m64 -xc99 "$@"
|
||||
@@ -1,18 +0,0 @@
|
||||
: solaris.sparc cc wrapper for reasonable ansi C defaults and 32 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.sparc
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m32 -xc99 "$@"
|
||||
@@ -1,18 +0,0 @@
|
||||
: solaris.sparc-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2021-01-17 :
|
||||
|
||||
HOSTTYPE=sol11.sparc-64
|
||||
|
||||
case " $* " in
|
||||
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
|
||||
esac
|
||||
|
||||
# Solaris build scripts set $CC_EXPLICIT. If not set, function without it.
|
||||
case ${CC_EXPLICIT:=$CC} in
|
||||
'' | cc)
|
||||
PATH=`/usr/bin/getconf PATH` # avoid infinite recursion executing 'cc'
|
||||
CC_EXPLICIT=cc
|
||||
esac
|
||||
|
||||
# Note: the _XPG6 macro is now defined in src/lib/libast/features/common
|
||||
|
||||
$CC_EXPLICIT -m64 -xc99 "$@"
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -31,7 +32,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
[-?
|
||||
@(#)$Id: crossexec (AT&T Labs Research) 2004-01-04 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
||||
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
|
||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
||||
[+NAME?crossexec - cross compiler a.out execution]
|
||||
[+DESCRIPTION?\bcrossexec\b runs a cross-compiled \acommand\a in an environment
|
||||
that supports a cross-compilation architecture different from the
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -1,460 +0,0 @@
|
||||
########################################################################
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Information and Software Systems Research #
|
||||
# AT&T Research #
|
||||
# Florham Park NJ #
|
||||
# #
|
||||
# Glenn Fowler <gsf@research.att.com> #
|
||||
# #
|
||||
########################################################################
|
||||
: replicate directory hierarchies
|
||||
|
||||
COMMAND=ditto
|
||||
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
0123) ARGV0="-a $COMMAND"
|
||||
USAGE=$'
|
||||
[-?
|
||||
@(#)$Id: ditto (AT&T Labs Research) 2010-11-22 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?ditto - replicate directory hierarchies]
|
||||
[+DESCRIPTION?\bditto\b replicates the \asource\a directory hierarchy
|
||||
to the \adestination\a directory hierarchy. Both \asource\a and
|
||||
\adestination\a may be of the form
|
||||
[\auser\a@]][\ahost\a:]][\adirectory\a]]. At least one of
|
||||
\ahost\a: or \adirectory\a must be specified. The current user is used
|
||||
if \auser@\a is omitted, the local host is used if \ahost\a: is
|
||||
omitted, and the user home directory is used if \adirectory\a is
|
||||
omitted.]
|
||||
[+?Remote hosts and files are accessed via \bssh\b(1) or \brsh\b(1). \bksh\b(1),
|
||||
\bpax\b(1), and \btw\b(1) must be installed on the local and remote hosts.]
|
||||
[+?For each source file \bditto\b does one of these actions:]{
|
||||
[+chmod|chown?change the mode and/or ownership of the destination
|
||||
file to match the source]
|
||||
[+copy?copy the source file to the destination]
|
||||
[+delete?delete the destination file]
|
||||
[+skip?the destination file is not changed]
|
||||
}
|
||||
[+?The source and destination hierarchies are generated by \btw\b(1) with
|
||||
the \b--logical\b option. An \b--expr\b option may
|
||||
be specified to prune the search. The \btw\b searches are relative to
|
||||
the \asource\a and \adestination\a directories.]
|
||||
[c:checksum?Copy if the \btw\b(1) 32x4 checksum mismatches.]
|
||||
[d:delete?Delete \adestination\a files that are not in the \asource\a.]
|
||||
[e:expr?\btw\b(1) select expression.]:[tw-expression]
|
||||
[m!:mode?Preserve file mode.]
|
||||
[n:show?Show the operations but do not execute.]
|
||||
[o:owner?Preserve file user and group ownership.]
|
||||
[p:physical?Generate source and destination hierarchies by \btw\b(1) with
|
||||
the \b--physical\b option.]
|
||||
[r:remote?The remote access protocol; either \bssh\b or
|
||||
\brsh\b.]:[protocol:=ssh]
|
||||
[u:update?Copy only if the \asource\a file is newer than the
|
||||
\adestination\a file.]
|
||||
[v:verbose?Trace the operations as they are executed.]
|
||||
[D:debug?Enable the debug trace.]
|
||||
|
||||
source destination
|
||||
|
||||
[+SEE ALSO?\brdist\b(1), \brsync\b(1), \brsh\b(1), \bssh\b(1), \btw\b(1)]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE="de:[tw-expression]mnouvD source destination"
|
||||
;;
|
||||
esac
|
||||
|
||||
usage()
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
|
||||
parse() # id user@host:dir
|
||||
{
|
||||
typeset id dir user host
|
||||
id=$1
|
||||
dir=$2
|
||||
(( debug || ! exec )) && print -r $id $dir
|
||||
if [[ $dir == *@* ]]
|
||||
then
|
||||
user=${dir%%@*}
|
||||
dir=${dir#${user}@}
|
||||
else
|
||||
user=
|
||||
fi
|
||||
if [[ $dir == *:* ]]
|
||||
then
|
||||
host=${dir%%:*}
|
||||
dir=${dir#${host}:}
|
||||
else
|
||||
host=
|
||||
fi
|
||||
if [[ $user ]]
|
||||
then
|
||||
user="-l $user"
|
||||
if [[ ! $host ]]
|
||||
then
|
||||
host=$(hostname)
|
||||
fi
|
||||
fi
|
||||
eval ${id}_user='$user'
|
||||
eval ${id}_host='$host'
|
||||
eval ${id}_dir='$dir'
|
||||
}
|
||||
|
||||
# initialize
|
||||
|
||||
typeset -A chown chmod
|
||||
typeset tw cp rm link
|
||||
integer ntw=0 ncp=0 nrm=0 nlink=0 n
|
||||
|
||||
typeset src_user src_host src_path src_type src_uid src_gid src_perm src_sum
|
||||
typeset dst_user dst_host dst_path dst_type dst_uid dst_gid dst_perm dst_sum
|
||||
integer src_size src_mtime src_eof
|
||||
integer dst_size dst_mtime dst_eof
|
||||
|
||||
integer debug=0 delete=0 exec=1 mode=1 owner=0 update=0 verbose=0 logical
|
||||
|
||||
typeset remote=ssh trace
|
||||
typeset checksum='"-"' pax="pax"
|
||||
typeset paxreadflags="" paxwriteflags="--write --format=tgz --nosummary"
|
||||
|
||||
tw[ntw++]=tw
|
||||
(( logical=ntw ))
|
||||
tw[ntw++]=--logical
|
||||
tw[ntw++]=--chop
|
||||
tw[ntw++]=--ignore-errors
|
||||
tw[ntw++]=--expr=sort:name
|
||||
|
||||
# grab the options
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
c) checksum=checksum ;;
|
||||
d) delete=1 ;;
|
||||
e) tw[ntw++]=--expr=\"$OPTARG\" ;;
|
||||
m) mode=0 ;;
|
||||
n) exec=0 verbose=1 ;;
|
||||
o) owner=1 ;;
|
||||
p) tw[logical]=--physical ;;
|
||||
r) remote=$OPTARG ;;
|
||||
u) update=1 ;;
|
||||
v) verbose=1 ;;
|
||||
D) debug=1 ;;
|
||||
*) usage ;;
|
||||
esac
|
||||
done
|
||||
shift $OPTIND-1
|
||||
if (( $# != 2 ))
|
||||
then usage
|
||||
fi
|
||||
tw[ntw++]=--expr=\''action:printf("%d\t%d\t%s\t%s\t%s\t%-.1s\t%o\t%s\t%s\n", size, mtime, '$checksum', uid, gid, mode, perm, path, symlink);'\'
|
||||
if (( exec ))
|
||||
then
|
||||
paxreadflags="$paxreadflags --read"
|
||||
fi
|
||||
if (( verbose ))
|
||||
then
|
||||
paxreadflags="$paxreadflags --verbose"
|
||||
fi
|
||||
|
||||
# start the source and destination path list generators
|
||||
|
||||
parse src "$1"
|
||||
parse dst "$2"
|
||||
|
||||
# the |& command may exit before the exec &p
|
||||
# the print sync + read delays the |& until the exec &p finishes
|
||||
|
||||
if [[ $src_host ]]
|
||||
then ($remote $src_user $src_host "{ test ! -f .profile || . ./.profile ;} && cd $src_dir && read && ${tw[*]}") 2>&1 |&
|
||||
else (cd $src_dir && read && eval "${tw[@]}") 2>&1 |&
|
||||
fi
|
||||
exec 5<&p 7>&p
|
||||
print -u7 sync
|
||||
exec 7>&-
|
||||
|
||||
if [[ $dst_host ]]
|
||||
then ($remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && cd $dst_dir && read && ${tw[*]}") 2>&1 |&
|
||||
else (cd $dst_dir && read && eval "${tw[@]}") 2>&1 |&
|
||||
fi
|
||||
exec 6<&p 7>&p
|
||||
print -u7 sync
|
||||
exec 7>&-
|
||||
|
||||
# scan through the sorted path lists
|
||||
|
||||
if (( exec ))
|
||||
then
|
||||
src_skip=*
|
||||
dst_skip=*
|
||||
else
|
||||
src_skip=
|
||||
dst_skip=
|
||||
fi
|
||||
src_path='' src_eof=0
|
||||
dst_path='' dst_eof=0
|
||||
ifs=${IFS-$' \t\n'}
|
||||
IFS=$'\t'
|
||||
while :
|
||||
do
|
||||
# get the next source path
|
||||
|
||||
if [[ ! $src_path ]] && (( ! src_eof ))
|
||||
then
|
||||
if read -r -u5 text src_mtime src_sum src_uid src_gid src_type src_perm src_path src_link
|
||||
then
|
||||
if [[ $text != +([[:digit:]]) ]]
|
||||
then
|
||||
print -u2 $COMMAND: source: "'$text'"
|
||||
src_path=
|
||||
continue
|
||||
fi
|
||||
src_size=$text
|
||||
elif (( dst_eof ))
|
||||
then
|
||||
break
|
||||
elif (( src_size==0 ))
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
src_path=
|
||||
src_eof=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# get the next destination path
|
||||
|
||||
if [[ ! $dst_path ]] && (( ! dst_eof ))
|
||||
then
|
||||
if read -r -u6 text dst_mtime dst_sum dst_uid dst_gid dst_type dst_perm dst_path dst_link
|
||||
then
|
||||
if [[ $text != +([[:digit:]]) ]]
|
||||
then
|
||||
print -u2 $COMMAND: destination: $text
|
||||
dst_path=
|
||||
continue
|
||||
fi
|
||||
dst_size=$text
|
||||
elif (( src_eof ))
|
||||
then
|
||||
break
|
||||
elif (( dst_size==0 ))
|
||||
then
|
||||
exit 1
|
||||
else
|
||||
dst_path=
|
||||
dst_eof=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# determine the { cp rm chmod chown } ops
|
||||
|
||||
if (( debug ))
|
||||
then
|
||||
[[ $src_path ]] && print -r -u2 -f $': src %8s %10s %s %s %s %s %3s %s\n' $src_size $src_mtime $src_sum $src_uid $src_gid $src_type $src_perm "$src_path"
|
||||
[[ $dst_path ]] && print -r -u2 -f $': dst %8s %10s %s %s %s %s %3s %s\n' $dst_size $dst_mtime $dst_sum $dst_uid $dst_gid $dst_type $dst_perm "$dst_path"
|
||||
fi
|
||||
if [[ $src_path == $dst_path ]]
|
||||
then
|
||||
if [[ $src_type != $dst_type ]]
|
||||
then
|
||||
rm[nrm++]=$dst_path
|
||||
if [[ $dst_path != $dst_skip ]]
|
||||
then
|
||||
if [[ $dst_type == d ]]
|
||||
then
|
||||
dst_skip="$dst_path/*"
|
||||
print -r rm -r "'$dst_path'"
|
||||
else
|
||||
dst_skip=
|
||||
print -r rm "'$dst_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ $src_type == l ]]
|
||||
then if [[ $src_link != $dst_link ]]
|
||||
then
|
||||
cp[ncp++]=$src_path
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r cp "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
elif [[ $src_type != d ]] && { (( update && src_mtime > dst_mtime )) || (( ! update )) && { (( src_size != dst_size )) || [[ $src_sum != $dst_sum ]] ;} ;}
|
||||
then
|
||||
if [[ $src_path != . ]]
|
||||
then
|
||||
cp[ncp++]=$src_path
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r cp "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
else
|
||||
if (( owner )) && [[ $src_uid != $dst_uid || $src_gid != $dst_gid ]]
|
||||
then
|
||||
chown[$src_uid.$src_gid]="${chown[$src_uid.$src_gid]} '$src_path'"
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r chown $src_uid.$src_gid "'$src_path'"
|
||||
fi
|
||||
if (( (src_perm & 07000) || mode && src_perm != dst_perm ))
|
||||
then
|
||||
chmod[$src_perm]="${chmod[$src_perm]} '$src_path'"
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r chmod $src_perm "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
elif (( mode && src_perm != dst_perm ))
|
||||
then
|
||||
chmod[$src_perm]="${chmod[$src_perm]} '$src_path'"
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
src_skip=
|
||||
print -r chmod $src_perm "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
src_path=
|
||||
dst_path=
|
||||
elif [[ ! $dst_path || $src_path && $src_path < $dst_path ]]
|
||||
then
|
||||
if [[ $src_path != . ]]
|
||||
then
|
||||
cp[ncp++]=$src_path
|
||||
if [[ $src_path != $src_skip ]]
|
||||
then
|
||||
if [[ $src_type == d ]]
|
||||
then
|
||||
src_skip="$src_path/*"
|
||||
print -r cp -r "'$src_path'"
|
||||
else
|
||||
src_skip=
|
||||
print -r cp "'$src_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
src_path=
|
||||
elif [[ $dst_path ]]
|
||||
then
|
||||
if (( delete ))
|
||||
then
|
||||
rm[nrm++]=$dst_path
|
||||
if [[ $dst_path != $dst_skip ]]
|
||||
then
|
||||
if [[ $dst_type == d ]]
|
||||
then
|
||||
dst_skip="$dst_path/*"
|
||||
print -r rm -r "'$dst_path'"
|
||||
else
|
||||
dst_skip=
|
||||
print -r rm "'$dst_path'"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
dst_path=
|
||||
fi
|
||||
done
|
||||
IFS=$ifs
|
||||
|
||||
(( exec )) || exit 0
|
||||
|
||||
# generate, transfer and execute the { rm chown chmod } script
|
||||
|
||||
if (( ${#rm[@]} || ${#chmod[@]} || ${#chown[@]} ))
|
||||
then
|
||||
{
|
||||
if (( verbose ))
|
||||
then
|
||||
print -r -- set -x
|
||||
fi
|
||||
print -nr -- cd "'$dst_dir'"
|
||||
n=0
|
||||
for i in ${rm[@]}
|
||||
do
|
||||
if (( --n <= 0 ))
|
||||
then
|
||||
n=32
|
||||
print
|
||||
print -nr -- rm -rf
|
||||
fi
|
||||
print -nr -- " '$i'"
|
||||
done
|
||||
for i in ${!chown[@]}
|
||||
do
|
||||
n=0
|
||||
for j in ${chown[$i]}
|
||||
do
|
||||
if (( --n <= 0 ))
|
||||
then
|
||||
n=32
|
||||
print
|
||||
print -nr -- chown $i
|
||||
fi
|
||||
print -nr -- " $j"
|
||||
done
|
||||
done
|
||||
for i in ${!chmod[@]}
|
||||
do
|
||||
n=0
|
||||
for j in ${chmod[$i]}
|
||||
do
|
||||
if (( --n <= 0 ))
|
||||
then
|
||||
n=32
|
||||
print
|
||||
print -nr -- chmod $i
|
||||
fi
|
||||
print -nr -- " $j"
|
||||
done
|
||||
done
|
||||
print
|
||||
} | {
|
||||
if (( ! exec ))
|
||||
then
|
||||
cat
|
||||
elif [[ $dst_host ]]
|
||||
then
|
||||
$remote $dst_user $dst_host sh
|
||||
else
|
||||
$SHELL
|
||||
fi
|
||||
}
|
||||
fi
|
||||
|
||||
# generate, transfer and read back the { cp } tarball
|
||||
|
||||
if (( ${#cp[@]} ))
|
||||
then
|
||||
{
|
||||
cd $src_dir &&
|
||||
print -r -f $'%s\n' "${cp[@]}" |
|
||||
$pax $paxwriteflags
|
||||
} | {
|
||||
if [[ $dst_host ]]
|
||||
then
|
||||
$remote $dst_user $dst_host "{ test ! -f .profile || . ./.profile ;} && { test -d \"$dst_dir\" || mkdir -p \"$dst_dir\" ;} && cd \"$dst_dir\" && gunzip | $pax $paxreadflags"
|
||||
else
|
||||
( { test -d "$dst_dir" || mkdir -p "$dst_dir" ;} && cd "$dst_dir" && gunzip | $pax $paxreadflags )
|
||||
fi
|
||||
}
|
||||
wait
|
||||
fi
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -17,7 +18,7 @@
|
||||
# Glenn Fowler <gsf@research.att.com> #
|
||||
# #
|
||||
########################################################################
|
||||
: wrapper for .exe challenged win32 systems/commands
|
||||
: wrapper for .exe challenged Win32 systems/commands
|
||||
|
||||
(command set -o posix) 2>/dev/null && set -o posix
|
||||
|
||||
@@ -37,11 +38,13 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
[-?
|
||||
@(#)$Id: execrate (AT&T Labs Research) 2002-02-02 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
||||
[-copyright?Copyright (c) 2002-2012 AT&T Intellectual Property]
|
||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
||||
[+NAME?execrate - wrapper for .exe challenged commands]
|
||||
[+DESCRIPTION?\bexecrate\b runs \acommand\a after checking the \afile\a
|
||||
operands for standard semantics with respect to \bwin32\b \b.exe\b
|
||||
suffix conventions. This command is only needed on \bwin32\b
|
||||
operands for standard semantics with respect to \bWin32\b \b.exe\b
|
||||
suffix conventions. This command is only needed on \bWin32\b
|
||||
systems that inconsistently handle \b.exe\b across library and
|
||||
command interfaces. \acommand\a may be one of \bcat\b(1), \bchmod\b(1),
|
||||
\bcmp\b(1), \bcp\b(1), \bln\b(1), \bmv\b(1), or \brm\b(1).
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -34,7 +35,9 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
[-?
|
||||
@(#)$Id: filter (AT&T Labs Research) 2001-05-31 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
||||
[-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property]
|
||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
||||
[+NAME?filter - run a command in stdin/stdout mode]
|
||||
[+DESCRIPTION?\bfilter\b runs \acommand\a in a mode that takes input from
|
||||
the \afile\a operands, or from the standard input if no \afile\a
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -1,209 +0,0 @@
|
||||
########################################################################
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Information and Software Systems Research #
|
||||
# AT&T Research #
|
||||
# Florham Park NJ #
|
||||
# #
|
||||
# Glenn Fowler <gsf@research.att.com> #
|
||||
# #
|
||||
########################################################################
|
||||
: copy http url data
|
||||
|
||||
(command set -o posix) 2>/dev/null && set -o posix
|
||||
|
||||
command=hurl
|
||||
agent="$command/2009-01-20 (AT&T Research)"
|
||||
authorize=
|
||||
verbose=0
|
||||
|
||||
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
0123) ARGV0="-a $command"
|
||||
USAGE=$'
|
||||
[-?
|
||||
@(#)$Id: hurl (AT&T Research) 2009-01-20 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[+NAME?hurl - copy http url data]
|
||||
[+DESCRIPTION?\bhurl\b copies the data for the \bhttp\b \aurl\a operand
|
||||
to the standard output. The \aurl\a must be of the form
|
||||
\b[http://]]\b\ahost\a[\b:\b\aport\a]]\b/\b\apath\a. The default
|
||||
\aport\a is \b80\b.]
|
||||
[+?\bhurl\b is a shell script that attempts to access the \aurl\a by
|
||||
these methods:]{
|
||||
[+/dev/tcp/\ahost\a\b/80\b?Supported by \bksh\b(1) and recent
|
||||
\bbash\b(1).]
|
||||
[+wget -nv -O - \aurl\a?]
|
||||
[+lynx -source \aurl\a?]
|
||||
[+curl -s -L -o - \aurl\a?]
|
||||
}
|
||||
[a:authorize?The url authorization user name and password, separated
|
||||
by \b:\b (one colon character.)]:[user::password]
|
||||
[s:size?Terminate the data transmission after \abytes\a have been
|
||||
transferred.]:[bytes]
|
||||
[v:verbose?Verbose trace.]
|
||||
|
||||
url
|
||||
|
||||
[+SEE ALSO?\bcurl\b(1), \blynx\b(1), \bwget\b(1)]
|
||||
'
|
||||
;;
|
||||
*) ARGV0=""
|
||||
USAGE="a:v"
|
||||
;;
|
||||
esac
|
||||
|
||||
usage()
|
||||
{
|
||||
OPTIND=0
|
||||
getopts $ARGV0 "$USAGE" OPT '-?'
|
||||
exit 2
|
||||
}
|
||||
|
||||
integer limit=0 total=0 block=8*1024
|
||||
|
||||
while getopts $ARGV0 "$USAGE" OPT
|
||||
do case $OPT in
|
||||
a) authorize=$OPTARG ;;
|
||||
s) limit=$OPTARG ;;
|
||||
v) verbose=1 ;;
|
||||
esac
|
||||
done
|
||||
shift `expr $OPTIND - 1`
|
||||
|
||||
url=$1
|
||||
AUTHORIZE=
|
||||
|
||||
exec 9<&0
|
||||
|
||||
while :
|
||||
do test 0 != $verbose && echo "$command: url=$url" >&2
|
||||
case $url in
|
||||
*://*/*)prot=${url%%:*}
|
||||
url=${url#*://}
|
||||
;;
|
||||
*) prot=http
|
||||
;;
|
||||
esac
|
||||
host=$url
|
||||
path=/${host#*/}
|
||||
host=${host%%/*}
|
||||
case $host in
|
||||
*:+([0-9]))
|
||||
port=${host##*:}
|
||||
host=${host%:*}
|
||||
;;
|
||||
*) port=80
|
||||
;;
|
||||
esac
|
||||
test 0 != $verbose && echo "$command: prot=$prot host=$host port=$port path=$path" >&2
|
||||
case $prot in
|
||||
http) if (eval "exec >" || exit 0) 2>/dev/null &&
|
||||
eval "exec 8<> /dev/tcp/\$host/$port" 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using /dev/tcp/$host/$port" >&2
|
||||
if ! echo "GET $path HTTP/1.0
|
||||
Host: $host
|
||||
User-Agent: $agent
|
||||
${AUTHORIZE}
|
||||
|
||||
" >&8
|
||||
then echo "$command: $host: write error"
|
||||
exit 1
|
||||
fi
|
||||
{
|
||||
if ! read prot code text
|
||||
then echo "$command: $host: read error" >&2
|
||||
exit 1
|
||||
fi
|
||||
code=${code%:*}
|
||||
type=Basic
|
||||
realm=access
|
||||
test 0 != $verbose && echo "$command: prot=$prot code=$code $text" >&2
|
||||
while :
|
||||
do if ! read head data
|
||||
then echo "$command: $host: read error" >&2
|
||||
exit 1
|
||||
fi
|
||||
test 0 != $verbose && echo "$command: head=$head $data" >&2
|
||||
case $head in
|
||||
Location:)
|
||||
case $code in
|
||||
30[123])url=$data
|
||||
continue 2
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
WWW-Authenticate:)
|
||||
set -- $data
|
||||
type=$1
|
||||
shift
|
||||
eval "$@"
|
||||
realm=${realm%$'\r'}
|
||||
;;
|
||||
''|?) break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
case $code in
|
||||
200) if (( limit ))
|
||||
then (( limit = (limit + block - 1) / block))
|
||||
dd bs=$block count=$limit silent=1
|
||||
else cat
|
||||
fi
|
||||
exit
|
||||
;;
|
||||
401) {
|
||||
if [[ $AUTHORIZE || $type != Basic ]]
|
||||
then print authorization failed
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! $authorize ]]
|
||||
then if [[ ! -t 0 ]]
|
||||
then print authorization failed
|
||||
exit 1
|
||||
fi
|
||||
print -n "Enter user name for $realm: "
|
||||
read -u9 user
|
||||
print -n "Password: "
|
||||
trap 'stty echo <&9' 0 1 2 3 15
|
||||
stty -echo
|
||||
read password
|
||||
stty echo
|
||||
print
|
||||
trap - 0 1 2 3 15
|
||||
authorize=$user:$password
|
||||
fi
|
||||
AUTHORIZE=$'\nAuthorization: '$type' '$(print -n -r -- "$authorize" | uuencode -h -x base64)$'\r'
|
||||
} <&9 >&2
|
||||
continue 2
|
||||
;;
|
||||
*) echo "$0: $url: $code: $text" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
} <&8
|
||||
elif wget ${authorize:+--http-user="${authorize%:*}"} ${password:+--http-passwd="${password##*:}"} -nv -O - $url 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using wget" >&2
|
||||
exit
|
||||
elif lynx ${authorize:+-auth "$authorize"} -source $url 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using wget" >&2
|
||||
exit
|
||||
elif curl ${authorize:+-u "$authorize"} -s -L -o - $url 2>/dev/null
|
||||
then test 0 != $verbose && echo "$command: using curl" >&2
|
||||
exit
|
||||
else echo "$command: $url: { /dev/tcp/$host/$port wget curl } failed" >&2
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
*) echo "$command: $prot: protocol not supported" >&2
|
||||
exit 1
|
||||
;;
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,7 +12,7 @@ TEST 01 'command line basics'
|
||||
ERROR - $'iffe: test: is sys/types.h a header ... yes
|
||||
iffe: test: is stdio.h a header ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - hdr stdio
|
||||
EXEC -r -v -s posix - hdr stdio
|
||||
|
||||
EXEC -r -v - hdr stdio,limits
|
||||
OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */
|
||||
@@ -26,7 +26,7 @@ iffe: test: is stdio.h a header ... yes'
|
||||
iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is limits.h a header ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - hdr stdio,limits
|
||||
EXEC -r -v -s posix - hdr stdio,limits
|
||||
|
||||
EXEC -r -v - hdr,lib no_foo_bar,no_bar_foo stdio.h
|
||||
OUTPUT - $'/* : : generated by iffe version 1995-03-19 : : */
|
||||
@@ -42,11 +42,11 @@ iffe: test: is no_bar_foo.h a header ... no
|
||||
iffe: test: is no_foo_bar a library function ... no
|
||||
iffe: test: is no_bar_foo a library function ... no'
|
||||
|
||||
EXEC -r -v -s bsh - hdr,lib no_foo_bar,no_bar_foo stdio.h
|
||||
EXEC -r -v -s posix - hdr,lib no_foo_bar,no_bar_foo stdio.h
|
||||
|
||||
EXEC -r -v - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h
|
||||
|
||||
EXEC -r -v -s bsh - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h
|
||||
EXEC -r -v -s posix - hdr no_foo_bar,no_bar_foo stdio.h : lib no_foo_bar,no_bar_foo stdio.h
|
||||
|
||||
TEST 02 'file input basics'
|
||||
|
||||
@@ -61,7 +61,7 @@ TEST 02 'file input basics'
|
||||
ERROR - $'iffe: test: is sys/types.h a header ... yes
|
||||
iffe: test: is stdio.h a header ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t1.iffe
|
||||
EXEC -r -v -s posix - t1.iffe
|
||||
|
||||
EXEC -r -v - t2.iffe
|
||||
INPUT t2.iffe $'hdr stdio,limits'
|
||||
@@ -76,7 +76,7 @@ iffe: test: is stdio.h a header ... yes'
|
||||
iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is limits.h a header ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t2.iffe
|
||||
EXEC -r -v -s posix - t2.iffe
|
||||
|
||||
EXEC -r -v - t3.iffe
|
||||
INPUT t3.iffe $'hdr,lib no_foo_bar,no_bar_foo stdio.h'
|
||||
@@ -93,13 +93,13 @@ iffe: test: is no_bar_foo.h a header ... no
|
||||
iffe: test: is no_foo_bar a library function ... no
|
||||
iffe: test: is no_bar_foo a library function ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t3.iffe
|
||||
EXEC -r -v -s posix - t3.iffe
|
||||
|
||||
EXEC -r -v - t3.iffe
|
||||
INPUT t3.iffe $'hdr no_foo_bar,no_bar_foo stdio.h
|
||||
lib no_foo_bar,no_bar_foo stdio.h'
|
||||
|
||||
EXEC -r -v -s bsh - t3.iffe
|
||||
EXEC -r -v -s posix - t3.iffe
|
||||
|
||||
TEST 03 'nested if'
|
||||
|
||||
@@ -136,7 +136,7 @@ endif'
|
||||
iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is open a library function ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -170,7 +170,7 @@ HIT 4
|
||||
iffe: test: is _XXX_stdio.h a header ... no
|
||||
iffe: test: is limits.h a header ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -203,7 +203,7 @@ HIT 5
|
||||
iffe: test: is _XXX_stdio.h a header ... no
|
||||
iffe: test: is _XXX_limits.h a header ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -239,7 +239,7 @@ iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is _XXX_open a library function ... no
|
||||
iffe: test: is close a library function ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -274,7 +274,7 @@ iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is _XXX_open a library function ... no
|
||||
iffe: test: is _XXX_close a library function ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -312,7 +312,7 @@ iffe: test: is stat a type or typedef ... no
|
||||
iffe: test: is st_atime a member of struct stat ... yes
|
||||
iffe: test: is ( !no_stat_time ) true ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -352,7 +352,7 @@ iffe: test: is stat a type or typedef ... no
|
||||
iffe: test: is st_ctime a member of struct stat ... yes
|
||||
iffe: test: is ( !no_stat_time ) true ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -393,7 +393,7 @@ iffe: test: is stat a type or typedef ... no
|
||||
iffe: test: is st_mtime a member of struct stat ... yes
|
||||
iffe: test: is ( !no_stat_time ) true ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff ifelse
|
||||
@@ -430,7 +430,7 @@ iffe: test: is st_ctime a member of struct foo_stat ... no
|
||||
iffe: test: is st_mtime a member of struct foo_stat ... no
|
||||
iffe: test: is ( !no_stat_time ) true ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'set explicit
|
||||
@@ -453,7 +453,7 @@ OK
|
||||
ERROR - $'iffe: test: is sys/types.h a header ... yes
|
||||
iffe: test: is stdio.h a header ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
TEST 04 'test variable/macro override'
|
||||
|
||||
@@ -469,7 +469,7 @@ HAVE_STDIO = hdr stdio'
|
||||
ERROR - $'iffe: test: is sys/types.h a header ... yes
|
||||
iffe: test: is stdio.h a header ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -485,7 +485,7 @@ endif'
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -494,7 +494,7 @@ if - hdr stdio {
|
||||
}
|
||||
endif'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -503,7 +503,7 @@ if ? hdr stdio {
|
||||
}
|
||||
endif'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -512,7 +512,7 @@ if hdr - stdio {
|
||||
}
|
||||
endif'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -538,7 +538,7 @@ endif'
|
||||
iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is ( HAVE_STDIO ) true ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -560,7 +560,7 @@ exp ALSO HAVE_STDIO'
|
||||
iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is HAVE_STDIO true ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -582,7 +582,7 @@ ALSO = ( HAVE_STDIO )'
|
||||
iffe: test: is stdio.h a header ... yes
|
||||
iffe: test: is ( HAVE_STDIO ) true ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
TEST 05 'test code option sequence'
|
||||
|
||||
@@ -605,7 +605,7 @@ tst seq - -DA=1 - -DB=1 note{ long int type }end compile{
|
||||
ERROR - 'iffe: test: is sys/types.h a header ... yes
|
||||
iffe: test: long int type ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -618,7 +618,7 @@ tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
|
||||
t n = 0;
|
||||
}end'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -634,7 +634,7 @@ tst seq - -DA=1 - -DB=1 note{ long int type }end compile{
|
||||
iffe: test: long int type ...
|
||||
iffe: test: long int type ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -647,7 +647,7 @@ tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
|
||||
t n = 0;
|
||||
}end'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -668,7 +668,7 @@ tst seq - -DA=1 - -DB=1 note{ long int type }end compile{
|
||||
iffe: test: long int type ...
|
||||
iffe: test: long int type ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -681,7 +681,7 @@ tst seq -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
|
||||
t n = 0;
|
||||
}end'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -707,7 +707,7 @@ endif'
|
||||
ERROR - 'iffe: test: is sys/types.h a header ... yes
|
||||
iffe: test: long int type ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -723,7 +723,7 @@ if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
|
||||
}
|
||||
endif'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -742,7 +742,7 @@ endif'
|
||||
iffe: test: long int type ...
|
||||
iffe: test: long int type ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -758,7 +758,7 @@ if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
|
||||
}
|
||||
endif'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -782,7 +782,7 @@ endif'
|
||||
iffe: test: long int type ...
|
||||
iffe: test: long int type ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -798,7 +798,7 @@ if tst -DG=1 - -DN=1 - -DN=2 note{ long int type }end compile{
|
||||
}
|
||||
endif'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -824,7 +824,7 @@ endif'
|
||||
ERROR - 'iffe: test: is sys/types.h a header ... yes
|
||||
iffe: test: long int type ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -843,7 +843,7 @@ endif'
|
||||
iffe: test: long int type ...
|
||||
iffe: test: long int type ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -863,7 +863,7 @@ iffe: test: long int type ...
|
||||
iffe: test: long int type ...
|
||||
iffe: test: long int type ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -r -v - t.iffe
|
||||
INPUT t.iffe $'iff macro
|
||||
@@ -888,7 +888,7 @@ iffe: test: long int type ...
|
||||
iffe: test: long int type ...
|
||||
iffe: test: long int type ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
TEST 06 'block side effects'
|
||||
|
||||
@@ -906,7 +906,7 @@ tst output{
|
||||
#define _sys_types 1 /* #include <sys/types.h> ok */
|
||||
HIT'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'iff
|
||||
@@ -919,7 +919,7 @@ tst - output{
|
||||
}
|
||||
}end'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'iff
|
||||
@@ -934,7 +934,7 @@ tst - output{
|
||||
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
|
||||
#define _sys_types 1 /* #include <sys/types.h> ok */'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'iff
|
||||
@@ -950,7 +950,7 @@ tst - nooutput{
|
||||
#define _sys_types 1 /* #include <sys/types.h> ok */
|
||||
HIT'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
TEST 07 'diagnostics'
|
||||
|
||||
@@ -964,7 +964,7 @@ TEST 07 'diagnostics'
|
||||
ERROR - $'iffe: t.iffe:1: tst: unknown feature test'
|
||||
EXIT 1
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'if (1)'
|
||||
@@ -975,7 +975,7 @@ TEST 07 'diagnostics'
|
||||
ERROR - $'iffe: t.iffe:1: missing endif'
|
||||
EXIT 1
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'if'
|
||||
@@ -985,20 +985,20 @@ TEST 07 'diagnostics'
|
||||
#define _sys_types 1 /* #include <sys/types.h> ok */'
|
||||
ERROR - $'iffe: t.iffe:1: missing endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'endif'
|
||||
ERROR - $'iffe: t.iffe:1: endif: no matching if'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'if {
|
||||
}end'
|
||||
ERROR - $'iffe: t.iffe:2: missing }'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
TEST 08 'negation consternation'
|
||||
|
||||
@@ -1121,7 +1121,7 @@ ONE
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1146,7 +1146,7 @@ exp _tst_hit !_tst_hit&_tst_true {
|
||||
TWO 0 1
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1173,7 +1173,7 @@ THREE
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1196,7 +1196,7 @@ exp _tst_hit !_tst_hit&_tst_false {
|
||||
#define _tst_true 1 /* ( 1 ) is true */
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1223,7 +1223,7 @@ ONE
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1248,7 +1248,7 @@ exp _tst_hit !_tst_hit&&_tst_true {
|
||||
TWO 0 1
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1275,7 +1275,7 @@ THREE
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1298,7 +1298,7 @@ exp _tst_hit !_tst_hit&&_tst_false {
|
||||
#define _tst_true 1 /* ( 1 ) is true */
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1324,7 +1324,7 @@ ONE
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1349,7 +1349,7 @@ endif'
|
||||
TWO
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1375,7 +1375,7 @@ THREE
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1394,7 +1394,7 @@ endif'
|
||||
#define _tst_true 1 /* ( 1 ) is true */
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1418,7 +1418,7 @@ OK
|
||||
|
||||
#endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
EXEC -r - t.iffe
|
||||
INPUT t.iffe $'_tst_false = ( 0 )
|
||||
@@ -1434,7 +1434,7 @@ else {
|
||||
}
|
||||
endif'
|
||||
|
||||
EXEC -r -s bsh - t.iffe
|
||||
EXEC -r -s posix - t.iffe
|
||||
|
||||
TEST 10 'exp details'
|
||||
|
||||
@@ -1471,7 +1471,7 @@ iffe: test: is ( ! _aaa ) true ... yes
|
||||
iffe: test: is ( _zzz ) true ... yes
|
||||
iffe: test: is ( ! _zzz ) true ... no'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
TEST 11 'set [no]define'
|
||||
|
||||
@@ -1505,7 +1505,7 @@ iffe: test: is st_mode a member of struct stat ... yes
|
||||
iffe: test: is ( _mem_st_mtime_stat ) true ... yes
|
||||
iffe: test: is ( _mem_st_mode_stat ) true ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
TEST 12 'non-opaque mem'
|
||||
|
||||
@@ -1567,7 +1567,7 @@ iffe: test: is huh a reserved keyword ... no
|
||||
iffe: test: is chr a reserved keyword ... no
|
||||
iffe: test: is char a reserved keyword ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -u -r -v - t.iffe
|
||||
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
|
||||
@@ -1585,7 +1585,7 @@ iffe: test: is char a reserved keyword ... yes'
|
||||
#define chr char /* alternate for reserved keyword chr */
|
||||
#endif'
|
||||
|
||||
EXEC -u -r -v -s bsh - t.iffe
|
||||
EXEC -u -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -a -r -v - t.iffe
|
||||
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
|
||||
@@ -1603,7 +1603,7 @@ iffe: test: is char a reserved keyword ... yes'
|
||||
#define chr char /* alternate for reserved keyword chr */
|
||||
#endif'
|
||||
|
||||
EXEC -a -r -v -s bsh - t.iffe
|
||||
EXEC -a -r -v -s posix - t.iffe
|
||||
|
||||
EXEC -C -r -v - t.iffe
|
||||
OUTPUT - $'/* : : generated from t.iffe by iffe version 1995-03-19 : : */
|
||||
@@ -1621,7 +1621,7 @@ iffe: test: is char a reserved keyword ... yes'
|
||||
#define chr char /* alternate for reserved keyword chr */
|
||||
#endif'
|
||||
|
||||
EXEC -C -r -v -s bsh - t.iffe
|
||||
EXEC -C -r -v -s posix - t.iffe
|
||||
|
||||
TEST 14 'inc file'
|
||||
|
||||
@@ -1739,9 +1739,7 @@ iffe: test: is ( 1 ) true ... yes
|
||||
iffe: test: is ( 2 ) true ... yes
|
||||
iffe: test: cat{ ... }end ... yes'
|
||||
|
||||
EXEC -r -v -s bsh - t.iffe
|
||||
|
||||
EXEC -r -v -s osh - t.iffe
|
||||
EXEC -r -v -s posix - t.iffe
|
||||
|
||||
TEST 16 '{ define extern include print }'
|
||||
|
||||
@@ -1778,71 +1776,9 @@ iffe: test: is Tab_lE a symbol that needs a prototype ... yes'
|
||||
TEST 17 'features/* => FEATURE/*'
|
||||
|
||||
EXEC -r -v run features/stdio
|
||||
INPUT features/stdio $'set prototyped
|
||||
header stdio.h'
|
||||
OUTPUT FEATURE/stdio $'
|
||||
/* : : generated by proto : : */
|
||||
/* : : generated from features/stdio by iffe version 1995-03-19 : : */
|
||||
|
||||
INPUT features/stdio $'header stdio.h'
|
||||
OUTPUT FEATURE/stdio $'/* : : generated from features/stdio by iffe version 1995-03-19 : : */
|
||||
#ifndef _REGRESS
|
||||
#if !defined(__PROTO__)
|
||||
# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
|
||||
# if defined(__cplusplus)
|
||||
# define __LINKAGE__ "C"
|
||||
# else
|
||||
# define __LINKAGE__
|
||||
# endif
|
||||
# define __STDARG__
|
||||
# define __PROTO__(x) x
|
||||
# define __OTORP__(x)
|
||||
# define __PARAM__(n,o) n
|
||||
# if !defined(__STDC__) && !defined(__cplusplus)
|
||||
# if !defined(c_plusplus)
|
||||
# define const
|
||||
# endif
|
||||
# define signed
|
||||
# define void int
|
||||
# define volatile
|
||||
# define __V_ char
|
||||
# else
|
||||
# define __V_ void
|
||||
# endif
|
||||
# else
|
||||
# define __PROTO__(x) ()
|
||||
# define __OTORP__(x) x
|
||||
# define __PARAM__(n,o) o
|
||||
# define __LINKAGE__
|
||||
# define __V_ char
|
||||
# define const
|
||||
# define signed
|
||||
# define void int
|
||||
# define volatile
|
||||
# endif
|
||||
# define __MANGLE__ __LINKAGE__
|
||||
# if defined(__cplusplus) || defined(c_plusplus)
|
||||
# define __VARARG__ ...
|
||||
# else
|
||||
# define __VARARG__
|
||||
# endif
|
||||
# if defined(__STDARG__)
|
||||
# define __VA_START__(p,a) va_start(p,a)
|
||||
# else
|
||||
# define __VA_START__(p,a) va_start(p)
|
||||
# endif
|
||||
# if !defined(__INLINE__)
|
||||
# if defined(__cplusplus)
|
||||
# define __INLINE__ extern __MANGLE__ inline
|
||||
# else
|
||||
# if defined(_WIN32) && !defined(__GNUC__)
|
||||
# define __INLINE__ __inline
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if !defined(__LINKAGE__)
|
||||
#define __LINKAGE__ /* 2004-08-11 transition */
|
||||
#endif
|
||||
|
||||
#define _REGRESS 1
|
||||
#define _sys_types 1 /* #include <sys/types.h> ok */
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -18,20 +19,14 @@
|
||||
# #
|
||||
########################################################################
|
||||
# non-ksh script for the nmake ignore prefix
|
||||
# @(#)ignore (AT&T Research) 1992-08-11
|
||||
|
||||
(command set -o posix) 2>/dev/null && set -o posix
|
||||
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
|
||||
# @(#)ignore (ksh 93u+m) 2021-12-31
|
||||
|
||||
while :
|
||||
do case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
case $1 in
|
||||
*=*) case $modern_export in
|
||||
ok) export "$1" ;;
|
||||
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
|
||||
esac
|
||||
*=*) export "$1"
|
||||
shift
|
||||
;;
|
||||
*) break
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/env sh
|
||||
: cygwin.i386 ldd -- how many ways does this confirm the windows bias?
|
||||
: cygwin.i386 ldd -- how many ways does this confirm the Windows bias?
|
||||
for f
|
||||
do case $f in
|
||||
*.exe) ;;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
: mac os10 ldd
|
||||
: Mac OS X ldd
|
||||
otool -L "$@"
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -72,7 +72,6 @@ extern int i;
|
||||
int i = 1;
|
||||
extern int f(){return(!i);}
|
||||
int main(){FILE* fp=stdin;return(f());}' > pic.$src
|
||||
echo 'class x {int n;} m;' > plusplus.$src
|
||||
echo 'int prefix(){return 0;}' > prefix.$src
|
||||
echo 'template<class T> int gt(T a, T b);
|
||||
template<class T> int gt(T a, T b) { return a > b; }
|
||||
@@ -89,7 +88,7 @@ echo '#if mips && !sgi || __CYGWIN__
|
||||
CONST char x[]={1,2,3,4,5,6,7,8,9,0};
|
||||
int main(){*(char*)x=0; return x[0];}
|
||||
#endif' > readonly.$src
|
||||
# NOTE: sfclose() defined on uwin, not defined on all other systems
|
||||
# NOTE: sfclose() defined on UWIN, not defined on all other systems
|
||||
echo 'extern int sfclose(); extern int ShareD(){return(sfclose());}' > shared.$src
|
||||
echo '#define g(a,b) a ## b
|
||||
volatile int a;
|
||||
@@ -102,9 +101,7 @@ int i;
|
||||
int main(){int j;j = i * 10;return j;}' > strip.$src
|
||||
echo 'template <class T> void f(T){}
|
||||
int main(){f(1);return 0;}' > toucho.$src
|
||||
echo '#if defined(__STDC__) || defined(__cplusplus)
|
||||
extern type call(int);
|
||||
#endif
|
||||
echo 'extern type call(int);
|
||||
int main() {call(0);return(0);}' > tstlib.$src
|
||||
echo 'int main(){return 0;}' > warn.$src
|
||||
echo 'int f(){return 0;}' > warn1.$src
|
||||
@@ -154,7 +151,6 @@ nmedit=
|
||||
nmflags=
|
||||
no_protect=
|
||||
optimize=
|
||||
plusplus=
|
||||
prefix_archive=lib
|
||||
prefix_dynamic=
|
||||
prefix_shared=lib
|
||||
@@ -404,7 +400,7 @@ int main() { f(); return 0; }' > picok.$src
|
||||
}
|
||||
case $1 in
|
||||
-Wc,*exportall*)
|
||||
# get specific since sgi gets this far too
|
||||
# get specific since SGI gets this far too
|
||||
rm -f pic.$exe pic.x
|
||||
$cc -Wl,dll -o pic.$exe pic.$obj || continue
|
||||
test -f pic.$exe || continue
|
||||
@@ -433,7 +429,6 @@ int main() { f(); return 0; }' > picok.$src
|
||||
esac
|
||||
fi
|
||||
|
||||
$cc -c plusplus.$src && plusplus=1
|
||||
$cc -E -dD dDflag.$src > t
|
||||
case `grep '#define[ ][ ]*dDflag[ ][ ]*on' t` in
|
||||
?*) dDflag=1 ;;
|
||||
@@ -441,90 +436,7 @@ esac
|
||||
case `grep '#define.*_GNUC_' t` in
|
||||
?*) gnu=1 ;;
|
||||
esac
|
||||
case $plusplus in
|
||||
"") $cc -c stdc.$src && stdc=1 ;;
|
||||
*) mkdir ptr
|
||||
cd ptr
|
||||
$cc -c ../ptr.$src &
|
||||
NFS_locks_are_botched=$!
|
||||
cd ..
|
||||
if $cc -c require.$src && $cc require.$obj
|
||||
then set x `$cc require.$obj 2>&1`
|
||||
d=
|
||||
while :
|
||||
do shift
|
||||
case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
case $1 in
|
||||
-l*) d="$d $1" ;;
|
||||
esac
|
||||
done
|
||||
for f in ++
|
||||
do if $cc require.$obj -l$f
|
||||
then set x `$cc require.$obj -l$f 2>&1`
|
||||
r=
|
||||
while :
|
||||
do shift
|
||||
case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
case $1 in
|
||||
-l*) case " $d $r " in
|
||||
*" "$1" "*) ;;
|
||||
*) r="$r $1" ;;
|
||||
esac
|
||||
esac
|
||||
done
|
||||
case $r in
|
||||
?*) require="$require $f"
|
||||
echo '' $r > req.$f
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
fi
|
||||
cd ptr
|
||||
for i in *
|
||||
do if test -d $i
|
||||
then repository=$i
|
||||
break
|
||||
fi
|
||||
done
|
||||
cd ..
|
||||
kill -9 $NFS_locks_are_botched
|
||||
rm -rf ptr
|
||||
case $repository in
|
||||
*?) mkdir ptr
|
||||
cd ptr
|
||||
i=PTR
|
||||
case $repository in
|
||||
$i) i=$i$i ;;
|
||||
esac
|
||||
$cc -ptr$i -c ../ptr.$src &
|
||||
NFS_locks_are_botched=$!
|
||||
cd ..
|
||||
sleep 5
|
||||
if test -d ptr/$i/$repository
|
||||
then ptrimplicit=1
|
||||
fi
|
||||
kill -9 $NFS_locks_are_botched
|
||||
rm -rf ptr
|
||||
;;
|
||||
esac
|
||||
$cc -o implc implc.$src && $executable implc && implicitc=1
|
||||
if $cc -c toucho.$src && test -f toucho.$obj
|
||||
then o=`ls -l toucho.$obj`
|
||||
if $cc -o toucho toucho.$obj && $executable toucho
|
||||
then n=`ls -l touch.$obj`
|
||||
case $n in
|
||||
"$o") ;;
|
||||
*) toucho=1 ;;
|
||||
esac
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
$cc -c stdc.$src && stdc=1
|
||||
|
||||
if $cc -c pic.$src
|
||||
then eval set x $probe_nmflags
|
||||
@@ -660,7 +572,7 @@ case $cc_dll:$cc_pic:$so:$dynamic:$static in
|
||||
if $cc -shared -Wl,--enable-auto-image-base -Wl,--out-implib=xxx.lib -o xxx.dll exp.$obj &&
|
||||
test -f xxx.lib -a -f xxx.dll
|
||||
then
|
||||
: cygwin
|
||||
: Cygwin
|
||||
cc_dll=$cc_dll_def
|
||||
dll_dir='$(BINDIR)'
|
||||
sd=.dll
|
||||
@@ -713,37 +625,34 @@ case $cc_dll:$cc_pic:$so:$dynamic:$static in
|
||||
esac
|
||||
dld=$xx
|
||||
shared=$1
|
||||
# does -nostartfiles make sense for C?
|
||||
case $plusplus in
|
||||
'') z=`wc -c < xxx$dll`
|
||||
eval set x $probe_shared_nostart
|
||||
while :
|
||||
do shift
|
||||
case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
rm -f xxx$dll
|
||||
if $dld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll
|
||||
then case `wc -c < xxx$dll` in
|
||||
$z) ;;
|
||||
*) if test -s e
|
||||
then case `cat e` in
|
||||
*[Ee][Rr][Rr][Oo][Rr]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $shared in
|
||||
'') shared=$1 ;;
|
||||
*) shared="$shared $1" ;;
|
||||
# does -nostartfiles make sense?
|
||||
z=`wc -c < xxx$dll`
|
||||
eval set x $probe_shared_nostart
|
||||
while :
|
||||
do shift
|
||||
case $# in
|
||||
0) break ;;
|
||||
esac
|
||||
rm -f xxx$dll
|
||||
if $dld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll
|
||||
then case `wc -c < xxx$dll` in
|
||||
$z) ;;
|
||||
*) if test -s e
|
||||
then case `cat e` in
|
||||
*[Ee][Rr][Rr][Oo][Rr]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
break
|
||||
;;
|
||||
fi
|
||||
case $shared in
|
||||
'') shared=$1 ;;
|
||||
*) shared="$shared $1" ;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
break
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
done
|
||||
case $cc_dll in
|
||||
"") cc_dll=$cc_dll_def ;;
|
||||
esac
|
||||
@@ -1319,9 +1228,7 @@ case $stdlib in
|
||||
fi
|
||||
tstlib="$tstlib $implib"
|
||||
if $cc -Dtype=void -Dcall=exit -c tstlib.$src && mv tstlib.$obj tst.$obj
|
||||
then case $plusplus in
|
||||
'') probe_lxx= ;;
|
||||
esac
|
||||
then probe_lxx=
|
||||
l=
|
||||
for sym in $probe_l $probe_lxx
|
||||
do case $l in
|
||||
@@ -1445,7 +1352,7 @@ case $stdlib in
|
||||
ok=0
|
||||
for x in $xs
|
||||
do case $x in
|
||||
*_p) continue ;; # linux gcc known to hang for -lc_p
|
||||
*_p) continue ;; # Linux gcc known to hang for -lc_p
|
||||
esac
|
||||
if $cc -o doti.$exe doti.$obj -l$x 2>e
|
||||
then ok=1
|
||||
@@ -1666,9 +1573,6 @@ done
|
||||
case $stdc in
|
||||
?*) dialect="$dialect ANSI" ;;
|
||||
esac
|
||||
case $plusplus in
|
||||
?*) dialect="$dialect C++" ;;
|
||||
esac
|
||||
case $hosted in
|
||||
"") dialect="$dialect CROSS" ;;
|
||||
esac
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1990-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
@@ -17,7 +18,7 @@
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#pragma clang diagnostic ignored "-Wdeprecated-register"
|
||||
#pragma clang diagnostic ignored "-Wparentheses"
|
||||
|
||||
/*
|
||||
@@ -27,7 +28,7 @@
|
||||
*/
|
||||
|
||||
#define RELEASE_DATE "2021-01-21"
|
||||
static char id[] = "\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\0\n";
|
||||
static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n";
|
||||
|
||||
#if _PACKAGE_ast
|
||||
|
||||
@@ -35,8 +36,11 @@ static char id[] = "\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\0
|
||||
#include <error.h>
|
||||
|
||||
static const char usage[] =
|
||||
"[-?\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\n]"
|
||||
USAGE_LICENSE
|
||||
"[-?\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\n]"
|
||||
"[-author?Glenn Fowler <gsf@research.att.com>]"
|
||||
"[-copyright?(c) 1994-2012 AT&T Intellectual Property]"
|
||||
"[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh]"
|
||||
"[-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"
|
||||
" prerequisite file descriptions from a mamfile (see \b-f\b) and executes"
|
||||
@@ -106,7 +110,7 @@ USAGE_LICENSE
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
|
||||
#if !_PACKAGE_ast && defined(__STDC__)
|
||||
#if !_PACKAGE_ast
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
@@ -383,7 +387,7 @@ buffer(void)
|
||||
if (buf = state.old)
|
||||
state.old = state.old->old;
|
||||
else if (!(buf = newof(0, Buf_t, 1, 0)) || !(buf->buf = newof(0, char, CHUNK, 0)))
|
||||
report(3, "out of space [buffer]", NiL, (unsigned long)0);
|
||||
report(3, "out of memory [buffer]", NiL, (unsigned long)0);
|
||||
buf->end = buf->buf + CHUNK;
|
||||
buf->nxt = buf->buf;
|
||||
return buf;
|
||||
@@ -415,7 +419,7 @@ appendn(Buf_t* buf, char* str, int n)
|
||||
i = buf->nxt - buf->buf;
|
||||
m = (((buf->end - buf->buf) + n + CHUNK + 1) / CHUNK) * CHUNK;
|
||||
if (!(buf->buf = newof(buf->buf, char, m, 0)))
|
||||
report(3, "out of space [buffer resize]", NiL, (unsigned long)0);
|
||||
report(3, "out of memory [buffer resize]", NiL, (unsigned long)0);
|
||||
buf->end = buf->buf + m;
|
||||
buf->nxt = buf->buf + i;
|
||||
}
|
||||
@@ -450,7 +454,7 @@ duplicate(char* s)
|
||||
|
||||
n = strlen(s);
|
||||
if (!(t = newof(0, char, n, 1)))
|
||||
report(3, "out of space [duplicate]", s, (unsigned long)0);
|
||||
report(3, "out of memory [duplicate]", s, (unsigned long)0);
|
||||
strcpy(t, s);
|
||||
return t;
|
||||
}
|
||||
@@ -465,7 +469,7 @@ dictionary(void)
|
||||
Dict_t* dict;
|
||||
|
||||
if (!(dict = newof(0, Dict_t, 1, 0)))
|
||||
report(3, "out of space [dictionary]", NiL, (unsigned long)0);
|
||||
report(3, "out of memory [dictionary]", NiL, (unsigned long)0);
|
||||
return dict;
|
||||
}
|
||||
|
||||
@@ -539,7 +543,7 @@ search(register Dict_t* dict, char* name, void* value)
|
||||
else if (value)
|
||||
{
|
||||
if (!(root = newof(0, Dict_item_t, 1, strlen(name))))
|
||||
report(3, "out of space [dictionary]", name, (unsigned long)0);
|
||||
report(3, "out of memory [dictionary]", name, (unsigned long)0);
|
||||
strcpy(root->name, name);
|
||||
}
|
||||
if (root)
|
||||
@@ -606,7 +610,7 @@ rule(char* name)
|
||||
if (!(r = (Rule_t*)search(state.rules, name, NiL)))
|
||||
{
|
||||
if (!(r = newof(0, Rule_t, 1, 0)))
|
||||
report(3, "out of space [rule]", name, (unsigned long)0);
|
||||
report(3, "out of memory [rule]", name, (unsigned long)0);
|
||||
r->name = (char*)search(state.rules, name, (void*)r);
|
||||
}
|
||||
return r;
|
||||
@@ -625,7 +629,7 @@ cons(Rule_t* r, Rule_t* p)
|
||||
if (!x)
|
||||
{
|
||||
if (!(x = newof(0, List_t, 1, 0)))
|
||||
report(3, "out of space [list]", r->name, (unsigned long)0);
|
||||
report(3, "out of memory [list]", r->name, (unsigned long)0);
|
||||
x->rule = p;
|
||||
x->next = r->prereqs;
|
||||
r->prereqs = x;
|
||||
@@ -709,7 +713,7 @@ view(void)
|
||||
}
|
||||
n = strlen(s);
|
||||
if (!(vp = newof(0, View_t, 1, strlen(p) + n + 1)))
|
||||
report(3, "out of space [view]", s, (unsigned long)0);
|
||||
report(3, "out of memory [view]", s, (unsigned long)0);
|
||||
vp->node = n + 1;
|
||||
strcpy(vp->dir, s);
|
||||
*(vp->dir + n) = '/';
|
||||
@@ -861,7 +865,7 @@ substitute(Buf_t* buf, register char* s)
|
||||
}
|
||||
if (c != '-')
|
||||
break;
|
||||
/*FALLTHROUGH*/
|
||||
/* FALLTHROUGH */
|
||||
case 0:
|
||||
case '=':
|
||||
case '}':
|
||||
@@ -1076,13 +1080,23 @@ push(char* file, Stdio_t* fp, int flags)
|
||||
else if (++state.sp >= &state.streams[elementsof(state.streams)])
|
||||
report(3, "input stream stack overflow", NiL, (unsigned long)0);
|
||||
if (state.sp->fp = fp)
|
||||
state.sp->file = "pipeline";
|
||||
{
|
||||
if(state.sp->file)
|
||||
free(state.sp->file);
|
||||
state.sp->file = strdup("pipeline");
|
||||
if(!state.sp->file)
|
||||
report(3, "out of memory [push]", NiL, (unsigned long)0);
|
||||
}
|
||||
else if (flags & STREAM_PIPE)
|
||||
report(3, "pipe error", file, (unsigned long)0);
|
||||
else if (!file || !strcmp(file, "-") || !strcmp(file, "/dev/stdin"))
|
||||
{
|
||||
flags |= STREAM_KEEP;
|
||||
state.sp->file = "/dev/stdin";
|
||||
if(state.sp->file)
|
||||
free(state.sp->file);
|
||||
state.sp->file = strdup("/dev/stdin");
|
||||
if(!state.sp->file)
|
||||
report(3, "out of memory [push]", NiL, (unsigned long)0);
|
||||
state.sp->fp = stdin;
|
||||
}
|
||||
else
|
||||
@@ -1092,6 +1106,8 @@ push(char* file, Stdio_t* fp, int flags)
|
||||
{
|
||||
if (!(state.sp->fp = fopen(path, "r")))
|
||||
report(3, "cannot read", path, (unsigned long)0);
|
||||
if(state.sp->file)
|
||||
free(state.sp->file);
|
||||
state.sp->file = duplicate(path);
|
||||
drop(buf);
|
||||
}
|
||||
@@ -1136,7 +1152,7 @@ input(void)
|
||||
/*
|
||||
* pass shell action s to ${SHELL:-/bin/sh}
|
||||
* the -c wrapper ensures that scripts are run in the selected shell
|
||||
* even on systems that otherwise demand #! magic (can you say cygwin)
|
||||
* even on systems that otherwise demand #! magic (can you say Cygwin)
|
||||
*/
|
||||
|
||||
static int
|
||||
@@ -1443,6 +1459,7 @@ require(char* lib, int dontcare)
|
||||
Buf_t* tmp;
|
||||
struct stat st;
|
||||
|
||||
int tofree = 0;
|
||||
static int dynamic = -1;
|
||||
|
||||
if (dynamic < 0)
|
||||
@@ -1487,7 +1504,10 @@ require(char* lib, int dontcare)
|
||||
}
|
||||
}
|
||||
if (r != lib)
|
||||
{
|
||||
tofree = 1;
|
||||
r = duplicate(r);
|
||||
}
|
||||
search(state.vars, lib, r);
|
||||
append(tmp, lib + 2);
|
||||
append(tmp, ".req");
|
||||
@@ -1516,6 +1536,8 @@ require(char* lib, int dontcare)
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
if(tofree)
|
||||
free(r);
|
||||
r = use(buf);
|
||||
}
|
||||
else if (dontcare)
|
||||
@@ -1530,7 +1552,11 @@ require(char* lib, int dontcare)
|
||||
append(tmp, "rm -f x.${!-$$}.[cox]\n");
|
||||
append(tmp, "exit $c\n");
|
||||
if (execute(expand(buf, use(tmp))))
|
||||
{
|
||||
if(tofree)
|
||||
free(r);
|
||||
r = "";
|
||||
}
|
||||
}
|
||||
r = duplicate(r);
|
||||
search(state.vars, lib, r);
|
||||
@@ -2115,7 +2141,7 @@ main(int argc, char** argv)
|
||||
continue;
|
||||
case 'N':
|
||||
state.never = 1;
|
||||
/*FALLTHROUGH*/
|
||||
/* FALLTHROUGH */
|
||||
case 'n':
|
||||
append(state.opt, " -n");
|
||||
state.exec = 0;
|
||||
@@ -2154,8 +2180,8 @@ main(int argc, char** argv)
|
||||
search(state.vars, "-strip-symbols", "1");
|
||||
continue;
|
||||
case '?':
|
||||
error(ERROR_USAGE|4, "%s", opt_info.arg);
|
||||
continue;
|
||||
error(ERROR_usage(2), "%s", opt_info.arg);
|
||||
UNREACHABLE();
|
||||
case ':':
|
||||
error(2, "%s", opt_info.arg);
|
||||
continue;
|
||||
@@ -2163,7 +2189,10 @@ main(int argc, char** argv)
|
||||
break;
|
||||
}
|
||||
if (error_info.errors)
|
||||
error(ERROR_USAGE|4, "%s", optusage(NiL));
|
||||
{
|
||||
error(ERROR_usage(2), "%s", optusage(NiL));
|
||||
UNREACHABLE();
|
||||
}
|
||||
argv += opt_info.index;
|
||||
#else
|
||||
while ((s = *++argv) && *s == '-')
|
||||
@@ -2220,7 +2249,7 @@ main(int argc, char** argv)
|
||||
continue;
|
||||
case 'N':
|
||||
state.never = 1;
|
||||
/*FALLTHROUGH*/
|
||||
/* FALLTHROUGH */
|
||||
case 'n':
|
||||
append(state.opt, " -n");
|
||||
state.exec = 0;
|
||||
@@ -2275,6 +2304,7 @@ main(int argc, char** argv)
|
||||
break;
|
||||
default:
|
||||
report(2, "unknown option", s, (unsigned long)0);
|
||||
/* FALLTHROUGH */
|
||||
case '?':
|
||||
usage();
|
||||
break;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -34,7 +35,9 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
|
||||
[-?
|
||||
@(#)$Id: mktest (AT&T Labs Research) 2010-08-11 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
||||
[-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property]
|
||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
||||
[+NAME?mktest - generate a regression test scripts]
|
||||
[+DESCRIPTION?\bmktest\b generates regression test scripts from test
|
||||
template commands in the \aunit\a.\brt\b file. The generated test
|
||||
@@ -81,7 +84,7 @@ unit.rt [ unit [ arg ... ] ]
|
||||
[+PROG \acommand\a [ \aarg\a ... ]]?Run \acommand\a with
|
||||
optional arguments.]
|
||||
[+TEST [ \anumber\a ]] [ \adescription\a ... ]]?Define a new
|
||||
test group with optional \anumber\a and \adescripion\a.]
|
||||
test group with optional \anumber\a and \adescription\a.]
|
||||
[+TWD [ \adir\a ... ]]?Set the temporary test dir to \adir\a.
|
||||
The default is \aunit\a\b.tmp\b, where \aunit\a is the test
|
||||
input file sans directory and suffix. If \adir\a matches \b/*\b
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
||||
:
|
||||
# @(#)probe.win32 (AT&T Research) 2010-01-01
|
||||
#
|
||||
# win32 specific make C probe initialization
|
||||
# wrapped cc's are easy on uwin
|
||||
# Win32 specific make C probe initialization
|
||||
# wrapped cc's are easy on UWIN
|
||||
#
|
||||
# 2> easy.err to avoid mysterious hang with bcc
|
||||
|
||||
@@ -37,9 +37,6 @@ done
|
||||
for i in $probe_header
|
||||
do echo "#include <$i>"
|
||||
done
|
||||
echo '#ifdef __cplusplus'
|
||||
echo "int _Pr0b3_cplus=__cplusplus;"
|
||||
echo '#endif'
|
||||
echo '#ifdef _UWIN'
|
||||
echo "int _Pr0b3_uwin=_UWIN;"
|
||||
echo '#endif'
|
||||
@@ -71,7 +68,6 @@ echo '#endif'
|
||||
|
||||
include=
|
||||
uwin=
|
||||
cplus=
|
||||
|
||||
$cc -E easy.c 2>&1 |
|
||||
egrep -i '^(#(line)? 1 .*\.[hH]| *int +_Pr0b3_[a-zA-Z_]* *= *[0-9])' |
|
||||
@@ -133,11 +129,6 @@ then : the payoff
|
||||
set -- $(whence $cmd) "$@"
|
||||
typ=$(package)
|
||||
dialect="ANSI CLOSURE DYNAMIC EXPORT=DLL LIBPP -I-"
|
||||
case ${cc##*/} in
|
||||
*CC*) dialect="$dialect C++"
|
||||
cplus=1
|
||||
;;
|
||||
esac
|
||||
ld=${cc%cc}ld
|
||||
if [[ ! -x $ld ]]
|
||||
then ld=${cc%/*}/ld
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
35
cde/programs/dtksh/ksh93/src/cmd/INIT/proto.sh
Normal file
35
cde/programs/dtksh/ksh93/src/cmd/INIT/proto.sh
Normal file
@@ -0,0 +1,35 @@
|
||||
########################################################################
|
||||
# #
|
||||
# This file is part of the ksh 93u+m package #
|
||||
# Copyright (c) 2021 Contributors to ksh 93u+m #
|
||||
# <https://github.com/ksh93/ksh> #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# #
|
||||
# A copy of the License is available at #
|
||||
# http://www.eclipse.org/org/documents/epl-v10.html #
|
||||
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
|
||||
# #
|
||||
# Martijn Dekker <martijn@inlv.org> #
|
||||
# #
|
||||
########################################################################
|
||||
|
||||
# proto(1) has been removed. This is a backwards compatibility stub that allows
|
||||
# compiling older AST code (with Mamfiles containing proto commands) using the
|
||||
# current INIT system. This stub ignores all options, then invokes 'cat'.
|
||||
|
||||
while getopts ':dfhinprstvzPSC:e:l:o:L:' opt
|
||||
do case $opt in
|
||||
\?) case $OPTARG in
|
||||
+) ;;
|
||||
*) echo "proto: $OPTARG: unknown option"
|
||||
echo 'Usage: proto [-dfhinprstvzP+S] [-C directory] [-e package] [-l file]'
|
||||
echo ' [-o "name='\''value'\'' ..."] [-L file] file ...'
|
||||
exit 2
|
||||
;;
|
||||
esac >&2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $((OPTIND - 1))
|
||||
exec cat -- "$@"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2012 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -25,7 +26,9 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
|
||||
[-?
|
||||
@(#)$Id: regress (AT&T Research) 2012-02-02 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
||||
[-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property]
|
||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
||||
[+NAME?regress - run regression tests]
|
||||
[+DESCRIPTION?\bregress\b runs the tests in \aunit\a, or
|
||||
\aunit\a\b.tst\b if \aunit\a does not exist. If \acommand\a is omitted
|
||||
@@ -51,7 +54,7 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
|
||||
[r!:regular?Run each test with the standard input and standard output
|
||||
redirected through regular files.]
|
||||
[t:test?Run only tests matching \apattern\a. Tests are numbered and
|
||||
consist of at least two digits (0 filled if necessary.) Tests matching
|
||||
consist of at least two digits (0 filled if necessary). Tests matching
|
||||
\b+(0)\b are always run.]:[pattern]
|
||||
[x:trace?Enable debug tracing.]
|
||||
[v:verbose?List differences between actual (<) and expected (>) output,
|
||||
@@ -171,7 +174,7 @@ unit [ command [ arg ... ] ]
|
||||
the next explicit \bSET\b.]
|
||||
[+TALLY?Called by \bregress\b display the \bTEST\b results.]
|
||||
[+TEST \b\anumber\a [ \adescription\a ... ]]?Define a new test
|
||||
group labelled \anumber\a with optional \adescripion\a.]
|
||||
group labelled \anumber\a with optional \adescription\a.]
|
||||
[+TITLE \b[+]] \atext\a?Set the \bTEST\b output title to
|
||||
\atext\a. If \b+\b is specified then \atext\a is appended to
|
||||
the default title. The default title is the test file base
|
||||
|
||||
@@ -1,367 +0,0 @@
|
||||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1990-2011 AT&T Intellectual Property *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
* *
|
||||
* A copy of the License is available at *
|
||||
* http://www.eclipse.org/org/documents/epl-v10.html *
|
||||
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
|
||||
* *
|
||||
* Information and Software Systems Research *
|
||||
* AT&T Research *
|
||||
* Florham Park NJ *
|
||||
* *
|
||||
* Glenn Fowler <gsf@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
#pragma clang diagnostic ignored "-Wparentheses"
|
||||
|
||||
/*
|
||||
* release -- list recent release changes
|
||||
*
|
||||
* coded for portability
|
||||
*/
|
||||
|
||||
static char id[] = "\n@(#)$Id: release (AT&T Research) 2000-01-28 $\0\n";
|
||||
|
||||
#if _PACKAGE_ast
|
||||
|
||||
#include <ast.h>
|
||||
#include <error.h>
|
||||
|
||||
static const char usage[] =
|
||||
"[-?\n@(#)$Id: release (AT&T Research) 2000-01-28 $\n]"
|
||||
USAGE_LICENSE
|
||||
"[+NAME?release - list recent changes]"
|
||||
"[+DESCRIPTION?\brelease\b lists the changes within the date range specified"
|
||||
" by the \b--from\b and \b--to\b options. The input files are assumed to"
|
||||
" contain date tag lines of the form [\acc\a]]\ayy-mm-dd\a [ \atext\a ]]"
|
||||
" (or \bdate\b(1) default format), where \acc\a is determined by a Y2K"
|
||||
" window year of 69 (we can produce an example coding dated 1991 - this"
|
||||
" can be patented?, how about 1+1=2?.) The date tag lines are followed by"
|
||||
" \areadme\a text in reverse chronological order (newer entries at the"
|
||||
" top of the file.) If no selection options are specified then all"
|
||||
" changes are listed. If no \afile\a operands are specified then the"
|
||||
" standard input is read.]"
|
||||
"[+?The entries for each \afile\a are annotated with the file directory name.]"
|
||||
"[f:from?Entries older than \adate\a are omitted.]:[date]"
|
||||
"[r:release?List all changes that include the first \acount\a release marks."
|
||||
" A release mark has a date tag followed by optional space and at least"
|
||||
" three \b-\b characters. Changes from release mark \acount\a+1 are not"
|
||||
" listed. If there are no release marks then the date range is used;"
|
||||
" if there is at least one release mark then the date range is ignored"
|
||||
" and at most \acount\a release marks will be listed.]#[count]"
|
||||
"[t:to?Entries newer than \adate\a are omitted.]:[date]"
|
||||
"[V?Print the program version and exit.]"
|
||||
|
||||
"\n"
|
||||
"\n[ file ... ]\n"
|
||||
"\n"
|
||||
|
||||
"[+SEE ALSO?\bpackage\b(1)]"
|
||||
;
|
||||
|
||||
#else
|
||||
|
||||
#define elementsof(x) ((int)(sizeof(x)/sizeof(x[0])))
|
||||
|
||||
#define NiL ((char*)0)
|
||||
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if !_PACKAGE_ast && defined(__STDC__)
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
static char mon[] = "janfebmaraprmayjunjulaugsepoctnovdec";
|
||||
static char day[] = "sunmontuewedthufrisat";
|
||||
|
||||
#if !_PACKAGE_ast
|
||||
|
||||
static void
|
||||
usage()
|
||||
{
|
||||
fprintf(stderr, "Usage: release [-V] [-h hi-date] [-l lo-date] [-r count] [ file ...]\n");
|
||||
exit(2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static unsigned long
|
||||
number(register char* s, char** e)
|
||||
{
|
||||
unsigned long q = 0;
|
||||
|
||||
while (isspace(*s))
|
||||
s++;
|
||||
while (isdigit(*s))
|
||||
q = q * 10 + *s++ - '0';
|
||||
if (e)
|
||||
*e = s;
|
||||
return q;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
string(register char* s, char* tab, int num, int siz, char** e)
|
||||
{
|
||||
register int i;
|
||||
register int j;
|
||||
char buf[16];
|
||||
|
||||
while (isspace(*s))
|
||||
s++;
|
||||
for (i = 0; i < siz; i++)
|
||||
buf[i] = isupper(s[i]) ? tolower(s[i]) : s[i];
|
||||
for (i = 0; i < num; i += siz)
|
||||
for (j = 0; j < siz && buf[j] == tab[j+i]; j++)
|
||||
if (j == (siz - 1))
|
||||
{
|
||||
*e = s + siz;
|
||||
return i / siz + 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long
|
||||
date(char* s, char** e)
|
||||
{
|
||||
char* t;
|
||||
unsigned long y;
|
||||
unsigned long m;
|
||||
unsigned long d;
|
||||
|
||||
if (isdigit(*s))
|
||||
{
|
||||
y = number(s, &t);
|
||||
if (*t != '-')
|
||||
return 0;
|
||||
switch (t - s)
|
||||
{
|
||||
case 2:
|
||||
y += 1900;
|
||||
if (y <= 1969)
|
||||
y += 100;
|
||||
break;
|
||||
case 4:
|
||||
if (y < 1969)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
if (!(m = number(++t, &s)))
|
||||
return 0;
|
||||
if ((s - t) != 2 || *s != '-' || m < 1 || m > 12)
|
||||
return 0;
|
||||
if (!(d = number(++s, &t)))
|
||||
return 0;
|
||||
if ((t - s) != 2 || d < 1 || d > 31)
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (string(s, day, elementsof(day), 3, &t))
|
||||
s = t;
|
||||
if (!(m = string(s, mon, elementsof(mon), 3, &t)))
|
||||
return 0;
|
||||
if (!(d = number(t, &s)))
|
||||
return 0;
|
||||
for (y = 1969; *s; s++)
|
||||
if ((y = number(s, &t)) && (t - s) == 4)
|
||||
{
|
||||
if (y < 1969)
|
||||
return 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (e)
|
||||
{
|
||||
while (isspace(*t))
|
||||
t++;
|
||||
*e = t;
|
||||
}
|
||||
return ((y - 1969) * 13 + m) * 32 + d;
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
register char* s;
|
||||
register char* u;
|
||||
register char* v;
|
||||
char* p;
|
||||
char* e;
|
||||
int i;
|
||||
unsigned long t;
|
||||
unsigned long lo;
|
||||
unsigned long hi;
|
||||
int mk;
|
||||
FILE* f;
|
||||
char buf[1024];
|
||||
|
||||
mk = 0;
|
||||
lo = hi = 0;
|
||||
#if _PACKAGE_ast
|
||||
error_info.id = "release";
|
||||
for (;;)
|
||||
{
|
||||
switch (optget(argv, usage))
|
||||
{
|
||||
case 'f':
|
||||
if (!(lo = date(opt_info.arg, &e)) || *e)
|
||||
{
|
||||
error(2, "%s: invalid from date [%s]", opt_info.arg, e);
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
case 'r':
|
||||
mk = opt_info.num + 1;
|
||||
continue;
|
||||
case 't':
|
||||
if (!(hi = date(opt_info.arg, &e)) || *e)
|
||||
{
|
||||
error(2, "%s: invalid to date [%s]", opt_info.arg, e);
|
||||
return 1;
|
||||
}
|
||||
continue;
|
||||
case 'V':
|
||||
sfprintf(sfstdout, "%s\n", id + 10);
|
||||
return 0;
|
||||
case '?':
|
||||
error(ERROR_USAGE|4, "%s", opt_info.arg);
|
||||
continue;
|
||||
case ':':
|
||||
error(2, "%s", opt_info.arg);
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (error_info.errors)
|
||||
error(ERROR_USAGE|4, "%s", optusage(NiL));
|
||||
argv += opt_info.index;
|
||||
#else
|
||||
while ((s = *++argv) && *s == '-' && *(s + 1))
|
||||
{
|
||||
if (*(s + 1) == '-')
|
||||
{
|
||||
if (!*(s + 2))
|
||||
{
|
||||
argv++;
|
||||
break;
|
||||
}
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
for (;;)
|
||||
{
|
||||
switch (i = *++s)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 'f':
|
||||
case 't':
|
||||
if (!*(v = ++s) && !(v = *++argv))
|
||||
{
|
||||
s = "??";
|
||||
continue;
|
||||
}
|
||||
if (!(t = date(v, &e)) || *e)
|
||||
{
|
||||
fprintf(stderr, "release: -%c%s: invalid date [%s]\n", i, s, e);
|
||||
return 1;
|
||||
}
|
||||
switch (i)
|
||||
{
|
||||
case 'f':
|
||||
lo = t;
|
||||
break;
|
||||
case 't':
|
||||
hi = t;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if (!*(v = ++s) && !(v = *++argv))
|
||||
{
|
||||
s = "??";
|
||||
continue;
|
||||
}
|
||||
mk = number(v, &e) + 1;
|
||||
if (*e)
|
||||
{
|
||||
fprintf(stderr, "release: -%c%s: invalid count\n", i, s);
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'V':
|
||||
fprintf(stdout, "%s\n", id + 10);
|
||||
return 0;
|
||||
default:
|
||||
fprintf(stderr, "release: -%c: unknown option\n", i);
|
||||
/*FALLTHROUGH*/
|
||||
case '?':
|
||||
usage();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
do
|
||||
{
|
||||
if (!(p = *argv++) || !*p || *p == '-' && !*(p + 1))
|
||||
{
|
||||
argv--;
|
||||
p = "";
|
||||
f = stdin;
|
||||
}
|
||||
else if (!(f = fopen(p, "r")))
|
||||
{
|
||||
fprintf(stderr, "release: %s: cannot read", p);
|
||||
return 1;
|
||||
}
|
||||
while (s = fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
if (t = date(s, &e))
|
||||
{
|
||||
if (mk && e[0] == '-' && e[1] == '-' && e[2] == '-' && !--mk)
|
||||
break;
|
||||
if (t < lo)
|
||||
break;
|
||||
if (hi && t > hi)
|
||||
continue;
|
||||
if (p)
|
||||
{
|
||||
if (*p)
|
||||
{
|
||||
for (u = v = p; *p; p++)
|
||||
if (*p == '/')
|
||||
{
|
||||
v = u;
|
||||
u = p + 1;
|
||||
}
|
||||
printf("\n:::::::: ");
|
||||
while ((i = *v++) && i != '/')
|
||||
fputc(i, stdout);
|
||||
printf(" ::::::::\n\n");
|
||||
}
|
||||
p = 0;
|
||||
}
|
||||
}
|
||||
if (!p)
|
||||
fputs(s, stdout);
|
||||
}
|
||||
if (f == stdin)
|
||||
break;
|
||||
fclose(f);
|
||||
} while (*argv);
|
||||
return 0;
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -31,9 +32,11 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
[-?
|
||||
@(#)$Id: rt (AT&T Research) 2010-07-27 $
|
||||
]
|
||||
'$USAGE_LICENSE$'
|
||||
[-author?Glenn Fowler <gsf@research.att.com>]
|
||||
[-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property]
|
||||
[-license?http://www.eclipse.org/org/documents/epl-v10.html]
|
||||
[+NAME?rt - run "nmake test" and filter output]
|
||||
[+DESCRIPTION?\brt\b runs \vnmake test\v and filters the regression
|
||||
[+DESCRIPTION?\brt\b runs \bnmake test\b and filters the regression
|
||||
test output to contain only test summary lines. If no \atest\a
|
||||
operands are specified then \btest\b is assumed. If \b-\b is
|
||||
specified then the \afile\a operands, or the standard input
|
||||
@@ -42,7 +45,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
|
||||
[f:failed?Only list failed test results.]
|
||||
[h!:heading?Enable per-file heading when more than one \afile\a operand
|
||||
follows \b-\b.]
|
||||
[v:verbose?Run with \vREGRESSFLAGS=-v\v.]
|
||||
[v:verbose?Run with \bREGRESSFLAGS=-v\b.]
|
||||
|
||||
[ test ... | - [ file ... ] ]
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# #
|
||||
# This software is part of the ast package #
|
||||
# Copyright (c) 1994-2011 AT&T Intellectual Property #
|
||||
# Copyright (c) 2020-2021 Contributors to ksh 93u+m #
|
||||
# and is licensed under the #
|
||||
# Eclipse Public License, Version 1.0 #
|
||||
# by AT&T Intellectual Property #
|
||||
@@ -18,20 +19,14 @@
|
||||
# #
|
||||
########################################################################
|
||||
# non-ksh stub for the nmake silent prefix
|
||||
# @(#)silent (AT&T Research) 1992-08-11
|
||||
|
||||
(command set -o posix) 2>/dev/null && set -o posix
|
||||
modern_export=`v=; export v=ok 2>/dev/null; echo "$v"`
|
||||
# @(#)silent (ksh 93u+m) 2021-12-31
|
||||
|
||||
while :
|
||||
do case $# in
|
||||
0) exit 0 ;;
|
||||
esac
|
||||
case $1 in
|
||||
*=*) case $modern_export in
|
||||
ok) export "$1" ;;
|
||||
*) `echo $1 | sed "s/\\([^=]*\\)=\\(.*\\)/eval \\1='\\2'; export \\1/"` ;;
|
||||
esac
|
||||
*=*) export "$1"
|
||||
shift
|
||||
;;
|
||||
*) break
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1994-2011 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
|
||||
@@ -10,50 +10,17 @@ note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~g
|
||||
note *
|
||||
setv INSTALLROOT ../../..
|
||||
setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast
|
||||
setv PACKAGE_ast_LIB ${INSTALLROOT}/lib
|
||||
setv PACKAGE_cmd ${INSTALLROOT}
|
||||
setv PACKAGE_cmd_INCLUDE ${PACKAGE_cmd}/include
|
||||
setv PACKAGE_cmd_LIB ${PACKAGE_cmd}/lib
|
||||
setv PACKAGEROOT ../../../../..
|
||||
setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS}
|
||||
setv ARFLAGS rc
|
||||
setv AS as
|
||||
setv ASFLAGS
|
||||
setv CC cc
|
||||
setv mam_cc_FLAGS
|
||||
setv KSH_RELFLAGS
|
||||
setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?}
|
||||
setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??}
|
||||
setv COTEMP $$
|
||||
setv CPIO cpio
|
||||
setv CPIOFLAGS
|
||||
setv CPP "${CC} -E"
|
||||
setv F77 f77
|
||||
setv HOSTCC ${CC}
|
||||
setv IFFEFLAGS
|
||||
setv IGNORE
|
||||
setv LD ld
|
||||
setv LDFLAGS
|
||||
setv LEX lex
|
||||
setv LEXFLAGS
|
||||
setv LPR lpr
|
||||
setv LPRFLAGS
|
||||
setv M4FLAGS
|
||||
setv NMAKE nmake
|
||||
setv NMAKEFLAGS
|
||||
setv PR pr
|
||||
setv PRFLAGS
|
||||
setv SHELL /bin/sh
|
||||
setv SILENT
|
||||
setv TAR tar
|
||||
setv YACC yacc
|
||||
setv YACCFLAGS -d
|
||||
make ${PACKAGEROOT}/lib/package/ast.lic
|
||||
done ${PACKAGEROOT}/lib/package/ast.lic
|
||||
make .INIT
|
||||
make ${PACKAGE_ast_INCLUDE}/cmdlist.h
|
||||
make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare
|
||||
done ${PACKAGE_ast_INCLUDE}/cmdlist.h
|
||||
exec - sed -e '/^CMDLIST(.*)$/!d' -e 's/CMDLIST(\(.*\))/\1/' -e '/^getconf$/d' -e '/^ln$/d' -e '/^mv$/d' -e '/^md5sum$/d' -e '/^sum$/d' ${PACKAGE_ast_INCLUDE}/cmdlist.h
|
||||
bind -lcmd
|
||||
@@ -66,7 +33,7 @@ make install
|
||||
meta FEATURE/pty features/%>FEATURE/% features/pty pty
|
||||
make features/pty
|
||||
done features/pty
|
||||
exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -lm' ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
|
||||
exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty
|
||||
done FEATURE/pty generated
|
||||
make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/ast_time.h
|
||||
@@ -74,19 +41,15 @@ make install
|
||||
prev ${PACKAGE_ast_INCLUDE}/regex.h implicit
|
||||
make ${PACKAGE_ast_INCLUDE}/proc.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/ast.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit
|
||||
done ${PACKAGE_ast_INCLUDE}/proc.h
|
||||
prev ${PACKAGE_ast_INCLUDE}/error.h implicit
|
||||
prev ${PACKAGE_ast_INCLUDE}/cmd.h implicit
|
||||
done pty.c
|
||||
meta pty.o %.c>%.o pty.c pty
|
||||
prev pty.c
|
||||
setv CMD_STANDALONE -DCMD_STANDALONE="b_pty"
|
||||
setv LICENSE -DLICENSE="since=2001,author=gsf+dgk"
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -DUSAGE_LICENSE=\""[-author?Glenn Fowler <gsf@research.att.com>][-author?David Korn <dgk@research.att.com>][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?builtin]"\" -c pty.c
|
||||
exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -c pty.c
|
||||
done pty.o generated
|
||||
bind -lutil dontcare
|
||||
setv CMD_STANDALONE -DCMD_STANDALONE="b_pty"
|
||||
exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd}
|
||||
done pty generated
|
||||
make ${INSTALLROOT}/bin
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
10-04-01 pty: add --tty='stty-settings'
|
||||
10-03-19 pty: add --dialogue
|
||||
10-03-15 pty: fix select() fd management
|
||||
09-03-31 features/pty,Makefile: add pty.h and -lutil refs for linux -- great, another util library
|
||||
09-03-31 features/pty,Makefile: add pty.h and -lutil refs for Linux -- great, another util library
|
||||
09-01-30 pty.c: add <ast_time.h> (for fd_set!! on mvs.390)
|
||||
06-07-20 pty.c: add
|
||||
|
||||
7
cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty
Executable file → Normal file
7
cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty
Executable file → Normal file
@@ -1,5 +1,3 @@
|
||||
set prototyped
|
||||
|
||||
header sys/types.h
|
||||
header pty.h
|
||||
header libutil.h
|
||||
@@ -13,7 +11,7 @@ lib openpty,_getpty,ptsname -lutil
|
||||
lib grantpt,unlockpt,posix_openpt stdlib.h
|
||||
lib cfmakeraw termios.h
|
||||
|
||||
tst - output{
|
||||
tst - -lm output{
|
||||
#include <fcntl.h>
|
||||
#if _lib_ptsname
|
||||
#include <stdlib.h>
|
||||
@@ -52,7 +50,8 @@ tst - output{
|
||||
return 0;
|
||||
}
|
||||
}end fail{
|
||||
echo '#error The output block in src/cmd/builtin/features/pty failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.'
|
||||
echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2
|
||||
exit 1
|
||||
}end
|
||||
|
||||
extern _getpty char* (int*, int, mode_t, int)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/***********************************************************************
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1992-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 1992-2013 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
@@ -18,11 +19,14 @@
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
|
||||
static const char usage[] =
|
||||
"[-?\n@(#)pty (AT&T Research) 2012-06-11\n]"
|
||||
USAGE_LICENSE
|
||||
"[-?\n@(#)pty (AT&T Research) 2013-05-22\n]"
|
||||
"[-author?Glenn Fowler <gsf@research.att.com>]"
|
||||
"[-author?David Korn <dgk@research.att.com>]"
|
||||
"[-copyright?Copyright (c) 2001-2013 AT&T Intellectual Property]"
|
||||
"[-license?http://www.eclipse.org/org/documents/epl-v10.html]"
|
||||
"[--catalog?builtin]"
|
||||
"[+NAME?pty - create pseudo terminal and run command]"
|
||||
"[+DESCRIPTION?\bpty\b creates a pseudo pty and then runs \bcommand\b "
|
||||
"with arguments given by \aarg\a and the standard input, standard "
|
||||
@@ -121,6 +125,12 @@ USAGE_LICENSE
|
||||
#define CMIN 1
|
||||
#endif
|
||||
|
||||
static noreturn void outofmemory(void)
|
||||
{
|
||||
error(ERROR_SYSTEM|ERROR_PANIC, "out of memory");
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
#if !_lib_openpty && !_lib__getpty && !defined(_pty_clone)
|
||||
# if !_lib_grantpt || !_lib_unlock
|
||||
# if !_lib_ptsname
|
||||
@@ -212,7 +222,6 @@ static int
|
||||
mkpty(int* master, int* minion)
|
||||
{
|
||||
struct termios tty;
|
||||
struct termios tst;
|
||||
struct termios* ttyp;
|
||||
#ifdef TIOCGWINSZ
|
||||
struct winsize win;
|
||||
@@ -247,7 +256,12 @@ mkpty(int* master, int* minion)
|
||||
tty.c_lflag |= ECHOKE;
|
||||
#endif
|
||||
tty.c_oflag |= (ONLCR | OPOST);
|
||||
tty.c_oflag &= ~(OCRNL | ONLRET);
|
||||
#ifdef OCRNL
|
||||
tty.c_oflag &= ~OCRNL;
|
||||
#endif
|
||||
#ifdef ONLRET
|
||||
tty.c_oflag &= ~ONLRET;
|
||||
#endif
|
||||
tty.c_iflag |= BRKINT;
|
||||
tty.c_iflag &= ~IGNBRK;
|
||||
tty.c_cc[VTIME] = 0;
|
||||
@@ -307,6 +321,7 @@ mkpty(int* master, int* minion)
|
||||
return -1;
|
||||
#endif
|
||||
#ifdef I_PUSH
|
||||
struct termios tst;
|
||||
if (tcgetattr(*minion, &tst) < 0 && (ioctl(*minion, I_PUSH, "ptem") < 0 || ioctl(*minion, I_PUSH, "ldterm") < 0))
|
||||
{
|
||||
close(*minion);
|
||||
@@ -641,10 +656,7 @@ masterline(Sfio_t* mp, Sfio_t* lp, char* prompt, int must, int timeout, Master_t
|
||||
a = roundof(bp->max - bp->buf + n, SF_BUFSIZE);
|
||||
r = bp->buf;
|
||||
if (!(bp->buf = vmnewof(bp->vm, bp->buf, char, a, 0)))
|
||||
{
|
||||
error(ERROR_SYSTEM|2, "out of space");
|
||||
return 0;
|
||||
}
|
||||
outofmemory();
|
||||
bp->max = bp->buf + a;
|
||||
if (bp->buf != r)
|
||||
{
|
||||
@@ -780,12 +792,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout)
|
||||
!(cond = vmnewof(vm, 0, Cond_t, 1, 0)) ||
|
||||
!(master = vmnewof(vm, 0, Master_t, 1, 0)) ||
|
||||
!(master->buf = vmnewof(vm, 0, char, 2 * SF_BUFSIZE, 0)))
|
||||
{
|
||||
error(ERROR_SYSTEM|2, "out of space");
|
||||
id = 0;
|
||||
line = 0;
|
||||
goto done;
|
||||
}
|
||||
outofmemory();
|
||||
master->vm = vm;
|
||||
master->cur = master->end = master->buf;
|
||||
master->max = master->buf + 2 * SF_BUFSIZE - 1;
|
||||
@@ -836,10 +843,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout)
|
||||
break;
|
||||
case 'i':
|
||||
if (!cond->next && !(cond->next = vmnewof(vm, 0, Cond_t, 1, 0)))
|
||||
{
|
||||
error(ERROR_SYSTEM|2, "out of space");
|
||||
goto done;
|
||||
}
|
||||
outofmemory();
|
||||
cond = cond->next;
|
||||
cond->flags = IF;
|
||||
if ((cond->prev->flags & SKIP) && !(cond->text = 0) || !(cond->text = masterline(mp, lp, 0, 0, timeout, master)))
|
||||
@@ -948,7 +952,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout)
|
||||
}
|
||||
if (*s && !(master->ignore = vmstrdup(vm, s)))
|
||||
{
|
||||
error(ERROR_SYSTEM|2, "out of space");
|
||||
error(ERROR_SYSTEM|2, "out of memory");
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
@@ -960,7 +964,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout)
|
||||
}
|
||||
if (*s && !(error_info.id = vmstrdup(vm, s)))
|
||||
{
|
||||
error(ERROR_SYSTEM|2, "out of space");
|
||||
error(ERROR_SYSTEM|2, "out of memory");
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
@@ -972,7 +976,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout)
|
||||
}
|
||||
if (*s && !(master->prompt = vmstrdup(vm, s)))
|
||||
{
|
||||
error(ERROR_SYSTEM|2, "out of space");
|
||||
error(ERROR_SYSTEM|2, "out of memory");
|
||||
goto done;
|
||||
}
|
||||
break;
|
||||
@@ -1039,6 +1043,7 @@ b_pty(int argc, char** argv, Shbltin_t* context)
|
||||
continue;
|
||||
case 'l':
|
||||
log = opt_info.arg;
|
||||
/* FALLTHROUGH */
|
||||
case 'm':
|
||||
messages = opt_info.arg;
|
||||
continue;
|
||||
@@ -1058,17 +1063,26 @@ b_pty(int argc, char** argv, Shbltin_t* context)
|
||||
break;
|
||||
case '?':
|
||||
error(ERROR_usage(2), "%s", opt_info.arg);
|
||||
break;
|
||||
UNREACHABLE();
|
||||
}
|
||||
break;
|
||||
}
|
||||
argv += opt_info.index;
|
||||
if (!argv[0])
|
||||
{
|
||||
error(ERROR_exit(1), "command must be specified");
|
||||
UNREACHABLE();
|
||||
}
|
||||
if (mkpty(&master, &minion) < 0)
|
||||
{
|
||||
error(ERROR_system(1), "unable to create pty");
|
||||
UNREACHABLE();
|
||||
}
|
||||
if (!(mp = sfnew(NiL, 0, SF_UNBOUND, master, SF_READ|SF_WRITE)))
|
||||
{
|
||||
error(ERROR_system(1), "cannot open master stream");
|
||||
UNREACHABLE();
|
||||
}
|
||||
if (stty)
|
||||
{
|
||||
n = 2;
|
||||
@@ -1076,7 +1090,7 @@ b_pty(int argc, char** argv, Shbltin_t* context)
|
||||
if (isspace(*s))
|
||||
n++;
|
||||
if (!(ap = newof(0, Argv_t, 1, (n + 2) * sizeof(char*) + (s - stty + 1))))
|
||||
error(ERROR_system(1), "out of space");
|
||||
outofmemory();
|
||||
ap->argc = n + 1;
|
||||
ap->argv = (char**)(ap + 1);
|
||||
ap->args = (char*)(ap->argv + n + 2);
|
||||
@@ -1096,9 +1110,15 @@ b_pty(int argc, char** argv, Shbltin_t* context)
|
||||
if (!log)
|
||||
lp = 0;
|
||||
else if (!(lp = sfopen(NiL, log, "w")))
|
||||
{
|
||||
error(ERROR_system(1), "%s: cannot write", log);
|
||||
UNREACHABLE();
|
||||
}
|
||||
if (!(proc = runcmd(argv, minion, session)))
|
||||
{
|
||||
error(ERROR_system(1), "unable run %s", argv[0]);
|
||||
UNREACHABLE();
|
||||
}
|
||||
close(minion);
|
||||
if (messages)
|
||||
{
|
||||
@@ -1110,7 +1130,10 @@ b_pty(int argc, char** argv, Shbltin_t* context)
|
||||
else if ((fd = open(messages, O_CREAT|O_WRONLY, MODE_666)) >= 0)
|
||||
drop = 0;
|
||||
else
|
||||
{
|
||||
error(ERROR_system(1), "%s: cannot redirect messages", messages);
|
||||
UNREACHABLE();
|
||||
}
|
||||
close(2);
|
||||
dup(fd);
|
||||
if (drop)
|
||||
@@ -1119,6 +1142,9 @@ b_pty(int argc, char** argv, Shbltin_t* context)
|
||||
minion = (*fun)(mp, lp, delay, timeout);
|
||||
master = procclose(proc);
|
||||
if (lp && sfclose(lp))
|
||||
{
|
||||
error(ERROR_system(1), "%s: write error", log);
|
||||
UNREACHABLE();
|
||||
}
|
||||
return minion ? minion : master;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ For more details, see the NEWS file and for complete details, see the git log.
|
||||
1. Bytecode compiled by shcomp 93u+m will not run on older ksh versions.
|
||||
(However, bytecode compiled by older shcomp will run on ksh 93u+m.)
|
||||
|
||||
2. File name generation (a.k.a. pathname expansion, a.k.a. globbing) now
|
||||
2. Pathname expansion (a.k.a. filename generation, a.k.a. globbing) now
|
||||
never matches the special navigational names '.' (current directory)
|
||||
and '..' (parent directory). This change makes a pattern like .*
|
||||
useful; it now matches all hidden 'dotfiles' in the current directory.
|
||||
@@ -22,7 +22,10 @@ For more details, see the NEWS file and for complete details, see the git log.
|
||||
3. The bash-style &>foo redirection operator (shorthand for >foo 2>&1) can
|
||||
now always be used if -o posix is off, and not only in profile scripts.
|
||||
|
||||
4. Most predefined aliases have been converted to regular built-in
|
||||
4. Redirections that store a file descriptor > 9 in a variable, such as
|
||||
{var}>file, now continue to work if brace expansion is turned off.
|
||||
|
||||
5. Most predefined aliases have been converted to regular built-in
|
||||
commands that work the same way. 'unalias' no longer removes these.
|
||||
To remove a built-in command, use 'builtin -d'. The 'history' and 'r'
|
||||
predefined aliases remain, but are now only set on interactive shells.
|
||||
@@ -32,64 +35,145 @@ For more details, see the NEWS file and for complete details, see the git log.
|
||||
message instead of terminating the shell.
|
||||
- 'suspend' now refuses to suspend a login shell, as there is probably
|
||||
no parent shell to return to and the login session would freeze.
|
||||
If you really want to suspend a login shell, use 'kill -s STOP $$'.
|
||||
- 'times' now gives high precision output in a POSIX compliant format.
|
||||
|
||||
5. 'command' no longer expands aliases in its first argument, as this is
|
||||
no longer required after change 3 above. In the unlikely event that you
|
||||
still need this behavior, you can set:
|
||||
6. 'command' and 'nohup' no longer expand aliases in their first argument,
|
||||
as this is no longer required after the foregoing change. In the
|
||||
unlikely event that you still need this behavior, you can set:
|
||||
alias command='command '
|
||||
alias nohup='nohup '
|
||||
|
||||
6. The undocumented 'login' and 'newgrp' builtin commands have been
|
||||
removed. These replaced your shell session with the external commands
|
||||
7. The 'login' and 'newgrp' special built-in commands have been removed,
|
||||
so it is no longer an error to define shell functions by these names.
|
||||
These built-ins replaced your shell session with the external commands
|
||||
by the same name, as in 'exec'. If an error occurred (e.g. due to a
|
||||
typo), you would end up immediately logged out. If you do want this
|
||||
typo), you would end up immediately logged out, except on a few
|
||||
commercial Unix systems whose 'login' and 'newgrp' cope with this
|
||||
by starting a new shell session upon error. If you do want the old
|
||||
behavior, you can restore it by setting:
|
||||
alias login='exec login'
|
||||
alias newgrp='exec newgrp'
|
||||
|
||||
7. 'case' no longer retries to match patterns as literal strings if they
|
||||
8. 'case' no longer retries to match patterns as literal strings if they
|
||||
fail to match as patterns. This undocumented behaviour broke validation
|
||||
use cases that are expected to work. For example:
|
||||
n='[0-9]'
|
||||
case $n in
|
||||
[0-9]) echo "$n is a number" ;;
|
||||
[0-9]) echo "$n is a digit" ;;
|
||||
esac
|
||||
would output "[0-9] is a number". In the unlikely event that a script
|
||||
would output "[0-9] is a digit". In the unlikely event that a script
|
||||
does rely on this behavior, it can be fixed like this:
|
||||
case $n in
|
||||
[0-9] | "[0-9]")
|
||||
echo "$n is a number or the number pattern" ;;
|
||||
echo "$n is a digit or the digit pattern" ;;
|
||||
esac
|
||||
|
||||
8. If 'set -u'/'set -o nounset' is active, then the shell now errors out
|
||||
9. If 'set -u'/'set -o nounset' is active, then the shell now errors out
|
||||
if a nonexistent positional parameter such as $1, $2, ... is accessed.
|
||||
(This does *not* apply to "$@" and "$*".)
|
||||
|
||||
9. If 'set -u'/'set -o nounset' is active, then the shell now errors out
|
||||
10. If 'set -u'/'set -o nounset' is active, then the shell now errors out
|
||||
if $! is accessed before the shell has launched any background process.
|
||||
|
||||
10. The 'print', 'printf' and 'echo' builtin commands now return a nonzero
|
||||
11. The 'print', 'printf' and 'echo' built-in commands now return a nonzero
|
||||
exit status if an input/output error occurs.
|
||||
|
||||
11. Four obsolete date format specifiers for 'printf %(format)T' were
|
||||
12. Four obsolete date format specifiers for 'printf %(format)T' were
|
||||
changed to make them compatible with modern date(1) commands:
|
||||
- %k and %l now return a blank-padded hour (24-hour and 12-hour clock).
|
||||
- %f now returns a date with the format '%Y.%m.%d-%H:%M:%S'.
|
||||
- %q now returns the quarter of the current year.
|
||||
|
||||
12. The 'typeset' builtin now properly detects and reports options that
|
||||
13. The 'typeset' built-in now properly detects and reports options that
|
||||
cannot be used together if they are given as part of the same command.
|
||||
|
||||
13. The DEBUG trap has reverted to pre-93t behavior. It is now once again
|
||||
14. The DEBUG trap has reverted to pre-93t behavior. It is now once again
|
||||
reset like other traps upon entering a subshell or ksh-style function,
|
||||
as documented, and it is no longer prone to crash or get corrupted.
|
||||
|
||||
14. 'command -x' now always runs an external command, bypassing built-ins.
|
||||
15. 'command -x' now always runs an external command, bypassing built-ins.
|
||||
|
||||
16. Unbalanced quotes and backticks now correctly produce a syntax error
|
||||
in -c scripts, 'eval', and backtick-style command substitutions.
|
||||
|
||||
17. -G/--globstar: Symbolic links to directories are now followed if they
|
||||
match a normal (non-**) glob pattern. For example, if '/lnk' is a
|
||||
symlink to a directory, '/lnk/**' and '/l?k/**' now work as expected.
|
||||
|
||||
18. The variable name search expansions ${!prefix@} and ${!prefix*} now
|
||||
also include the variable 'prefix' itself in the possible results.
|
||||
|
||||
19. [[ -v var ]] is now properly equivalent to [[ -n ${var+set} ]].
|
||||
Undocumented special-casing for numeric types has been removed.
|
||||
For example, the following no longer produces an unexpected error:
|
||||
$ ksh -o nounset -c 'float n; [[ -v n ]] && echo $n'
|
||||
|
||||
20. If the HOME variable is unset, the bare tilde ~ now expands to the
|
||||
current user's system home directory instead of merely the username.
|
||||
|
||||
21. On Windows/Cygwin, globbing is no longer case-insensitive by default.
|
||||
Turning on the new --globcasedetect shell option restores
|
||||
case-insensitive globbing for case-insensitive file systems.
|
||||
|
||||
22. If $PWD or $OLDPWD are passed as invocation-local assignments to cd,
|
||||
their values are no longer altered in the outer scope when cd finishes.
|
||||
For example:
|
||||
ksh -c 'OLDPWD=/bin; OLDPWD=/tmp cd - > /dev/null; echo $OLDPWD'
|
||||
ksh -c 'cd /var; PWD=/tmp cd /usr; echo $PWD'
|
||||
now prints '/bin' followed by '/var'.
|
||||
|
||||
23. Path-bound built-ins (such as /opt/ast/bin/cat) can now be executed
|
||||
by invoking the canonical path, so the following will now work:
|
||||
$ /opt/ast/bin/cat --version
|
||||
version cat (AT&T Research) 2012-05-31
|
||||
$ (PATH=/opt/ast/bin:$PATH; "$(whence -p cat)" --version)
|
||||
version cat (AT&T Research) 2012-05-31
|
||||
In the event an external command by that path exists, the path-bound
|
||||
built-in will now override it when invoked using the canonical path.
|
||||
To invoke a possible external command at that path, you can still use
|
||||
a non-canonical path, e.g.: /opt//ast/bin/cat or /opt/ast/./bin/cat
|
||||
|
||||
24. The readonly attribute of ksh variables is no longer imported from
|
||||
or exported to other ksh shell instances through the environment.
|
||||
|
||||
25. Subshells (even if non-forked) now keep a properly separated state
|
||||
of the pseudorandom generator used for $RANDOM, so that using
|
||||
$RANDOM in a non-forked subshell no longer influences a reproducible
|
||||
$RANDOM sequence in the parent environment. In addition, upon
|
||||
invoking a subshell, $RANDOM is now reseeded (as mksh and bash do).
|
||||
|
||||
26. The built-in arithmetic function int() has changed to round towards
|
||||
zero instead of negative infinity. Previously, int() was an alias to
|
||||
floor(), but now it behaves like trunc().
|
||||
|
||||
27. The '!' logical negation operator in the '[[' compound command now
|
||||
correctly negates another '!', e.g., [[ ! ! 1 -eq 1 ]] now returns
|
||||
0/true. Note that this has always been the case for 'test'/'['.
|
||||
|
||||
28. By default, arithmetic expressions in ksh no longer interpret a number
|
||||
with a leading zero as octal in any context. Use 8#octalnumber instead.
|
||||
Before, ksh would arbitrarily recognize the leading octal zero in some
|
||||
contexts but not others. One of several examples is:
|
||||
x=010; echo "$((x)), $(($x))"
|
||||
would output '10, 8'. This now outputs '10, 10'. Arithmetic
|
||||
expressions now also behave identically within and outside ((...))
|
||||
and $((...)). Setting the --posix compliance option turns on the
|
||||
recognition of the leading octal zero for all arithmetic contexts.
|
||||
|
||||
29. It is now an error for arithmetic expressions to assign an out-of-range
|
||||
index value to a variable of an enumeration type created with 'enum'.
|
||||
|
||||
30. For the 'return' built-in command, you can now freely specify any
|
||||
return value that fits in a signed integer, typically a 32-bit value.
|
||||
Note that $? is truncated to 8 bits when the current (sub)shell exits.
|
||||
|
||||
____________________________________________________________________________
|
||||
|
||||
KSH-93 VS. KSH-88
|
||||
|
||||
(Written by David Korn for ksh 93u+ 2012-08-01)
|
||||
|
||||
The following is a list of known incompatibilities between ksh-93 and ksh-88.
|
||||
I have not included cases that are clearly bugs in ksh-88. I also have
|
||||
omitted features that are completely upward compatible.
|
||||
@@ -97,8 +181,10 @@ omitted features that are completely upward compatible.
|
||||
1. Functions, defined with name() with ksh-93 are compatible with
|
||||
the POSIX standard, not with ksh-88. No local variables are
|
||||
permitted, and there is no separate scope. Functions defined
|
||||
with the function name syntax, maintain compatibility.
|
||||
This also affects function traces.
|
||||
with the function name syntax have local variables as in ksh-88,
|
||||
but are statically scoped as in C so that a function does not
|
||||
automatically have access to local variables of the caller.
|
||||
This change also affects function traces.
|
||||
|
||||
2. ! is now a reserved word. As a result, any command by that
|
||||
name will no longer work with ksh-93.
|
||||
@@ -119,7 +205,7 @@ omitted features that are completely upward compatible.
|
||||
for trap without arguments has a format that can be used as input.
|
||||
|
||||
6. With ksh-88, a dollar sign ($') followed by a single quote was
|
||||
interpreted literally. Now it is an ANSI-C string. You
|
||||
interpreted literally. Now it is an ANSI C string. You
|
||||
must quote the dollar sign to get the previous behavior.
|
||||
Also, a $ in front of a " indicates that the string needs
|
||||
to be translated for locales other than C or POSIX. The $
|
||||
@@ -129,7 +215,7 @@ omitted features that are completely upward compatible.
|
||||
with ksh-93, ${foo-~} will cause tilde expansion if foo is
|
||||
not set. You need to escape the ~ for the previous behavior.
|
||||
|
||||
8. Some changes in the tokenizing rules where made that might
|
||||
8. Some changes in the tokenizing rules were made that might
|
||||
cause some scripts with previously ambiguous use of quoting
|
||||
to produce syntax errors.
|
||||
|
||||
@@ -176,6 +262,8 @@ omitted features that are completely upward compatible.
|
||||
19. ksh-88 allowed unbalanced parentheses within ${name op val} whereas
|
||||
ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(}
|
||||
which works with both versions.
|
||||
[2021 UPDATE: This is now once again allowed in ksh 93u+m. Note that
|
||||
balanced parentheses ${foo-()} were also broken and are now fixed.]
|
||||
|
||||
20. kill -l in ksh-93 lists only the signal names, not their numerical
|
||||
values.
|
||||
@@ -215,10 +303,11 @@ omitted features that are completely upward compatible.
|
||||
the stty lnext character is set to control-v or is unset.
|
||||
The sequence escape control-v will display the shell version.
|
||||
|
||||
29. In ksh-88, DEBUG traps were executed. after each command. In ksh-93
|
||||
29. In ksh-88, DEBUG traps were executed after each command. In ksh-93
|
||||
DEBUG traps are executed before each command.
|
||||
|
||||
30. In ksh-88, a redirection to a file name given by an empty string was
|
||||
ignored. In ksh-93, this is an error.
|
||||
|
||||
I am interested in expanding this list so please let me know if you
|
||||
uncover any others.
|
||||
|
||||
@@ -46,7 +46,7 @@ Directory layout:
|
||||
Include directory:
|
||||
1. argnod.h contains the type definitions for command
|
||||
nodes, io nodes, argument nodes, and for positional
|
||||
parameters.a It defines the prototypes for
|
||||
parameters. It defines the prototypes for
|
||||
all the positional parameters functions.
|
||||
2. builtins.h contains prototypes for builtins as well
|
||||
as symbolic constants that refer to the name-pairs
|
||||
@@ -89,7 +89,7 @@ Include directory:
|
||||
functions.
|
||||
19. terminal.h is a header file that includes the appropriate
|
||||
terminal include.
|
||||
20. test.h contains the definitions for the test and [[...]]
|
||||
20. test.h contains the definitions for the test and [[ ... ]]
|
||||
commands.
|
||||
21. timeout.h contains the define constant for the maximum
|
||||
shell timeout.
|
||||
@@ -109,7 +109,7 @@ sh directory:
|
||||
5. deparse.c contains code to generate shell script from
|
||||
a parse tree.
|
||||
6. expand.c contains code for file name expansion and
|
||||
file name generation.
|
||||
pathname expansion.
|
||||
7. fault.c contains code for signal processing, trap
|
||||
handling and termination.
|
||||
8. fcin.c contains code for reading and writing a character
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -120,13 +120,13 @@ to re-execute the command.
|
||||
.LI
|
||||
The
|
||||
.B \-t
|
||||
option to \fBalias\fR builtin is is obsolete. It
|
||||
option to \fBalias\fR builtin is obsolete. It
|
||||
is used to set and list tracked aliases.
|
||||
There is no replacement.
|
||||
.LI
|
||||
The shell command line option
|
||||
.B \-t
|
||||
is obsolete. This option cause the shell to exit after reading
|
||||
is obsolete. This option causes the shell to exit after reading
|
||||
and executing one command. The is no replacement (although ending
|
||||
\&"command" with the exit builtin should have the same effect).
|
||||
.LI
|
||||
|
||||
@@ -14,7 +14,7 @@ performed at shell-level without a significant loss in performance.
|
||||
In addition, "sh" scripts can be run on KSH-93 without modification.
|
||||
.P
|
||||
The code should conform to the IEEE POSIX 1003.1 standard and to the
|
||||
proposed ANSI-C standard so that it should be portable to all
|
||||
proposed ANSI C standard so that it should be portable to all
|
||||
such systems. Like the previous version, KSH-88,
|
||||
it is designed to accept eight bit character sets
|
||||
transparently, thereby making it internationally compatible.
|
||||
@@ -95,14 +95,14 @@ way scripts are.
|
||||
Substring Capabilities: KSH-93 allows you to create a
|
||||
substring of any given string either by specifying the starting
|
||||
offset and length, or by stripping off leading
|
||||
or trailing substrings during parameter substitution.
|
||||
or trailing substrings during parameter expansion.
|
||||
You can also specify attributes, such as upper and lower case,
|
||||
field width, and justification to shell variables.
|
||||
.LI
|
||||
More pattern matching capabilities: KSH-93 allows you to specify
|
||||
extended regular expressions for file and string matches.
|
||||
.LI
|
||||
KSH-93 uses a hierarchal name space for variables.
|
||||
KSH-93 uses a hierarchical name space for variables.
|
||||
Compound variables can be defined and variables can
|
||||
be passed by reference. In addition, each variable
|
||||
can have one or more disciplines associated with
|
||||
@@ -137,5 +137,5 @@ be embedded into an application to allow scripting.
|
||||
Documentation for KSH-93 consists of an "Introduction to KSH-93",
|
||||
"Compatibility with the Bourne Shell" and a manual page and a
|
||||
README file. In addition, the "New KornShell Command and Programming
|
||||
Language," book is available from Prentice Hall.
|
||||
Language" book is available from Prentice Hall.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
This directory, and its subdirectories contain the source code
|
||||
for ksh-93; the language described in the second addition of
|
||||
for ksh-93; the language described in the second edition of
|
||||
the book, "The KornShell Command and Programming Language," by
|
||||
Morris Bolsky and David Korn which is published by Prentice Hall.
|
||||
ksh-93 has been compiled and run on several machines with several
|
||||
@@ -9,96 +9,196 @@ operating systems and machines that ksh-93 has been known to run on.
|
||||
Most of the source code for ksh is in the src/cmd/ksh93/sh
|
||||
directory. For information on what's where, see the file DESIGN.
|
||||
|
||||
A new '-o posix' shell option has been added to ksh 93u+m that makes the
|
||||
ksh language more compatible with other shells by following the POSIX
|
||||
standard more closely. See the manual page for details. It is enabled by
|
||||
default if ksh is invoked as sh, otherwise it is disabled by default.
|
||||
#### COMPILE-TIME OPTIONS ####
|
||||
|
||||
The Makefile file contains several compilation options that can be set
|
||||
The SHOPT.sh file contains several compilation options that can be set
|
||||
before compiling ksh. Options are of the form SHOPT_option and become
|
||||
#define inside the code. These options are set to their recommended
|
||||
value and some of these may disappear as options in future releases.
|
||||
A value of 0, or no value represents off, 1 represents on.
|
||||
Note that == is needed, not =, because these are nmake state variables
|
||||
and changing their value will cause all modules that could be affected
|
||||
by this change to be recompiled.
|
||||
A value of 0 represents off, 1 represents on, no value means probe. For
|
||||
options where no feature probe is available, probe is the same as off.
|
||||
|
||||
The options have the following defaults and meanings:
|
||||
|
||||
2DMATCH on Two-dimensional ${.sh.match} for ${var//pat/str}.
|
||||
|
||||
ACCT off Shell accounting.
|
||||
|
||||
ACCTFILE off Enable per user accounting info.
|
||||
|
||||
AUDIT off For auditing specific users
|
||||
|
||||
AUDITFILE "/etc/ksh_audit"
|
||||
APPEND on Allows var+=val string and array append.
|
||||
BASH off Bash compatibility mode. It is not fully implemented
|
||||
and is experimental.
|
||||
BRACEPAT on C-shell type abc{d,e}f style file generation
|
||||
CMDLIB_BLTIN off Makes all commands in libcmd.a builtins. The
|
||||
SH_CMDLIB_DIR nmake state variable can be used to
|
||||
specify a directory.
|
||||
CMDLIB_DIR off Sets CMDLIB_BLTIN=1 and provides a default value
|
||||
of "/opt/ast/bin" for SH_CMDLIB_DIR.
|
||||
COMPOUND_ARRAY
|
||||
on Allows all components of compound variables except the
|
||||
first to be any string by enclosing in [...]. It also
|
||||
allows components other than the last to be arrays.
|
||||
This is experimental and only partially complete.
|
||||
|
||||
BGX on Enables background job extensions. Noted by "J" in the
|
||||
version string when enabled. (1) JOBMAX=n limits the
|
||||
number of concurrent background jobs to n; the (n+1)th
|
||||
background job will block until a running background job
|
||||
completes. (2) SIGCHLD traps are queued so that each
|
||||
completing background job gets its own trap; $! is set to
|
||||
the job pid and $? is set to the job exit status at the
|
||||
beginning of the trap.
|
||||
|
||||
BRACEPAT on Brace expansion. Expands abc{d,e}f to abcdf abcef.
|
||||
This feature was inspired by the C shell.
|
||||
|
||||
CMDLIB_HDR "<cmdlist.h>"
|
||||
The header in which you can provide a custom list of
|
||||
libcmd commands to provide as path-bound built-ins.
|
||||
|
||||
CMDLIB_DIR "\"/opt/ast/bin\""
|
||||
The default virtual directory prefix for path-bound
|
||||
built-ins. The value must include double quotes.
|
||||
|
||||
CRNL off <cr><nl> treated as <nl> in shell grammar.
|
||||
|
||||
DEVFD Use the more secure /dev/fd mechanism instead of FIFOs for
|
||||
process substitutions. On by default on OSs with /dev/fd.
|
||||
|
||||
DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.)
|
||||
|
||||
ECHOPRINT off Make echo equivalent to print.
|
||||
|
||||
EDPREDICT off Enables history pattern search menu. As you begin a line
|
||||
with a #, the following characters are treated as a shell
|
||||
pattern and cause matching lines from the history file to
|
||||
be displayed as a numbered list as you type. You can
|
||||
scroll up and down this list or you can use <ESC>nTAB to
|
||||
make this the current line (n defaults to 1 if omitted).
|
||||
Experimental. Bugs: https://github.com/ksh93/ksh/issues/233
|
||||
|
||||
ESH on Compile with emacs command line editing. The original
|
||||
emacs line editor code was provided by Mike Veach at IH.
|
||||
|
||||
FILESCAN on Experimental option that allows fast reading of files
|
||||
using while < file;do ...; done and allowing fields in
|
||||
each line to be accessed as positional parameters.
|
||||
KIA off Allow generation of shell cross reference database with -I.
|
||||
|
||||
FIXEDARRAY on When using typeset, a name in the format NAME[N]
|
||||
creates a fixed-size array and any attempt to access a
|
||||
subscript N or higher is an error. Multidimensional
|
||||
fixed-size arrays NAME[N1][N2]... are also supported.
|
||||
|
||||
GLOBCASEDET Adds the 'globcasedetect' shell option. When this shell
|
||||
option is turned on, pathname expansion (globbing)
|
||||
and file name listing and completion automatically become
|
||||
case-insensitive on file systems where the difference
|
||||
between upper- and lowercase is ignored for file names.
|
||||
This compile-time option is enabled by default on operating
|
||||
systems that can support case-insensitive file systems.
|
||||
|
||||
HISTEXPAND on Enable !-style history expansion similar to csh(1).
|
||||
|
||||
KIA off Allow generation of shell cross-reference database with -R.
|
||||
As of 2021-05-10, no tool that can parse this database is
|
||||
known. If you know of any, please contact us.
|
||||
|
||||
MULTIBYTE on Multibyte character handling. Requires mblen() and
|
||||
mbctowc().
|
||||
NAMESPACE on Allows namespaces. This is experimental, incomplete
|
||||
and undocumented.
|
||||
|
||||
NAMESPACE on Adds a 'namespace' reserved word that allows defining name
|
||||
spaces. Variables and functions defined within a block like
|
||||
namespace ExampleSpace { commandlist; }
|
||||
all have their names automatically prefixed with
|
||||
'.ExampleSpace.' when defining or using them, creating a
|
||||
separate space of names unique to the block. Outside of
|
||||
the namespace block, they can be accessed using
|
||||
.ExampleSpace.function or ${.ExampleSpace.variable}.
|
||||
Name spaces within name spaces are also supported.
|
||||
|
||||
MKSERVICE off Enables the 'mkservice' builtin which creates a TCP or UDP
|
||||
server that is implemented by shell functions, and the
|
||||
'eloop' builtin which causes the shell to block waiting for
|
||||
events to process. Experimental and probably insecure.
|
||||
|
||||
NOECHOE off Disable the '-e' option to the 'echo' command,
|
||||
unless SHOPT_ECHOPRINT is enabled.
|
||||
|
||||
OLDTERMIO off Use either termios or termio at runtime.
|
||||
OO on Experimental object oriented extension. This option
|
||||
should disappear soon.
|
||||
|
||||
OPTIMIZE on Optimize loop invariants for with for and while loops.
|
||||
|
||||
PFSH off Compile with support for profile shell. (Solaris; obsolete)
|
||||
|
||||
P_SUID off If set, all real uids, greater than or equal to this
|
||||
value will require the -p flag to run suid/sgid scripts.
|
||||
PFSH off Compile with support for profile shell.
|
||||
RAWONLY off Turn on if the vi line mode doesn't work right unless
|
||||
|
||||
RAWONLY on Turn on if the vi line mode doesn't work right unless
|
||||
you do a set -o viraw.
|
||||
SEVENBIT off Strip the eighth bit from characters.
|
||||
SPAWN off Use spawn as combined fork/exec. May improve speed on
|
||||
some systems.
|
||||
|
||||
REGRESS off Enable the __regress__ built-in command and instrumented
|
||||
intercepts for testing.
|
||||
|
||||
REMOTE off Set --rc (read profile scripts) even if ksh was invoked
|
||||
with standard input on a socket, i.e. as a remote shell.
|
||||
|
||||
SPAWN on Use posix_spawn(3) as combined fork/exec if job control
|
||||
is not active. Improves speed.
|
||||
|
||||
STATS on Add .sh.stats compound variable.
|
||||
|
||||
SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script.
|
||||
|
||||
SYSRC Source /etc/ksh.kshrc on initializing an interactive
|
||||
shell. This is on by default if /etc/ksh.kshrc or
|
||||
/etc/bash.bashrc exists at compile time.
|
||||
|
||||
TEST_L Add 'test -l' as an alias for 'test -L'. This is on by
|
||||
default if the OS's external 'test' command supports it.
|
||||
|
||||
TIMEOUT off Set this to the number of seconds for timing out and
|
||||
exiting the shell when you don't enter a command. If
|
||||
non-zero, TMOUT can not be set larger than this value.
|
||||
|
||||
TYPEDEF on Enable typeset type definitions.
|
||||
|
||||
VSH on Compile with vi command line editing. The original vi
|
||||
line editor code was provided by Pat Sullivan at CB.
|
||||
|
||||
The following compile options are set automatically by the feature testing:
|
||||
DEVFD Set when /dev/fd is a directory that names open files.
|
||||
SHELLMAGIC
|
||||
Set on systems that recognize script beginning with #! specially.
|
||||
#### BUILDING KSH 93U+M ####
|
||||
|
||||
To build ksh (as well as libcmd and libast libraries on which ksh depends),
|
||||
cd to the top directory and run:
|
||||
|
||||
In most instances, you will generate ksh from a higher level directory
|
||||
which also generates libcmd and libast libraries on which ksh depends.
|
||||
However, it is possible to generate ksh, with by running make -f ksh.mk
|
||||
in this directory. The ksh.mk file was generated from the nmake Makefile.
|
||||
If you do not have make or nmake, but do have a Version 7 UNIX compatible
|
||||
shell, then you can run the script mamexec < Mamfile to build ksh.
|
||||
If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk.
|
||||
In either case, ksh relies on libraries libast and libcmd which must be
|
||||
built first. The binary for ksh becomes the file named ./ksh which can
|
||||
be copied to where ever you install it.
|
||||
bin/package make
|
||||
|
||||
If you use old make or the Mamfile, and you system has dynamic shared
|
||||
libraries, then you should define the variables mam_cc_static and
|
||||
mam_cc_dynanamic as the compiler options that request static linking
|
||||
and dynamic linking respectively. This will decrease the number of
|
||||
shared libraries that ksh need and cut startup time substantially.
|
||||
The compiled binaries are stored in the arch directory, in a subdirectory
|
||||
that corresponds to your architecture. The command 'bin/package host type'
|
||||
outputs the name of this subdirectory.
|
||||
|
||||
The makefile should also generate shcomp, a program that will precompile
|
||||
If you have trouble or want to tune the binaries, you may pass additional
|
||||
compiler and linker flags. It is usually best to export these as environment
|
||||
variables before running bin/package as they could change the name of the
|
||||
build subdirectory of the arch directory, so exporting them is a convenient
|
||||
way to keep them consistent between build and test commands. Note that this
|
||||
system uses CCFLAGS instead of the usual CFLAGS. An example that makes
|
||||
Solaris Studio cc produce a 64-bit binary:
|
||||
|
||||
export CCFLAGS="-m64 -O" LDFLAGS="-m64"
|
||||
bin/package make
|
||||
|
||||
Alternatively you can append these to the command, and they will only be
|
||||
used for that command. You can also specify an alternative shell in which to
|
||||
run the build scripts this way. For example:
|
||||
|
||||
bin/package make SHELL=/bin/bash CCFLAGS="-O2 -I/opt/local/include" \
|
||||
LDFLAGS="-L/opt/local/lib"
|
||||
|
||||
For more information, run:
|
||||
|
||||
bin/package help
|
||||
|
||||
Many other commands in this repo self-document via the --help, --man and
|
||||
--html options; those that do have no separate manual page.
|
||||
|
||||
Automated installation is not supported yet. To install manually:
|
||||
|
||||
cp arch/$(bin/package host type)/bin/ksh /usr/local/bin/
|
||||
cp src/cmd/ksh93/sh.1 /usr/local/share/man/man1/ksh.1
|
||||
|
||||
(adapting the destination directories as required).
|
||||
|
||||
The build should also generate shcomp, a program that will precompile
|
||||
a script. ksh93 is able to recognize files in this format and process
|
||||
them as scripts. You can use shcomp to send out scripts when you
|
||||
don't want to give away the original script source.
|
||||
@@ -113,16 +213,19 @@ and want to be able to run setuid/setgid and execute only scripts, then
|
||||
you will have to change the source code file sh/suid_exec.c explicitly.
|
||||
If you do not have ksh in one of these secure locations, /bin/sh will
|
||||
be invoked with the -p options and will fail when you execute a setuid/setgid
|
||||
and/or execute only script. Note, that ksh does not read the .profile
|
||||
or $ENV file when it the real and effective user/group id's are not
|
||||
equal.
|
||||
and/or execute only script. Note that ksh does not read the .profile
|
||||
or $ENV file when the real and effective user/group IDs are not equal.
|
||||
|
||||
The tests sub-directory contains a number of regression tests for ksh.
|
||||
#### TESTING KSH ####
|
||||
|
||||
The tests subdirectory contains a number of regression tests for ksh.
|
||||
To run all these tests with the shell you just built, run the command
|
||||
bin/shtests
|
||||
For help and more options, type
|
||||
bin/shtests --man
|
||||
|
||||
#### OTHER DOCUMENTATION ####
|
||||
|
||||
The file PROMO.mm is an advertisement that extolls the virtues of ksh.
|
||||
The file sh.1 contains the troff (man) description of this Shell.
|
||||
The file nval.3 contains the troff (man) description of the name-value
|
||||
@@ -130,42 +233,20 @@ pair library that is needed for writing built-ins that need to
|
||||
access shell variables.
|
||||
|
||||
The file sh.memo contains a draft troff (mm) memo describing ksh. The
|
||||
file RELEASE88 contains the changes made for ksh88. The file RELEASE93
|
||||
contains the changes made in this release since ksh-88. The file
|
||||
RELEASE contains bug fixes made in this release since ksh-88. The file
|
||||
COMPATIBILITY contains a list of incompatibilities with ksh-88. The
|
||||
file bltins.mm is a draft troff (mm) memo describing how to write
|
||||
file builtins.mm is a draft troff (mm) memo describing how to write
|
||||
built-in commands that can be loaded at run time.
|
||||
|
||||
Most of the work for internationalization has been done with ksh93.
|
||||
The file ksh.msg is a generated file that contains error messages
|
||||
that need to be translated. In addition, the function translate()
|
||||
in sh/init.c has to be completed to interface with the dictionary
|
||||
lookup. The translate function takes two argument, the string
|
||||
that is to be translated and a type which is
|
||||
0 when a library string needs translation.
|
||||
1 when one of the error messages in ksh.msg needs translation.
|
||||
2 when a string in a script needs translation. You use a $ in front
|
||||
of a double quoted string in a script to indicate that it
|
||||
needs translation. The -D option for ksh builds the dictionary.
|
||||
The translate routine needs to return the translated message.
|
||||
For dictionaries that need to use a numeric key, it should be
|
||||
possible to use the strhash() function to generate numbers to
|
||||
go along with each of the messages and to use this number both
|
||||
when generating the dictionary and when converting strings.
|
||||
If you encounter error messages of type 1 that are not be translated via
|
||||
this translate() function send mail to the address below.
|
||||
The file NEWS in the top-level directory contains bug fixes and other
|
||||
changes made in the ksh 93u+m fork and supporting libraries. The file
|
||||
COMPATIBILITY contains a list of potential incompatibilities.
|
||||
|
||||
Please report any problems or suggestions to:
|
||||
#### TESTED SYSTEMS ####
|
||||
|
||||
https://github.com/ksh93/ksh
|
||||
|
||||
|
||||
ksh 93u+m 1.0.0 has been compiled and alpha tested on the following.
|
||||
ksh 93u+m 1.0.0.beta-1 has been compiled and tested on the following.
|
||||
An asterisk signifies minor regression test failures (one or two minor
|
||||
things amiss), two asterisks signify moderate regression test failures
|
||||
(some functionality does not work), and three asterisks signify serious
|
||||
failures (crashes, and/or essential functionality does not work).
|
||||
failures (crashes, and/or important functionality does not work).
|
||||
|
||||
* AIX 7.1 on RISC (PowerPC)
|
||||
* DragonFly BSD 5.8 on x86_64
|
||||
@@ -178,15 +259,30 @@ failures (crashes, and/or essential functionality does not work).
|
||||
GNU/Linux: NixOS 19.09 on x86_64
|
||||
GNU/Linux: Slackware 14.2 on x86_64
|
||||
GNU/Linux: Ubuntu 16.04 on x86_64
|
||||
GNU/Linux: Ubuntu 18.04 on armv7l (32-bit)
|
||||
GNU/Linux: Ubuntu 20.04 on arm64
|
||||
GNU/Linux: Void Linux (musl C library) on x86_64
|
||||
*** HP-UX B.11.11 on pa-risc
|
||||
* illumos: OmniOS 2020-08-19 (gcc) on x86_64
|
||||
macOS 10.13.6 (High Sierra) on x86_64
|
||||
macOS 10.14.6 (Mojave) on x86_64
|
||||
*** NetBSD 8.1 and 9.0 on x86_64
|
||||
* macOS 12.0.1 (Monterey) on arm64
|
||||
* NetBSD 8.1 on x86_64
|
||||
* NetBSD 9.2 on x86_64
|
||||
* OpenBSD 6.8 on x86_64
|
||||
** QNX 6.5.0 on i386
|
||||
* Solaris 11.4 (gcc) on x86_64
|
||||
Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64
|
||||
* UnixWare 7.1.4 on x86
|
||||
*** Windows 7 using Cygwin on x86
|
||||
*** Windows 10 using Cygwin on x86_64
|
||||
*** Windows 11 using Cygwin on x86_64
|
||||
|
||||
#### REPORTING BUGS ####
|
||||
|
||||
Please report any problems or suggestions by opening an issue at:
|
||||
https://github.com/ksh93/ksh
|
||||
Alternatively, email martijn@inlv.org (timely response *not* promised).
|
||||
|
||||
Good luck!!
|
||||
|
||||
@@ -196,4 +292,3 @@ https://github.com/ksh93/ksh
|
||||
Originally written by:
|
||||
David Korn
|
||||
dgk@research.att.com
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
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.
|
||||
____
|
||||
|
||||
12-08-01 --- Release ksh93u+ ---
|
||||
12-08-01 A bug that ignored interrupts for some builtins (e.g. cmdtst::grep)
|
||||
that read from stdin has been fixed.
|
||||
@@ -21,9 +25,9 @@
|
||||
12-07-02 A bug in which builtin name did now work for builtins found in a
|
||||
library added by builtin -f lib has been fixed.
|
||||
12-07-02 A bug in the edit modes which <tab> after a directory did not refresh
|
||||
the input line has been fixed.
|
||||
the input line has been fixed.
|
||||
12-07-02 A bug in which an exit status > 256 corresponding to a signal was
|
||||
not returned by a function to indicate a signal exit has been fixed.
|
||||
not returned by a function to indicate a signal exit has been fixed.
|
||||
12-06-28 Fix ulimit -a to list (Kibytes) instead of (kbytes).
|
||||
12-06-27 Fix uninitialized data reference for <CR> as first char in --vi mode.
|
||||
12-06-26 The formatting of printf "%q" for multibyte locales has changed to
|
||||
@@ -56,9 +60,9 @@
|
||||
could core dump has been fixed.
|
||||
12-06-06 A bug in which unset of an associative array of compound variables
|
||||
did not completely unset the variable has been fixed.
|
||||
12-06-06 A bug in which exporting left or right justified fields could loose
|
||||
12-06-06 A bug in which exporting left or right justified fields could lose
|
||||
the field width has been fixed.
|
||||
12-06-06 A bug on Solaris11 in which >; did not work for /dev/null was fixed.
|
||||
12-06-06 A bug on Solaris 11 in which >; did not work for /dev/null was fixed.
|
||||
12-06-05 A race condition which occurred when stopping a builtin command
|
||||
invoked from a subshell has been fixed.
|
||||
12-06-05 A bug with appending elements to an empty indexed array has been
|
||||
@@ -69,7 +73,7 @@
|
||||
directory if they are killed or stopped.
|
||||
12-06-04 A bug in handling \\ in read has been fixed.
|
||||
12-05-31 Use getrlimit64/setrlimit64 on systems that support it.
|
||||
12-05-31 Fix 64 bit big-endian arithmetic bug that mishandled nan and inf.
|
||||
12-05-31 Fix 64 bit big-endian arithmetic bug that mishandled NaN and Inf.
|
||||
12-05-31 Handle ECONNRESET like EPIPE.
|
||||
12-05-31 Change .paths parse to use only the last BUILTIN_LIB from the top
|
||||
and treat BUILTIN_LIB value as a ':' separated list of lib names.
|
||||
@@ -78,7 +82,7 @@
|
||||
the compile test.
|
||||
12-05-25 A command substitution containing a here-document that itself contains
|
||||
a here-document no longer hangs.
|
||||
12-05-24 When the redirection operatory >; is directed to a symlink, it now
|
||||
12-05-24 When the redirection operator >; is directed to a symlink, it now
|
||||
overwrites the file named by the link rather than the link.
|
||||
12-05-21 +Added printf formats %(type)q where type can be html, url, pattern,
|
||||
ere, or csv.
|
||||
@@ -99,7 +103,7 @@
|
||||
12-05-15 Fixed a .paths bug in which only the first BUILTIN_LIB assignment worked.
|
||||
12-05-14 Arithmetic expressions and subexpressions that are not floating point
|
||||
now treat -0 as 0, so that $((-0)) is 0 and $((-0.0)) is -0.
|
||||
12-05-11 'unset .sh' now fails with readonly message instead of coredump.
|
||||
12-05-11 'unset .sh' now fails with a readonly message instead of a coredump.
|
||||
12-05-11 A bug which left an associative array arr containing one element in
|
||||
the wrong state after expanding with ${arr[@]} has been fixed.
|
||||
12-05-10 A bug in which typeset -f did not display options that called getopts
|
||||
@@ -137,7 +141,7 @@
|
||||
string when i was a valid subscript and j was <=0 rather than
|
||||
generating nothing has been fixed.
|
||||
12-04-17 A bug in which read -d delim from a terminal did not respond to
|
||||
interrupt and did not termrinate when the delimiter was entered
|
||||
interrupt and did not terminate when the delimiter was entered
|
||||
has been fixed.
|
||||
12-04-17 A bug in which a directory in PATH containing a .paths file that
|
||||
contains a line with FPATH=dir, where dir does not exist could
|
||||
@@ -153,7 +157,7 @@
|
||||
are associated with the directory in PATH containing the .paths file.
|
||||
12-04-09 Increased I/O buffer sizes for better performance.
|
||||
12-04-09 A bug in which the leading 0 was stripped from $x, when $x contained
|
||||
a heximadecimal constant inside an arithmetic expression inside
|
||||
a hexadecimal constant inside an arithmetic expression inside
|
||||
a for or while loop.
|
||||
12-04-06 Modified namespaces to hand variables FPATH, PATH, and OPTIND that
|
||||
are defined in name spaces appropriately. This also fixed OPTIND
|
||||
@@ -163,9 +167,9 @@
|
||||
12-04-02 Made some namespace changes and added a regression test.
|
||||
12-03-30 A bug with namespaces in which PATH and FPATH set in a namespace was
|
||||
not restored when leaving the namespace has been fixed.
|
||||
12-03-29 A bug in which appending an index array onto an array without elements
|
||||
12-03-29 A bug in which appending an indexed array onto an array without elements
|
||||
caused the first element to be 1 rather than 0 has been fixed.
|
||||
12-03-29 A bug which could cause a core dump when copying a large index array
|
||||
12-03-29 A bug which could cause a core dump when copying a large indexed array
|
||||
has been fixed.
|
||||
12-03-28 The shell now generates an error message when the sizes with L, Z, and
|
||||
R are > 32767 on 32 bit binaries instead of generating a core dump.
|
||||
@@ -185,7 +189,7 @@
|
||||
ref is a name reference to arr[i] has been fixed.
|
||||
12-03-21 A bug in which assigning a compound variable into arr[i], where
|
||||
arr[i] is an array variable did not work correctly has been fixed.
|
||||
12-03-21 A bug with multi-dimenstional index arrays in which ${arr[i][j]}
|
||||
12-03-21 A bug with multidimensional indexed arrays in which ${arr[i][j]}
|
||||
could generate a bogus error message when i was > 9 has been fixed.
|
||||
12-03-21 A bug in which typeset v=foo, typeset -p v[0] generated a core dump
|
||||
has been fixed.
|
||||
@@ -207,7 +211,7 @@
|
||||
error since a is not an assignment command.
|
||||
12-03-16 A bug in which an unset discipline from a variable defined in a
|
||||
subshell is not invoked in the subshell has been fixed.
|
||||
12-03-08 The assignment typeset -a (x=1 y=2) now creates an index array
|
||||
12-03-08 The assignment typeset -a (x=1 y=2) now creates an indexed array
|
||||
of two elements rather than an array of one element which is
|
||||
a compound variable.
|
||||
12-03-02 +The vi and emacs edit modes now list all the entries in a directory
|
||||
@@ -221,7 +225,7 @@
|
||||
12-02-29 --- Release ksh93u+ ---
|
||||
12-02-29 A bug in which ~user expanded first in a subshell prevented it
|
||||
from expanding later in a program has been fixed.
|
||||
12-02-29 A bug which could lead to a core dump when more that four shared
|
||||
12-02-29 A bug which could lead to a core dump when more than four shared
|
||||
libraries were added with the builtin command has been fixed.
|
||||
12-02-29 Fixed a few bugs which caused SIGCHLD to be blocked preventing
|
||||
background jobs from being reaped until a foreground job was run.
|
||||
@@ -243,7 +247,7 @@
|
||||
that caused a core dump has been fixed.
|
||||
12-02-08 A bug in which .sh.fun disciplines could be cleared after a
|
||||
function completes has been fixed.
|
||||
12-02-08 A bug in job control in which the foregroup process group was not
|
||||
12-02-08 A bug in job control in which the foreground process group was not
|
||||
set correctly after restarting a stopped pipeline has been fixed.
|
||||
12-02-07 A bug in which numbers with leading zeros could be treated as
|
||||
octal constants outside of ((...)) has been fixed.
|
||||
@@ -251,17 +255,17 @@
|
||||
array elements has been fixed.
|
||||
12-02-02 A bug in the ulimit option table was fixed.
|
||||
12-01-26 A bug in which a set command that did not change monitor could
|
||||
effect the behavior of the monitor when monitor mode is on is fixed.
|
||||
affect the behavior of the monitor when monitor mode is on is fixed.
|
||||
12-01-21 +You can now test whether the shell implements a math function using
|
||||
typeset -f .sh.math.name, where name is the name of the function.
|
||||
12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte
|
||||
characters correctly has been fixed.
|
||||
12-01-20 A bug that could cause the shell to hang waiting for an incorrect
|
||||
job pid has been fixed.
|
||||
12-01-19 A memory leak which occurred for a nested command subtiution has been
|
||||
12-01-19 A memory leak which occurred for a nested command substitution has been
|
||||
fixed.
|
||||
12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute
|
||||
for some other variables, for exampe, HISTFILE has been fixed.
|
||||
for some other variables, for example, HISTFILE has been fixed.
|
||||
12-01-16 A bug in which .sh.match was not correct after a substring match when
|
||||
the replacement string contained a substring match has been fixed.
|
||||
12-01-12 +Files that are sourced from profile files are now read and executed
|
||||
@@ -287,7 +291,7 @@
|
||||
been fixed.
|
||||
11-12-07 I fixed a bug in which a variable expansion in a large here-document
|
||||
could be expanded to a null string.
|
||||
11-12-06 An optimization to read was added in the case the the read command
|
||||
11-12-06 An optimization to read was added in the case the read command
|
||||
was redirected from a file.
|
||||
11-12-06 Changes were made to make the line limit for read unlimited by
|
||||
default.
|
||||
@@ -297,7 +301,7 @@
|
||||
quote argument in a form suitable for a field in a .csv format file.
|
||||
11-12-02 +A -S option was added to read to be able to read .csv format files.
|
||||
11-11-28 A bug in which redirection of standard error in a function called from
|
||||
command substitution caused standard error to be lost has ben fixed.
|
||||
command substitution caused standard error to be lost has been fixed.
|
||||
11-11-21 [[ (-n foo) ]] no longer requires a space before (.
|
||||
11-11-11 The readonly attribute for a variable now applies to compound
|
||||
assignments to that variable.
|
||||
@@ -305,7 +309,7 @@
|
||||
recursion.
|
||||
11-10-10 +Added alternate flag to printf %H for encoding of URI's.
|
||||
11-10-10 A bug which could lead to a core dump when the shell was invoked
|
||||
with more than twenty five open files has been fixed.
|
||||
with more than twenty-five open files has been fixed.
|
||||
11-10-06 A bug in the scoping of name references in functions called by other
|
||||
functions has been fixed.
|
||||
11-10-05 A bug in which wait on a pid may return the exit status of an
|
||||
@@ -317,7 +321,7 @@
|
||||
11-09-21 Added letoctal option that enables the let command to recognize
|
||||
octal constants starting with 0.
|
||||
11-09-20 A bug in which ${var.} could cause a core dump has been fixed.
|
||||
11-09-20 A bug with SHOPT_EDPREDICT when neither vi or emacs was enabled for
|
||||
11-09-20 A bug with SHOPT_EDPREDICT when neither vi nor emacs was enabled for
|
||||
lines beginning with # when in a multibyte locale has been fixed.
|
||||
11-09-20 A bug in emacs edit mode with SHOPT_EDPREDICT that would cause
|
||||
history searches matching comments lines to generate predictions
|
||||
@@ -353,9 +357,9 @@
|
||||
jobs to complete has been fixed.
|
||||
11-06-09 A bug which caused the options.sh regression test to fail on OS390
|
||||
Linux has been fixed. The bug could also have affected other systems.
|
||||
11-06-07 +A number of changes to support the still undocuments namespace option
|
||||
11-06-07 +A number of changes to support the still undocumented namespace option
|
||||
have been added.
|
||||
11-06-06 A bug in which command substitution of eval would hang when it had
|
||||
11-06-06 A bug in which command substitution of eval would hang when it had
|
||||
standard error redirected to standard output has been fixed.
|
||||
11-06-01 A bug in case statement fall through (;&) ignoring set -e was fixed.
|
||||
11-06-01 A bug in which creating a left or right justified upper or lowercase
|
||||
@@ -373,7 +377,7 @@
|
||||
variable core dumps has been fixed.
|
||||
11-05-28 Two bugs in the display of arrays of compound variables with print -v
|
||||
have been fixed.
|
||||
11-05-27 A bug with command substitution with the shift jis locale has been
|
||||
11-05-27 A bug with command substitution in the Shift JIS locale has been
|
||||
fixed.
|
||||
11-05-25 A bug in which unset -f foo, called within function foo could cause
|
||||
the shell to core dump has been fixed.
|
||||
@@ -402,7 +406,7 @@
|
||||
an a core dump for not fixed arrays.
|
||||
11-04-25 A bug in the references to two dimensional compound arrays has
|
||||
been fixed.
|
||||
11-04-20 A bug in which a name reference to a multidimentional index array
|
||||
11-04-20 A bug in which a name reference to a multidimensional indexed array
|
||||
index, nameref x=foo[3][4], did not work correctly has been fixed.
|
||||
11-04-18 Changes were added to allow fixed size arrays of variable sized
|
||||
objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28.
|
||||
@@ -414,7 +418,7 @@
|
||||
the match instance.
|
||||
11-04-11 A bug in which readonly var, where var is exported could cause var
|
||||
to be unset has been fixed.
|
||||
11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause in infinite
|
||||
11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause an infinite
|
||||
loop has been fixed.
|
||||
11-04-05 A bug in which ${!x.} could cause a core dump has been fixed.
|
||||
11-04-04 A bug in which cleaning out the history file could terminate before
|
||||
@@ -436,7 +440,7 @@
|
||||
11-03-07 A bug in which reassigning a compound variable to an associative
|
||||
array index could incorrectly increase the count of the number
|
||||
of elements has been fixed.
|
||||
11-03-04 +The tilde expansion on windows has been modified to handle user
|
||||
11-03-04 +The tilde expansion on Windows has been modified to handle user
|
||||
names of the form domain/user so that ~domain/user now expands
|
||||
to the home directory of that domain user.
|
||||
11-03-03 A bug in which the width of the prompt was calculated incorrectly
|
||||
@@ -493,7 +497,7 @@
|
||||
signal. This prevents a core dump to be overwritten by the shell.
|
||||
10-12-22 A bug in the expansion of ${A[@]} ${B[@]}, introduced in 10-12-01
|
||||
when A="" B=B has been fixed.
|
||||
10-12-21 +Use MS_3D in b_vpath() for setting win32 WoW mount defaults.
|
||||
10-12-21 +Use MS_3D in b_vpath() for setting Win32 WoW mount defaults.
|
||||
10-12-17 A bug in the expansion of ${var:i:j} which caused a core dump when
|
||||
i > ${#var} has been fixed.
|
||||
10-12-16 +sleep now treats . as decimal point even in locales that use comma.
|
||||
@@ -517,12 +521,12 @@
|
||||
variables.
|
||||
10-11-29 An incorrect warning message was eliminated with the -n option for
|
||||
arithmetic expressions with associative arrays.
|
||||
10-11-29 Some changes were made to slightly reduces startup time.
|
||||
10-11-29 Some changes were made to slightly reduce startup time.
|
||||
10-11-24 A bug in which a name reference is make to arr[0] when arr is not
|
||||
an array has been fixed.
|
||||
10-11-23 If a type definition is made without a compound variable assignment it
|
||||
produces an error message and no longer shows up as a defined type.
|
||||
10-11-22 The handling of \ inside [...] for for shell and ~(E) patterns has
|
||||
10-11-22 The handling of \ inside [...] for shell and ~(E) patterns has
|
||||
been fixed.
|
||||
10-11-22 A patch was made to pfsh to handle an error case.
|
||||
10-11-22 +Modified types defined in namespace so that they do not clash with
|
||||
@@ -538,7 +542,7 @@
|
||||
10-11-18 Fixed a bug in which typeset -T foo; typeset -T could cause a
|
||||
core dump.
|
||||
10-11-17 Fixed a bug in which the error message for set -u could come out
|
||||
garbelled.
|
||||
garbled.
|
||||
10-11-17 Modified the parser so that typeset -a var=(...) no longer checks
|
||||
the first index for aliases and reserved words.
|
||||
10-11-17 A bug in which a subshell command consisted of only a for or until
|
||||
@@ -616,10 +620,10 @@
|
||||
10-09-29 A bug in which loading a function from FPATH could leave a file
|
||||
descriptor open has been fixed.
|
||||
10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being
|
||||
evaluation. It allows fixed sized indexed arrays be to defined
|
||||
using "typeset array[dim1][dim2]...[dimn]". Fixed sized arrays
|
||||
evaluated. It allows fixed-size indexed arrays be to defined
|
||||
using "typeset array[dim1][dim2]...[dimn]". Fixed-size arrays
|
||||
are used the same way indexed arrays are. Currently, only fixed
|
||||
arrays of fixed objects (float, int, and justifies objects) are
|
||||
arrays of fixed objects (float, int, and justified objects) are
|
||||
supported.
|
||||
10-09-22 A bug which could cause an exception when a function with static
|
||||
variables was redefined has been fixed.
|
||||
@@ -641,7 +645,7 @@
|
||||
has been fixed.
|
||||
10-09-08 A bug in the processing of references to multidimensional arrays
|
||||
in arithmetic expressions has been fixed.
|
||||
10-09-08 A bug in the handling of multi-dimensional arrays which caused
|
||||
10-09-08 A bug in the handling of multidimensional arrays which caused
|
||||
the number of elements in each dimension to be incorrect has
|
||||
been fixed.
|
||||
10-09-07 The change for messages on 10-08-09 did not handle message in
|
||||
@@ -711,12 +715,12 @@
|
||||
was invoked on a two dimensional array, i.e., arr[5][9].discipline.
|
||||
10-07-19 Fixed a buffering problem which occurred when running a script with
|
||||
ssh and the parent ssh process is killed.
|
||||
10-07-14 Modified the parser to treat ((...)) inside [[...]] as ( (...) ) to
|
||||
10-07-14 Modified the parser to treat ((...)) inside [[ ... ]] as ( (...) ) so
|
||||
that it is a nested (...).
|
||||
10-07-09 A bug in the handling of process substitution inside command
|
||||
substitution as part of a pipeline has been fixed.
|
||||
10-07-07 A bug in the output for compound variables containing
|
||||
multi-dimensional arrays has been fixed.
|
||||
multidimensional arrays has been fixed.
|
||||
10-07-06 ksh now recovers from changes made by bash to the history file without
|
||||
losing history commands.
|
||||
10-06-25 A bug in which a large here document containing command substitutions
|
||||
@@ -733,7 +737,7 @@
|
||||
the variable had an attribute but did not have a value.
|
||||
10-06-18 Modified trap handling so that if the same signal is received when
|
||||
executing the handler, it is deferred until the handler completes.
|
||||
10-06-16 Fixed a bug in which ulimit -v was setting the the cpu limit
|
||||
10-06-16 Fixed a bug in which ulimit -v was setting the CPU limit
|
||||
on Linux.
|
||||
10-06-14 +The command 'typeset -T' now generates the list of type definitions
|
||||
in a format that can be used as input to the shell.
|
||||
@@ -789,7 +793,7 @@
|
||||
10-05-19 <<< with an empty string no longer gives an error.
|
||||
10-05-19 A bug in arithmetic evaluation when a name reference to an array
|
||||
instance was used has been fixed.
|
||||
10-05-14 A bug in which the shell treats a valid index array assignment,
|
||||
10-05-14 A bug in which the shell treats a valid indexed array assignment,
|
||||
typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed.
|
||||
10-05-13 A bug in creating name references to associative array variable
|
||||
after a lookup of one of its elements has been fixed.
|
||||
@@ -927,7 +931,7 @@
|
||||
with radix char , and thousands separator . has been fixed.
|
||||
09-12-28 A bug in the handling of SIGCLD on systems that generated SIGCLD
|
||||
while blocked waiting for process to complete has been fixed.
|
||||
09-12-24 ast setlocale() reworked to differentiate env var changes from user
|
||||
09-12-24 AST setlocale() reworked to differentiate env var changes from user
|
||||
override.
|
||||
09-12-18 A bug with the SHOPT_BGX option set which disabled traps for signals
|
||||
< SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed.
|
||||
@@ -982,7 +986,7 @@
|
||||
in command completion has been fixed.
|
||||
09-10-09 $PATH processing has been changed to delay dir stat() and .paths
|
||||
lookup until the directory is needed in the path search.
|
||||
09-09-28 Call the ast setlocale() intercept on unset too.
|
||||
09-09-28 Call the AST setlocale() intercept on unset too.
|
||||
09-09-24 A bug in which LANG=foo; LC_ALL=foo; unset LC_ALL; did not revert
|
||||
LC_CTYPE etc. to the LANG value has been fixed.
|
||||
09-09-17 A bug in which unsetting SVLVL could cause a script invoked by
|
||||
@@ -996,7 +1000,7 @@
|
||||
09-09-09 A bug in which a subshell containing a background process could
|
||||
block until the background process completed has been fixed.
|
||||
09-09-04 A bug in handling ${var[sub]}, where var is a nameref has been fixed.
|
||||
09-09-03 A bug which caused an index array to have the wrong number of elements
|
||||
09-09-03 A bug which caused an indexed array to have the wrong number of elements
|
||||
when it was converted from a compound variable by adding an another
|
||||
element has been fixed.
|
||||
09-09-03 Specifying export for a compound variable now generates an error.
|
||||
@@ -1045,7 +1049,7 @@
|
||||
09-06-19 Two bugs related to read -b for array variables has been fixed.
|
||||
09-06-19 A bug with typeset for compound variables containing arrays of
|
||||
compound variables has been fixed.
|
||||
09-06-18 A bug in appending a compound variable to a an indexed array of
|
||||
09-06-18 A bug in appending a compound variable to an indexed array of
|
||||
compound variables has been fixed.
|
||||
09-06-18 A bug which occurs when appending a compound variable to an indexed
|
||||
array element has been fixed.
|
||||
@@ -1088,7 +1092,7 @@
|
||||
09-04-07 The emacs edit command M-_ and M_. and the vi command _ was fixed
|
||||
to handle the case there there is no history file.
|
||||
09-04-05 A bug in handling new-lines with read -n has been fixed.
|
||||
09-04-05 The ENV variable defaults the the file named by $HOME/.kshrc rather
|
||||
09-04-05 The ENV variable defaults to the file named by $HOME/.kshrc rather
|
||||
then to the string $HOME/.kshrc.
|
||||
09-03-31 A bug in which a nested command substitution with redirections could
|
||||
leave a file descriptor open has been fixed.
|
||||
@@ -1142,9 +1146,9 @@
|
||||
has been fixed.
|
||||
09-01-19 A bug in which sending SIGWINCH to a process that reads from a pipe
|
||||
could cause a memory fault has been fixed.
|
||||
09-01-16 +The -R unary operator was added to [[...]] and test to check whether
|
||||
a variable is a name reference.
|
||||
09-01-16 +The -v unary operator was added to [[...]] and test to check whether
|
||||
09-01-16 +The -R unary operator was added to [[ ... ]] and test to check whether
|
||||
a variable is a name reference.
|
||||
09-01-16 +The -v unary operator was added to [[ ... ]] and test to check whether
|
||||
a variable is set.
|
||||
09-01-14 The unset built-in was modified to return 0 exit status when
|
||||
unsetting a variable that was unset to conform with the POSIX
|
||||
@@ -1182,7 +1186,7 @@
|
||||
instead of quoting the argument in single quotes.
|
||||
08-12-07 A bug in typeset -m which occurred when the target node was an
|
||||
associative array element has been fixed.
|
||||
08-12-07 A timing bug on some systems (for example darwin), that could
|
||||
08-12-07 A timing bug on some systems (for example Darwin), that could
|
||||
cause the last process of a pipeline entered interactively to fail
|
||||
with an "Exec format error" has been fixed.
|
||||
08-12-04 +SHOPT_BGX enables background job extensions. Noted by "J" in
|
||||
@@ -1261,7 +1265,7 @@
|
||||
cases where the command caused the shell to fork has been fixed.
|
||||
08-09-19 type, whence -v, and command -v were fixed to comply with POSIX
|
||||
by writing 'not found' diagnostics to the standard error.
|
||||
08-09-18 test and [...] were fixed to comply with POSIX in the case
|
||||
08-09-18 test and [ ... ] were fixed to comply with POSIX in the case
|
||||
of test '(' binop ')' where binop is a valid binary test operator.
|
||||
08-09-16 +If a method discipline named create is specified when defining a
|
||||
type, this function will be called when an instance is created.
|
||||
@@ -1270,7 +1274,7 @@
|
||||
08-09-10 The shell now prints an error message when the type name specified
|
||||
for an indexed array subscript is not an enumeration type.
|
||||
08-09-10 A bug in which a subshell that spawned a background process could
|
||||
loose output that was produced after the foreground completed
|
||||
lose output that was produced after the foreground completed
|
||||
has been fixed.
|
||||
08-09-10 A timing bug on some systems that could cause coprocesses started by a
|
||||
subshell to not clean up and prevent other coprocesses has been fixed.
|
||||
@@ -1335,8 +1339,8 @@
|
||||
jobs completed has been fixed.
|
||||
08-06-23 _KSH_VERSION added as a name reference to .sh.version.
|
||||
08-06-20 type now outputs 'special builtin' for special builtins.
|
||||
08-06-19 A couple of bugs in multi-dimensional arrays have been fixed.
|
||||
08-06-19 A bug in which a syntax error in a dot script could generated
|
||||
08-06-19 A couple of bugs in multidimensional arrays have been fixed.
|
||||
08-06-19 A bug in which a syntax error in a dot script could generate
|
||||
a syntax error in the next subsequent command has been fixed.
|
||||
08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions
|
||||
on some architectures.
|
||||
@@ -1344,7 +1348,7 @@
|
||||
specified variable was not set has been fixed.
|
||||
08-06-16 +When typeset -p is followed by variable names, it now displays
|
||||
the attributes names and values for the specific names.
|
||||
08-06-14 A bug that could effect the drawing of the screen from multiline
|
||||
08-06-14 A bug that could affect the drawing of the screen from multiline
|
||||
emacs or gmacs mode when walking up the history file has been fixed.
|
||||
08-06-13 A bug in which a compound variable defined in a subshell could
|
||||
have side effects into the parent shell has been fixed.
|
||||
@@ -1468,7 +1472,7 @@
|
||||
08-03-04 A bug in multiline mode in emacs and vi mode which could cause the
|
||||
cursor to be on the wrong line when interrupt was hit has been fixed.
|
||||
08-03-03 The change made in ksh93s+ on 07-06-18 in which braces became
|
||||
optional for ${a[i]} inside [[...]] was restored in the case
|
||||
optional for ${a[i]} inside [[ ... ]] was restored in the case
|
||||
where the argument can be a pattern.
|
||||
08-03-03 A bug in which creating a name reference to an associative array
|
||||
instance would fail when the subscript contained characters [ or
|
||||
@@ -1477,7 +1481,7 @@
|
||||
files, generates the output in a temporary file and writes the
|
||||
specified file only of the command has completed successfully.
|
||||
08-02-15 A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*)
|
||||
has bee fixed.
|
||||
has been fixed.
|
||||
08-02-07 A bug in which test \( ! -e \) produced an error has been fixed.
|
||||
08-02-14 +The typeset -a option can now optionally be followed by the name
|
||||
of an enumeration type which allows subscripts to be enumerations.
|
||||
@@ -1496,7 +1500,7 @@
|
||||
07-10-03 A bug in which : was not allowed as part of an alias name has been
|
||||
fixed.
|
||||
07-09-26 A bug in which appending a compound variable to a compound variable
|
||||
or to an index array didn't work has been fixed.
|
||||
or to an indexed array didn't work has been fixed.
|
||||
07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually
|
||||
cursor up, when the cursor is at the end of the line will fetch
|
||||
the most recent line starting with the current line.
|
||||
@@ -1525,7 +1529,7 @@
|
||||
08-04-11 A bug which caused $(exec > /dev/null) to go into an infinite loop
|
||||
has been fixed.
|
||||
08-03-27 A bug in which typeset -LZ was being treated as -RZ has been fixed.
|
||||
08-03-06 A bug with ksh -P on systems that support the the profile shell,
|
||||
08-03-06 A bug with ksh -P on systems that support the profile shell,
|
||||
in which it would exit after running a non-builtin has been fixed.
|
||||
08-01-31 A bug in which command substitution inside ((...)) could cause
|
||||
syntax errors or lead to core dumps has been fixed.
|
||||
@@ -1543,7 +1547,7 @@
|
||||
returned by a process that catches the SIGCONT signal is stopped
|
||||
and then continued.
|
||||
07-12-13 A race condition in which a program that has been stopped and then
|
||||
continued could loose the exit status has been fixed.
|
||||
continued could lose its exit status has been fixed.
|
||||
07-12-12 Code to check for file system out of space write errors for all
|
||||
writes has been added.
|
||||
07-12-11 A bug in the macro expander for multibyte characters in which
|
||||
@@ -1568,19 +1572,19 @@
|
||||
07-11-15 A bug in which "hash -- name" treated "--" as an invalid name operand
|
||||
has been fixed.
|
||||
07-11-15 typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility.
|
||||
07-11-15 A bug in which the umask builtin mis-handled symbolic mode operands
|
||||
07-11-15 A bug in which the umask builtin mishandled symbolic mode operands
|
||||
has been fixed.
|
||||
07-11-15 Bugs in which shell arithmetic and the printf builtin mis-handled the
|
||||
07-11-15 Bugs in which shell arithmetic and the printf builtin mishandled the
|
||||
signs of { -NaN -Inf -0.0 } have been fixed.
|
||||
07-11-15 +The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range
|
||||
of signals, determined at runtime, are now supported.
|
||||
07-11-15 A bug in which creating an index array with only subscript 0 created
|
||||
07-11-15 A bug in which creating an indexed array with only subscript 0 created
|
||||
only a simple variable has been fixed.
|
||||
07-11-14 A bug in which appending to an indexed array using the form
|
||||
name+=([sub]=value) could cause the array to become an associative
|
||||
array has been fixed.
|
||||
07-11-14 A bug in which typeset without arguments could coredump if a
|
||||
variable is declared as in indexed array and has no elements has
|
||||
variable is declared as an indexed array and has no elements has
|
||||
been fixed.
|
||||
07-11-14 A bug in which creating a local SECONDS variable with typeset in
|
||||
a function could corrupt memory has been fixed.
|
||||
@@ -1598,7 +1602,7 @@
|
||||
07-09-20 A bug in which a nameref to a compound variable that was local
|
||||
to the calling function would not expand correctly when displaying
|
||||
is value has been fixed.
|
||||
07-09-19 A bug which cause cause a core dump if .sh.edchar returned
|
||||
07-09-19 A bug which could cause a core dump if .sh.edchar returned
|
||||
80 characters or more from a keyboard trap has been fixed.
|
||||
07-09-14 A bug in which could cause a core dump when more than 8 file
|
||||
descriptors were in use has been fixed.
|
||||
@@ -1618,7 +1622,7 @@
|
||||
has been fixed.
|
||||
07-08-08 A bug in which a trap ignored in a subshell caused it to be
|
||||
ignored by the parent has been fixed.
|
||||
07-08-07 A bug in which the set command would generated erroneous output
|
||||
07-08-07 A bug in which the set command would generate erroneous output
|
||||
for a variable with the -RZ attribute if the variable name had been
|
||||
passed to a function has been fixed.
|
||||
07-08-02 A bug in which read x[1] could core dump has been fixed.
|
||||
@@ -1636,13 +1640,13 @@
|
||||
07-06-25 A bug in the expansion of ${var/pattern/rep} when pattern or rep
|
||||
contained a left parenthesis in single quotes has been fixed.
|
||||
07-06-18 The braces for a subscripted variable with ${var[sub]} are now
|
||||
optional when inside [[...]], ((...)) or as a subscript.
|
||||
optional when inside [[ ... ]], ((...)) or as a subscript.
|
||||
07-05-28 A bug in brace expansion in which single and double quotes did
|
||||
not treat the comma as a literal character has been fixed.
|
||||
07-05-24 The -p option of whence now disables -v.
|
||||
07-05-23 Several bug fixes in compound variables and arrays of arrays
|
||||
have been made.
|
||||
07-05-15 A bug in which the %B format of printf was affected by the
|
||||
07-05-15 A bug in which the %B format of printf was affected by the
|
||||
locale has been fixed.
|
||||
07-05-14 A bug in which \ was not removed in the replacement pattern with
|
||||
${var/pattern/rep} when it was not followed by \ or a digit has
|
||||
@@ -1693,7 +1697,7 @@
|
||||
06-11-20 A bug in which "${foo[@]:1}}" expands a null argument (instead of
|
||||
no argument), when foo[0] is not empty has been fixed.
|
||||
06-11-16 The discipline functions have been modified to allow each subscript
|
||||
to act independently. Currently the discipline function will not
|
||||
to act independently. Currently, the discipline function will not
|
||||
be called when called from a discipline function of the same variable.
|
||||
06-11-14 A bug which could cause a core dump if a file descriptor for
|
||||
an internal file was closed from with a subshell has been fixed.
|
||||
@@ -1788,7 +1792,7 @@
|
||||
06-05-19 +Modified arithmetic so that conversions to strings default to
|
||||
the maximum number of precision digits.
|
||||
06-05-16 Bug fixes for multibyte locales.
|
||||
06-05-10 The =~ operator was added to [[...]] and [[ string ~= ERE ]]
|
||||
06-05-10 The =~ operator was added to [[ ... ]] and [[ string ~= ERE ]]
|
||||
is equivalent to [[ string == ~(E)ERE ]].
|
||||
06-04-25 A bug in the vi edit mode which could cause the shell to core dump
|
||||
when switching from emacs mode.
|
||||
@@ -1853,7 +1857,7 @@
|
||||
05-08-31 +In the case that IFS contains to adjacent new-lines so that
|
||||
new-line is not treated as a space delimiter, only a single
|
||||
new-line is deleted at the end of a command substitution.
|
||||
05-08-19 +When a tilde substitution expands to the / directory and is
|
||||
05-08-19 +When a tilde expansion expands to the / directory and is
|
||||
followed by a /, it is replaced by the empty string.
|
||||
05-08-16 A bug in which n<&m did not synchronize m has been fixed.
|
||||
05-08-16 A bug in which process substitution ( <() and >() ) was not
|
||||
@@ -1880,7 +1884,7 @@
|
||||
05-05-18 A bug in which the line number for errors was not correct for
|
||||
functions loaded from FPATH has been fixed.
|
||||
05-04-18 A bug in which the exit status $? is not set when a trap triggered
|
||||
by the [[...]] command is executed has been fixed.
|
||||
by the [[ ... ]] command is executed has been fixed.
|
||||
05-04-08 +Redirection operators can be directly preceded with {varname}
|
||||
with no intervening space, where varname is a variable name which
|
||||
allows the shell to select a file descriptor > 10 and store it
|
||||
@@ -1955,7 +1959,7 @@
|
||||
the shared library named by libname will first be searched for a
|
||||
built-in version of the command.
|
||||
04-09-03 <<< here documents now handle quotes in the word token correctly.
|
||||
04-08-08 +The maximum size for read -n and and read -N was increased from
|
||||
04-08-08 +The maximum size for read -n and read -N was increased from
|
||||
4095 to 32M.
|
||||
04-08-04 +printf %q was modified so that if an no operand was supplied, no
|
||||
no output would be generated rather than a quoted empty string.
|
||||
@@ -2065,7 +2069,7 @@
|
||||
03-08-07 A bug in which the KEYBD trap was not being invoked when
|
||||
characters with the 8th bit set has been fixed.
|
||||
03-08-02 A parser bug introduced in ksh93o which caused the character
|
||||
after () in a Posix function definition to be skipped
|
||||
after () in a POSIX function definition to be skipped
|
||||
when reading from standard input has been fixed.
|
||||
03-08-01 A bug in which "${foo#pattern}(x)" treated (x) as if it were
|
||||
part of the pattern has been fixed.
|
||||
@@ -2075,7 +2079,7 @@
|
||||
work as expected.
|
||||
|
||||
03-07-20 --- Release ksh93o+ ---
|
||||
03-07-20 A bug in which could cause memory corruption when a posix
|
||||
03-07-20 A bug in which could cause memory corruption when a POSIX
|
||||
function invoked another one has been fixed.
|
||||
03-07-15 A bug in which a file descriptor>2 could be closed before
|
||||
executing a script has been fixed.
|
||||
@@ -2122,7 +2126,7 @@
|
||||
would go to the standard output of the invoking command when
|
||||
uname was invoked with a non-standard option has been fixed.
|
||||
03-05-19 A job control bug which would cause the shell to exit because
|
||||
it hadn't take back the terminal has been fixed. The bug
|
||||
it hadn't taken back the terminal has been fixed. The bug
|
||||
could occur when running a function that contained a pipeline
|
||||
whose last element was a function.
|
||||
03-05-19 A job control timing bug introduced in ksh93o on some systems
|
||||
@@ -2144,7 +2148,7 @@
|
||||
did not follow x has been fixed.
|
||||
|
||||
03-03-18 --- Release ksh93o ---
|
||||
03-03-18 +A -N unary operator was added to test and [[...]] which returns
|
||||
03-03-18 +A -N unary operator was added to test and [[ ... ]] which returns
|
||||
true if the file exists and the file has been modified since it
|
||||
was last read.
|
||||
03-03-18 +The TIMEFORMAT variable was added to control the format for
|
||||
@@ -2168,7 +2172,7 @@
|
||||
displays the function name followed by a comment containing the
|
||||
line number and the path name for the file that defined this function.
|
||||
03-02-28 A bug in which the value of $LINENO was not correct when executing
|
||||
command contained inside mult-line command substitutions has been
|
||||
command contained inside multi-line command substitutions has been
|
||||
fixed.
|
||||
03-02-19 +Since some existing ksh88 scripts use the undocumented and
|
||||
unintended ability to insert a : in front of the % and # parameter
|
||||
@@ -2373,14 +2377,14 @@
|
||||
01-09-25 +The exponentiation operator ** was added to the shell arithmetic
|
||||
evaluation. It has higher precedence than * and is left
|
||||
associative.
|
||||
01-09-25 The code was modified to use the ast multibyte macros
|
||||
01-09-25 The code was modified to use the AST multibyte macros
|
||||
and functions for handling multibyte locales.
|
||||
01-09-25 +The expansion ${parameter:offset:length} now handles negative
|
||||
offsets which cause offsets to be measured from the end.
|
||||
01-09-25 Some spelling errors in the documentation were corrected.
|
||||
01-09-24 +The /dev/tcp/host/port and /dev/udp/host/port now allow
|
||||
the ports to be specified by service name.
|
||||
01-09-24 +The change staring with ksh93g in which the the appropriate
|
||||
01-09-24 +The change starting with ksh93g in which the appropriate
|
||||
library path variable is prepended with a corresponding library
|
||||
directory has been modified. With the new method, only the
|
||||
library path defined in the file named .paths in the directory
|
||||
@@ -2437,7 +2441,7 @@
|
||||
long integers to floating point variables has been fixed.
|
||||
01-06-18 A bug in the handling of unsigned integers (typeset -ui) has
|
||||
been fixed.
|
||||
01-06-04 The evaluation of the PS1 prompt no longer effects the value
|
||||
01-06-04 The evaluation of the PS1 prompt no longer affects the value
|
||||
of the $? variable.
|
||||
01-06-01 A small memory leak from subshells has been fixed.
|
||||
01-05-22 A bug in which attributes for variables that did not have
|
||||
@@ -2505,13 +2509,13 @@
|
||||
command and copies the remainder so that it can be used
|
||||
for standard input.
|
||||
01-04-30 +The shcomp command was modified so that it can work in an
|
||||
EBCIDIC environment and that binary scripts are portable
|
||||
EBCDIC environment and that binary scripts are portable
|
||||
across environments.
|
||||
01-04-30 A bug in the handling of a trailing : in PATH has been fixed.
|
||||
01-04-30 A bug in which the builtin version of a command would get invoked
|
||||
even though the full pathname for the command was specified
|
||||
has been fixed.
|
||||
01-04-30 A bug in which read would loose the last character when
|
||||
01-04-30 A bug in which read would lose the last character when
|
||||
reading the last line of a file that did not contain a new-line
|
||||
character has been fixed.
|
||||
01-04-23 A bug on some systems in which in vi mode the end of file
|
||||
@@ -2625,7 +2629,7 @@
|
||||
checking name to see if it was a name reference has been fixed.
|
||||
00-09-26 A bug in the multibyte version in which the width of for
|
||||
non-printing characters was not correct has been fixed.
|
||||
00-09-12 +Made changes to get multibyte editing work on UWIN for windows
|
||||
00-09-12 +Made changes to get multibyte editing work on UWIN for Windows.
|
||||
00-09-12 A bug in which multibyte characters would be displayed incorrectly
|
||||
has been fixed.
|
||||
00-08-08 Removed build dependency on iswprint() and iswalph().
|
||||
@@ -2639,7 +2643,7 @@
|
||||
jobs have completed has been fixed.
|
||||
00-06-21 A bug in which backspace did not work correctly during the
|
||||
R replace directive in vi-mode has been fixed.
|
||||
00-06-12 +Added variable name completion/expansion/listing to the set of
|
||||
00-06-12 +Added variable name completion/expansion/listing to the set of
|
||||
completions. Variable name completions begin with $ or "$ followed
|
||||
by a letter.
|
||||
00-05-09 --- Release ksh93j ---
|
||||
@@ -2660,7 +2664,7 @@
|
||||
00-03-30 +Code was modified in several places to support automatic
|
||||
generation of C locale dictionaries.
|
||||
00-03-28 A bug in which the set and trap commands invoked with --name
|
||||
type arguments would terminate the invoking script has
|
||||
type arguments would terminate the invoking script has
|
||||
been fixed.
|
||||
00-03-27 A bug in which the library path variable was not updated
|
||||
correctly on some systems as described in the 'g' point
|
||||
@@ -2703,7 +2707,7 @@
|
||||
99-03-31 +The TAB key can be used for completion in emacs and viraw mode.
|
||||
99-03-31 A bug in setting .sh.editchar during the KEYBD trap
|
||||
for the MULTIBYTE option was fixed in release ksh93h.
|
||||
99-03-31 A bug in shcomp for compilation of unary operators with [[...]]
|
||||
99-03-31 A bug in shcomp for compilation of unary operators with [[ ... ]]
|
||||
has been fixed.
|
||||
99-03-31 A bug in which the value of $? was changed when executing
|
||||
a keyboard trap has been fixed.
|
||||
@@ -2711,7 +2715,7 @@
|
||||
trap is not triggered while executing trap commands
|
||||
to avoid recursive trap calls.
|
||||
99-03-31 A bug in which a local variable in a function declared readonly
|
||||
would generated an error when the function went out of
|
||||
would generate an error when the function went out of
|
||||
scope has been fixed.
|
||||
99-03-31 A bug in which \<new_line> entered from the keyboard
|
||||
with the KEYBD trap enabled has been fixed.
|
||||
@@ -2754,7 +2758,7 @@
|
||||
the variable it references was the subject of a compound
|
||||
assignment has been fixed.
|
||||
98-04-30 A bug which in which assignment to array variables in
|
||||
a subshell could effect the parent shell has been
|
||||
a subshell could affect the parent shell has been
|
||||
fixed.
|
||||
98-04-30 read name?prompt was putting a 0 byte at the end of the
|
||||
prompt on standard error.
|
||||
@@ -2853,7 +2857,7 @@
|
||||
96-07-31 A bug in right to left arithmetic assignment for which
|
||||
the arithmetic expression (( y = x = 1.5 )) did not
|
||||
yield 1 for y when x was declared typeset -i was fixed.
|
||||
96-07-31 printf has been fixed to handle format containing \0
|
||||
96-07-31 printf has been fixed to handle format containing \0
|
||||
and/or \0145 correctly. In addition, characters following
|
||||
%b in the format string are no longer displayed when
|
||||
the operand contains \c.
|
||||
@@ -2861,7 +2865,7 @@
|
||||
produce unnormalized results has been fixed.
|
||||
96-07-31 A bug which causes some arithmetic expressions to be
|
||||
incorrectly evaluated as integer expressions rather
|
||||
that floating point has been fixed.
|
||||
than floating point has been fixed.
|
||||
96-07-31 Functions defined inside a subshell no longer remain
|
||||
defined when the subshell completes.
|
||||
96-07-31 The error message from sh -c ';echo foo' has been
|
||||
@@ -2871,7 +2875,7 @@
|
||||
96-07-31 A bug that caused side effects in subscript evaluation
|
||||
when tracing was enabled for subscripts using ++ or --
|
||||
has been fixed.
|
||||
96-07-31 To conform to the Posix standard getopts has been changed
|
||||
96-07-31 To conform to the POSIX standard getopts has been changed
|
||||
so that the option char is set to ? when it returns with
|
||||
a non-zero exit status.
|
||||
96-07-31 The handling of \} inside ${name...} has been fixed so
|
||||
@@ -2889,7 +2893,7 @@
|
||||
96-07-31 The error message for ksh -o unknown was incorrect.
|
||||
96-07-31 Functions invoked as name=value name, did not use
|
||||
values from the calling scope when evaluating value.
|
||||
96-07-31 A bug in which the shell would reexecute previously
|
||||
96-07-31 A bug in which the shell would re-execute previously
|
||||
executed code when a shell script or coprocess was
|
||||
run in the background has been fixed.
|
||||
96-07-31 A bug in which an empty here-document would leave
|
||||
@@ -3043,7 +3047,7 @@
|
||||
the job list as required by the POSIX standard.
|
||||
94-12-31 The value of OPTARG when an option that required
|
||||
an argument but didn't have one was incorrect in the
|
||||
case the the option string began with a :.
|
||||
case the option string began with a :.
|
||||
94-12-31 A bug which caused the terminal to get into a bad
|
||||
state with some KEYBD traps in vi-mode has been fixed.
|
||||
94-12-31 A bug which caused an invalid trap to cause a script
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
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 is a list of changes that have been made since the 11/16/88 version
|
||||
of ksh.
|
||||
|
||||
@@ -38,7 +42,7 @@ of ksh.
|
||||
6. ${@:expr1:expr2} expands to at most expr2 positional parameters
|
||||
starting at expr1.
|
||||
7. ${!name} expands to the name of the variable named by name.
|
||||
It will expand to name unless name is reference variable.
|
||||
It will expand to name unless name is a reference variable.
|
||||
8. ${!name[sub]} expands to the name of the subscript of the
|
||||
given variable. If sub is @ or * the list of subscripts
|
||||
is generated.
|
||||
@@ -54,7 +58,7 @@ of ksh.
|
||||
13. ${name/%pattern/string} Same as above but the pattern
|
||||
to be replaced must match at the end.
|
||||
14. ${name//pattern/string} expands to the value of name with
|
||||
the each occurrence of pattern replaced by string.
|
||||
each occurrence of pattern replaced by string.
|
||||
With aggregates (@ or *) this operation is applied to each.
|
||||
|
||||
d. The name space for variables has been extended. The character '.'
|
||||
@@ -62,7 +66,7 @@ of ksh.
|
||||
within a name. However, to create a name of the form, foo.bar,
|
||||
the variable foo must exist. The namespace starting with .sh
|
||||
is reserved for shell implementation variables. Exported
|
||||
variable cannot contain a '.'.
|
||||
variables cannot contain a '.'.
|
||||
|
||||
e. Compound assignments. The assignment syntax, varname=value,
|
||||
has been extended to allow assignments of the form
|
||||
@@ -103,7 +107,7 @@ of ksh.
|
||||
|
||||
h. On systems that support dynamic loading with dlopen(), it is
|
||||
now possible to add built-in commands at runtime with the
|
||||
a builtin command named builtin.
|
||||
builtin command named 'builtin'.
|
||||
|
||||
i. The following builtins have been added:
|
||||
1. command name [ ... ]
|
||||
@@ -114,9 +118,9 @@ of ksh.
|
||||
|
||||
j. An addition format for literal strings, $'....' can
|
||||
be used where ever literal strings are valid. The string
|
||||
inside the single quotes will be converted using the ANSI-C
|
||||
inside the single quotes will be converted using the ANSI C
|
||||
escape conventions. Additionally, the escape sequence \E
|
||||
expands to the escape character (default \033) whenever ANSI-C
|
||||
expands to the escape character (default \033) whenever ANSI C
|
||||
escape sequences are recognized.
|
||||
|
||||
k. A typeset -n option has been added which causes the value of a
|
||||
@@ -182,7 +186,7 @@ of ksh.
|
||||
that the string needs translation but is otherwise ignored.
|
||||
This means that if a message catalog of all $"..." strings
|
||||
is generated, then a program such as print $"hello world"
|
||||
could display "bonjour monde" in the french locale.
|
||||
could display "bonjour monde" in the French locale.
|
||||
q. Backreferences have been added to pattern matching. The sequence
|
||||
\d, where d is a digit from 1-9, matches the same string as
|
||||
the d-th previous parenthesis group. Backreferences
|
||||
@@ -202,7 +206,7 @@ of ksh.
|
||||
characters are quoted in a manner that then can be re-input.
|
||||
4. The trace output puts quotes around the output so that it
|
||||
can be reused as input.
|
||||
5. The output for trap is in a format that can be reinput the
|
||||
5. The output for trap is in a format that can be reinput to
|
||||
the shell to restore the traps.
|
||||
6. kill -l lists the signal names without numbers as
|
||||
required by the POSIX standard.
|
||||
@@ -258,7 +262,7 @@ of ksh.
|
||||
2. The -C option is equivalent to -o noclobber. Files are
|
||||
created with O_EXCL when -C is on.
|
||||
|
||||
h. The following changes have been made to [[...]]:
|
||||
h. The following changes have been made to [[ ... ]]:
|
||||
1. A string by itself is equivalent to -n string.
|
||||
2. -e has been added as equivalent to -a.
|
||||
3. == has been added as equivalent =.
|
||||
@@ -286,7 +290,7 @@ of ksh.
|
||||
corresponds to the give extended regular expression.
|
||||
6. For numerical fields, the arguments can be arithmetic
|
||||
expressions which will be evaluated.
|
||||
7. The %n format works as described in ANSI-C.
|
||||
7. The %n format works as described in ANSI C.
|
||||
|
||||
k. The following changes have been made to fc:
|
||||
1. It has been renamed hist. fc is now a predefined alias.
|
||||
@@ -395,7 +399,7 @@ of ksh.
|
||||
the FEATURE mechanism of nmake. Other options are set
|
||||
in the OPTIONS file.
|
||||
|
||||
c. The are several new compile time options. See the README
|
||||
c. There are several new compile time options. See the README
|
||||
file for details. Some of the old ones have been removed.
|
||||
|
||||
d. The install script is a Mamfile that is generated by
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
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 is a list of changes that have been made since the 12/28/93 version
|
||||
of ksh.
|
||||
|
||||
@@ -131,7 +135,7 @@ of ksh.
|
||||
the job list as required by the POSIX standard.
|
||||
l. The value of OPTARG when an option that required
|
||||
an argument but didn't have one was incorrect in the
|
||||
case the the option string began with a :.
|
||||
case the option string began with a :.
|
||||
m. A bug which caused the terminal to get into a bad
|
||||
state with some KEYBD traps in vi-mode has been fixed.
|
||||
n. A bug which caused an invalid trap to cause a script
|
||||
@@ -229,7 +233,7 @@ of ksh.
|
||||
c. A bug in right to left arithmetic assignment for which
|
||||
the arithmetic expression (( y = x = 1.5 )) did not
|
||||
yield 1 for y when x was declared typeset -i was fixed.
|
||||
d. printf has been fixed to handle format containing \0
|
||||
d. printf has been fixed to handle format containing \0
|
||||
and/or \0145 correctly. In addition, characters following
|
||||
%b in the format string are no longer displayed when
|
||||
the operand contains \c.
|
||||
@@ -265,7 +269,7 @@ of ksh.
|
||||
r. The error message for ksh -o unknown was incorrect.
|
||||
s. Functions invoked as name=value name, did not use
|
||||
values from the calling scope when evaluating value.
|
||||
t. A bug in which the shell would reexecute previously
|
||||
t. A bug in which the shell would re-execute previously
|
||||
executed code when a shell script or coprocess was
|
||||
run in the background has been fixed.
|
||||
u. A bug in which an empty here-document would leave
|
||||
@@ -359,7 +363,7 @@ of ksh.
|
||||
were split across buffer boundaries has been fixed.
|
||||
|
||||
14. Bugs fixed in 12/28/93h for default OPTIONS
|
||||
a. I bug in shcomp for compilation of unary operators with [[...]]
|
||||
a. I bug in shcomp for compilation of unary operators with [[ ... ]]
|
||||
has been fixed.
|
||||
b. A bug in which the value of $? was changed when executing
|
||||
a keyboard trap has been fixed.
|
||||
@@ -452,4 +456,3 @@ of ksh.
|
||||
|
||||
18. Incompatibilities with 12/28/93 version.
|
||||
None intentional.
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
# Compile-time SHOPT_* options for ksh93.
|
||||
# 1 to enable, 0 to disable, empty value to probe.
|
||||
#
|
||||
# For a more complete description of the options, see src/cmd/ksh93/README.
|
||||
#
|
||||
|
||||
SHOPT 2DMATCH=1 # two dimensional ${.sh.match} for ${var//pat/str}
|
||||
SHOPT ACCT= # accounting
|
||||
@@ -13,28 +15,32 @@ SHOPT BRACEPAT=1 # C-shell {...,...} expansions (, required)
|
||||
SHOPT CMDLIB_HDR= # '<cmdlist.h>' # custom -lcmd list for path-bound builtins
|
||||
SHOPT CMDLIB_DIR= # '\"/opt/ast/bin\"' # virtual directory prefix for path-bound builtins
|
||||
SHOPT CRNL= # accept MS Windows newlines (<cr><nl>) for <nl>
|
||||
SHOPT DEVFD= # use /dev/fd instead of FIFOs for process substitutions
|
||||
SHOPT DYNAMIC=1 # dynamic loading for builtins
|
||||
SHOPT ECHOPRINT= # make echo equivalent to print
|
||||
SHOPT EDPREDICT=1 # predictive editing
|
||||
SHOPT EDPREDICT=0 # History pattern search menu (type #<pattern>, then ESC <number> TAB). Experimental.
|
||||
SHOPT ESH=1 # emacs/gmacs edit mode
|
||||
SHOPT FILESCAN=1 # fast file scan
|
||||
SHOPT FIXEDARRAY=1 # fixed dimension indexed array
|
||||
SHOPT GLOBCASEDET= # -o globcasedetect: adapt globbing/completion to case-insensitive file systems
|
||||
SHOPT HISTEXPAND=1 # csh-style history file expansions
|
||||
SHOPT KIA= # ksh -R <outfile> <script> generates cross-ref database from script
|
||||
SHOPT MKSERVICE=0 # enable the mkservice and eloop builtins
|
||||
SHOPT MULTIBYTE=1 # multibyte character handling
|
||||
SHOPT NAMESPACE=1 # allow namespaces
|
||||
SHOPT NOECHOE=0 # turn off 'echo -e' when SHOPT_ECHOPRINT is disabled
|
||||
SHOPT OLDTERMIO= # support both TCGETA and TCGETS
|
||||
SHOPT OPTIMIZE=1 # optimize loop invariants
|
||||
SHOPT PFSH=0 # solaris exec_attr(4) profile execution (obsolete)
|
||||
SHOPT P_SUID= # real uid's that require -p for set[ug]id
|
||||
SHOPT PFSH=0 # Solaris exec_attr(4) profile execution (obsolete)
|
||||
SHOPT P_SUID= # real uids that require -p for set[ug]id (do not set to 0 to turn off)
|
||||
SHOPT RAWONLY=1 # make viraw the only vi mode
|
||||
SHOPT REGRESS= # enable __regress__ builtin and instrumented intercepts for testing
|
||||
SHOPT REMOTE= # enable --rc if running as a remote shell
|
||||
SHOPT SEVENBIT= # strip the eighth bit from characters
|
||||
SHOPT SPAWN= # use spawnveg for fork/exec
|
||||
SHOPT STATS=1 # add .sh.stats variable
|
||||
SHOPT SUID_EXEC=1 # allow (safe) suid/sgid shell scripts
|
||||
SHOPT SYSRC= # attempt . /etc/ksh.kshrc if interactive
|
||||
SHOPT TEST_L= # add 'test -l' as an alias for 'test -L'
|
||||
SHOPT TIMEOUT= # number of seconds for shell timeout
|
||||
SHOPT TYPEDEF=1 # enable typeset type definitions
|
||||
SHOPT VSH=1 # vi edit mode
|
||||
|
||||
@@ -9,7 +9,7 @@ typeset -T option to the shell. The method for defining types via
|
||||
a shared library is not described here. However, the source file
|
||||
bltins/enum.c is an example of a builtin that creates enumeration types.
|
||||
|
||||
By convention, typenames begin with a capitol letter and end in _t.
|
||||
By convention, typenames begin with a capital letter and end in _t.
|
||||
To define a type, use
|
||||
typeset -T Type_t=(
|
||||
definition
|
||||
@@ -17,7 +17,7 @@ To define a type, use
|
||||
where definition contains assignment commands, declaration commands,
|
||||
and function definitions. A declaration command (for example typeset,
|
||||
readonly, and export), is a built-in that differs from other builtins in
|
||||
that tilde substitution is performed on arguments after an =, assignments
|
||||
that tilde expansion is performed on arguments after an =, assignments
|
||||
do not have to precede the command name, and field splitting and pathname
|
||||
expansion is not performed on the arguments.
|
||||
For example,
|
||||
@@ -60,7 +60,7 @@ When a type is defined, a declaration built-in command by this name
|
||||
is added to ksh. As with other shell builtins, you can get the man page
|
||||
for this newly added command by invoking Pt_t --man. The information from
|
||||
the -h options will be embedded in this man page. Any functions that
|
||||
use getopts to process arguments will be cross referenced on the generated
|
||||
use getopts to process arguments will be cross-referenced on the generated
|
||||
man page.
|
||||
|
||||
Since Pt_t is now a declaration command it can be used in the definition
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1982-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
@@ -17,7 +18,6 @@
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* alarm [-r] [varname [+]when]
|
||||
*
|
||||
@@ -256,25 +256,30 @@ int b_alarm(int argc,char *argv[],Shbltin_t *context)
|
||||
break;
|
||||
case '?':
|
||||
errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg);
|
||||
break;
|
||||
UNREACHABLE();
|
||||
}
|
||||
argc -= opt_info.index;
|
||||
argv += opt_info.index;
|
||||
if(error_info.errors)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_usage(2),optusage((char*)0));
|
||||
UNREACHABLE();
|
||||
}
|
||||
if(argc==0)
|
||||
{
|
||||
print_alarms(shp->st.timetrap);
|
||||
return(0);
|
||||
}
|
||||
if(argc!=2)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_usage(2),optusage((char*)0));
|
||||
UNREACHABLE();
|
||||
}
|
||||
np = nv_open(argv[0],shp->var_tree,NV_NOARRAY|NV_VARNAME|NV_NOASSIGN);
|
||||
if(!nv_isnull(np))
|
||||
nv_unset(np);
|
||||
nv_setattr(np, NV_DOUBLE);
|
||||
if(!(tp = newof(NIL(struct tevent*),struct tevent,1,0)))
|
||||
errormsg(SH_DICT,ERROR_exit(1),e_nospace);
|
||||
tp = sh_newof(NIL(struct tevent*),struct tevent,1,0);
|
||||
tp->fun.disc = &alarmdisc;
|
||||
tp->flags = rflag;
|
||||
tp->node = np;
|
||||
@@ -283,4 +288,3 @@ int b_alarm(int argc,char *argv[],Shbltin_t *context)
|
||||
nv_putval(np, argv[1], 0);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1982-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
@@ -17,10 +18,9 @@
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* cd [-LP] [dirname]
|
||||
* cd [-LP] [old] [new]
|
||||
* cd [-L] [-Pe] [dirname]
|
||||
* cd [-L] [-Pe] [old] [new]
|
||||
* pwd [-LP]
|
||||
*
|
||||
* David Korn
|
||||
@@ -56,34 +56,58 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
||||
register const char *dp;
|
||||
register Shell_t *shp = context->shp;
|
||||
int saverrno=0;
|
||||
int rval,flag=0;
|
||||
int rval,pflag=0,eflag=0,ret=1;
|
||||
char *oldpwd;
|
||||
Namval_t *opwdnod, *pwdnod;
|
||||
if(sh_isoption(SH_RESTRICTED))
|
||||
errormsg(SH_DICT,ERROR_exit(1),e_restricted+4);
|
||||
while((rval = optget(argv,sh_optcd))) switch(rval)
|
||||
{
|
||||
case 'e':
|
||||
eflag = 1;
|
||||
break;
|
||||
case 'L':
|
||||
flag = 0;
|
||||
pflag = 0;
|
||||
break;
|
||||
case 'P':
|
||||
flag = 1;
|
||||
pflag = 1;
|
||||
break;
|
||||
case ':':
|
||||
if(sh_isoption(SH_RESTRICTED))
|
||||
break;
|
||||
errormsg(SH_DICT,2, "%s", opt_info.arg);
|
||||
break;
|
||||
case '?':
|
||||
if(sh_isoption(SH_RESTRICTED))
|
||||
break;
|
||||
errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg);
|
||||
break;
|
||||
UNREACHABLE();
|
||||
}
|
||||
if(pflag && eflag)
|
||||
ret = 2; /* exit status is 2 if -eP are both on and chdir failed */
|
||||
if(sh_isoption(SH_RESTRICTED))
|
||||
{
|
||||
/* restricted shells cannot change the directory */
|
||||
errormsg(SH_DICT,ERROR_exit(ret),e_restricted+4);
|
||||
UNREACHABLE();
|
||||
}
|
||||
argv += opt_info.index;
|
||||
argc -= opt_info.index;
|
||||
dir = argv[0];
|
||||
if(error_info.errors>0 || argc >2)
|
||||
if(error_info.errors>0 || argc>2)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
|
||||
UNREACHABLE();
|
||||
}
|
||||
oldpwd = path_pwd(shp,0);
|
||||
opwdnod = (shp->subshell?sh_assignok(OLDPWDNOD,1):OLDPWDNOD);
|
||||
pwdnod = (shp->subshell?sh_assignok(PWDNOD,1):PWDNOD);
|
||||
opwdnod = sh_scoped(shp,OLDPWDNOD);
|
||||
pwdnod = sh_scoped(shp,PWDNOD);
|
||||
if(oldpwd == e_dot && pwdnod->nvalue.cp)
|
||||
oldpwd = (char*)pwdnod->nvalue.cp; /* if path_pwd() failed to get the pwd, use $PWD */
|
||||
if(shp->subshell)
|
||||
{
|
||||
/* clone $OLDPWD and $PWD into the subshell's scope */
|
||||
opwdnod = sh_assignok(opwdnod,1);
|
||||
pwdnod = sh_assignok(pwdnod,1);
|
||||
}
|
||||
if(argc==2)
|
||||
dir = sh_substitute(oldpwd,dir,argv[1]);
|
||||
else if(!dir)
|
||||
@@ -91,7 +115,10 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
||||
else if(*dir == '-' && dir[1]==0)
|
||||
dir = nv_getval(opwdnod);
|
||||
if(!dir || *dir==0)
|
||||
errormsg(SH_DICT,ERROR_exit(1),argc==2?e_subst+4:e_direct);
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_exit(ret),argc==2?e_subst+4:e_direct);
|
||||
UNREACHABLE();
|
||||
}
|
||||
/*
|
||||
* If sh_subshell() in subshell.c cannot use fchdir(2) to restore the PWD using a saved file descriptor,
|
||||
* we must fork any virtual subshell now to avoid the possibility of ending up in the wrong PWD on exit.
|
||||
@@ -113,7 +140,7 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
||||
&& !(dir[0]=='.' && (dir[1]=='/' || dir[1]==0))
|
||||
&& !(dir[0]=='.' && dir[1]=='.' && (dir[2]=='/' || dir[2]==0)))
|
||||
{
|
||||
if(!(cdpath = (Pathcomp_t*)shp->cdpathlist) && (dp=sh_scoped(shp,CDPNOD)->nvalue.cp))
|
||||
if((dp=sh_scoped(&sh,CDPNOD)->nvalue.cp) && !(cdpath = (Pathcomp_t*)shp->cdpathlist))
|
||||
{
|
||||
if(cdpath=path_addpath(shp,(Pathcomp_t*)0,dp,PATH_CDPATH))
|
||||
{
|
||||
@@ -121,8 +148,6 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
||||
cdpath->shp = shp;
|
||||
}
|
||||
}
|
||||
if(!oldpwd)
|
||||
oldpwd = path_pwd(shp,1);
|
||||
}
|
||||
if(*dir!='/')
|
||||
{
|
||||
@@ -164,7 +189,7 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
||||
stakputs(last+PATH_OFFSET);
|
||||
stakputc(0);
|
||||
}
|
||||
if(!flag)
|
||||
if(!pflag)
|
||||
{
|
||||
register char *cp;
|
||||
stakseek(PATH_MAX+PATH_OFFSET);
|
||||
@@ -185,39 +210,61 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
||||
{
|
||||
if(saverrno)
|
||||
errno = saverrno;
|
||||
errormsg(SH_DICT,ERROR_system(1),"%s:",dir);
|
||||
errormsg(SH_DICT,ERROR_system(ret),"%s:",dir);
|
||||
UNREACHABLE();
|
||||
}
|
||||
success:
|
||||
if(dir == nv_getval(opwdnod) || argc==2)
|
||||
dp = dir; /* print out directory for cd - */
|
||||
if(flag)
|
||||
if(pflag)
|
||||
{
|
||||
dir = stakptr(PATH_OFFSET);
|
||||
if (!(dir=pathcanon(dir,PATH_PHYSICAL)))
|
||||
{
|
||||
dir = stakptr(PATH_OFFSET);
|
||||
errormsg(SH_DICT,ERROR_system(1),"%s:",dir);
|
||||
errormsg(SH_DICT,ERROR_system(ret),"%s:",dir);
|
||||
UNREACHABLE();
|
||||
}
|
||||
stakseek(dir-stakptr(0));
|
||||
}
|
||||
dir = (char*)stakfreeze(1)+PATH_OFFSET;
|
||||
if(*dp && (*dp!='.'||dp[1]) && strchr(dir,'/'))
|
||||
sfputr(sfstdout,dir,'\n');
|
||||
if(*dir != '/')
|
||||
return(0);
|
||||
nv_putval(opwdnod,oldpwd,NV_RDONLY);
|
||||
flag = strlen(dir);
|
||||
/* delete trailing '/' */
|
||||
while(--flag>0 && dir[flag]=='/')
|
||||
dir[flag] = 0;
|
||||
nv_putval(pwdnod,dir,NV_RDONLY);
|
||||
nv_onattr(pwdnod,NV_NOFREE|NV_EXPORT);
|
||||
shp->pwd = pwdnod->nvalue.cp;
|
||||
if(*dir == '/')
|
||||
{
|
||||
size_t len = strlen(dir);
|
||||
/* delete trailing '/' */
|
||||
while(--len>0 && dir[len]=='/')
|
||||
dir[len] = 0;
|
||||
nv_putval(pwdnod,dir,NV_RDONLY);
|
||||
nv_onattr(pwdnod,NV_EXPORT);
|
||||
if(shp->pwd)
|
||||
free((void*)shp->pwd);
|
||||
shp->pwd = sh_strdup(pwdnod->nvalue.cp);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* pathcanon() failed to canonicalize the directory, which happens when 'cd' is invoked from a
|
||||
nonexistent PWD with a relative path as the argument. Reinitialize $PWD as it will be wrong. */
|
||||
if(shp->pwd)
|
||||
free((void*)shp->pwd);
|
||||
shp->pwd = NIL(const char*);
|
||||
path_pwd(shp,0);
|
||||
if(*shp->pwd != '/')
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_system(ret),e_direct);
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
nv_scan(sh_subtracktree(1),rehash,(void*)0,NV_TAGGED,NV_TAGGED);
|
||||
path_newdir(shp,shp->pathlist);
|
||||
path_newdir(shp,shp->cdpathlist);
|
||||
if(oldpwd && oldpwd!=e_dot)
|
||||
free(oldpwd);
|
||||
if(pflag && eflag)
|
||||
{
|
||||
/* Verify the current working directory matches $PWD */
|
||||
return(!test_inode(e_dot,nv_getval(pwdnod)));
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -240,12 +287,18 @@ int b_pwd(int argc, char *argv[],Shbltin_t *context)
|
||||
break;
|
||||
case '?':
|
||||
errormsg(SH_DICT,ERROR_usage(2), "%s", opt_info.arg);
|
||||
break;
|
||||
UNREACHABLE();
|
||||
}
|
||||
if(error_info.errors)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
|
||||
UNREACHABLE();
|
||||
}
|
||||
if(*(cp = path_pwd(shp,0)) != '/')
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_system(1), e_pwd);
|
||||
UNREACHABLE();
|
||||
}
|
||||
if(flag)
|
||||
{
|
||||
cp = strcpy(stakseek(strlen(cp)+PATH_MAX),cp);
|
||||
@@ -254,4 +307,3 @@ int b_pwd(int argc, char *argv[],Shbltin_t *context)
|
||||
sfputr(sfstdout,cp,'\n');
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* *
|
||||
* This software is part of the ast package *
|
||||
* Copyright (c) 1982-2012 AT&T Intellectual Property *
|
||||
* Copyright (c) 2020-2021 Contributors to ksh 93u+m *
|
||||
* and is licensed under the *
|
||||
* Eclipse Public License, Version 1.0 *
|
||||
* by AT&T Intellectual Property *
|
||||
@@ -17,7 +18,6 @@
|
||||
* David Korn <dgk@research.att.com> *
|
||||
* *
|
||||
***********************************************************************/
|
||||
#pragma prototyped
|
||||
/*
|
||||
* break [n]
|
||||
* continue [n]
|
||||
@@ -45,11 +45,10 @@
|
||||
#endif
|
||||
int b_return(register int n, register char *argv[],Shbltin_t *context)
|
||||
{
|
||||
register char *arg;
|
||||
register Shell_t *shp = context->shp;
|
||||
struct checkpt *pp = (struct checkpt*)shp->jmplist;
|
||||
const char *options = (**argv=='r'?sh_optreturn:sh_optexit);
|
||||
while((n = optget(argv,options))) switch(n)
|
||||
/* 'return' outside of function, dotscript and profile behaves like 'exit' */
|
||||
char do_exit = **argv=='e' || sh.fn_depth==0 && sh.dot_depth==0 && !sh_isstate(SH_PROFILE);
|
||||
NOT_USED(context);
|
||||
while((n = optget(argv, **argv=='e' ? sh_optexit : sh_optreturn))) switch(n)
|
||||
{
|
||||
case ':':
|
||||
if(!strmatch(argv[opt_info.index],"[+-]+([0-9])"))
|
||||
@@ -61,18 +60,31 @@ int b_return(register int n, register char *argv[],Shbltin_t *context)
|
||||
}
|
||||
done:
|
||||
if(error_info.errors)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
|
||||
pp->mode = (**argv=='e'?SH_JMPEXIT:SH_JMPFUN);
|
||||
UNREACHABLE();
|
||||
}
|
||||
argv += opt_info.index;
|
||||
n = (arg = *argv) ? (int)strtol(arg, (char**)0, 10) : shp->savexit;
|
||||
if(n<0 || n==256 || n > SH_EXITMASK+shp->gd->sigmax+1)
|
||||
n &= ((unsigned int)n)&SH_EXITMASK;
|
||||
/* return outside of function, dotscript and profile is exit */
|
||||
if(shp->fn_depth==0 && shp->dot_depth==0 && !sh_isstate(SH_PROFILE))
|
||||
pp->mode = SH_JMPEXIT;
|
||||
shp->savexit = n;
|
||||
sh_exit((pp->mode == SH_JMPEXIT) ? (n & SH_EXITMASK) : n);
|
||||
return(1);
|
||||
if(*argv)
|
||||
{
|
||||
long l = strtol(*argv, NIL(char**), 10);
|
||||
if(do_exit)
|
||||
n = (int)(l & SH_EXITMASK); /* exit: apply bitmask before conversion to avoid undefined int overflow */
|
||||
else if((long)(n = (int)l) != l) /* return: convert to int and check for overflow (should be safe enough) */
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_warn(0),"%s: out of range",*argv);
|
||||
n = 128; /* overflow is undefined, so use a consistent status for this */
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
n = sh.savexit; /* no argument: pass down $? */
|
||||
if(do_exit)
|
||||
n &= SH_EXITMASK;
|
||||
}
|
||||
((struct checkpt*)sh.jmplist)->mode = do_exit ? SH_JMPEXIT : SH_JMPFUN;
|
||||
sh_exit(sh.savexit = n);
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
|
||||
@@ -98,14 +110,20 @@ int b_break(register int n, register char *argv[],Shbltin_t *context)
|
||||
return(2);
|
||||
}
|
||||
if(error_info.errors)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
|
||||
UNREACHABLE();
|
||||
}
|
||||
argv += opt_info.index;
|
||||
n=1;
|
||||
if(arg= *argv)
|
||||
{
|
||||
n = (int)strtol(arg,&arg,10);
|
||||
if(n<=0 || *arg)
|
||||
{
|
||||
errormsg(SH_DICT,ERROR_exit(1),e_nolabels,*argv);
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
if(shp->st.loopcnt)
|
||||
{
|
||||
@@ -117,4 +135,3 @@ int b_break(register int n, register char *argv[],Shbltin_t *context)
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user