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

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:
Martijn Dekker 2022-01-02 14:34:46 +01:00 committed by Jon Trulson
parent d5e651ecf3
commit bf00d3b274
1179 changed files with 22005 additions and 45914 deletions

View file

@ -55,20 +55,28 @@ dtksh_SOURCES = init.c \
extra.c \
msgs.c
init.c:
cd ksh93; ./bin/package flat make CCFLAGS='$(SUIDEXECDEFINES) -g -D_std_malloc'
cp ./ksh93/src/cmd/ksh93/sh/init.c init.c
$(PATCH) --posix init.c -i init.patch
./setup.sh
ksh93/bin/ksh:
ksh93/bin/package flat make CCFLAGS='$(CFLAGS) $(SUIDEXECDEFINES)'
init.c: ksh93/bin/ksh
$(CP) ksh93/src/cmd/ksh93/sh/init.c ./
pmain.o: ksh93/bin/ksh
$(CP) ksh93/src/cmd/ksh93/pmain.o ./
FEATURE: ksh93/bin/ksh
$(CP) -R ksh93/src/cmd/ksh93/FEATURE ./
libshell.a: $(KSH93SLIBSHELL) dtksh-init.o
$(CP) $(KSH93LIBSHELL) libshell.a; \
$(AR) d libshell.a init.o; \
$(AR) cq libshell.a dtksh-init.o
check-local:
./dtksh -c true && ksh93/bin/shtests --posix --utf8 SHELL=.libs/lt-dtksh
clean-local:
cd ksh93 && ./bin/package flat clean
ksh93/bin/package clean
DtFuncs.dtsh:
$(CP) DtFuncs.sh DtFuncs.dtsh

View file

@ -50,7 +50,7 @@
#define CONVERT_POSTPONED 0
#define CONVERT_FAILED -1
#define ADDBUILTIN(a,b) sh_addbuiltin(a, ((int (*)__PROTO__((int, char*[], Shbltin_t*)))b), (void*) 0)
#define ADDBUILTIN(a,b) sh_addbuiltin(a, ((int (*)(int, char*[], Shbltin_t*))b), (void*) 0)
extern Widget Toplevel;
extern char str_nill[];

View file

@ -1,47 +0,0 @@
--- ./ksh93/src/cmd/ksh93/sh/init.c 2021-01-16 15:27:03.589079734 -0600
+++ init.c 2021-01-16 15:53:50.700864511 -0600
@@ -48,6 +48,28 @@
#include "lexstates.h"
#include "version.h"
+#ifdef BUILD_DTKSH
+#include <Dt/DtNlUtils.h>
+#include <Dt/EnvControlP.h>
+#include <X11/X.h>
+#include <X11/Intrinsic.h>
+#include <X11/IntrinsicP.h>
+#include <X11/CoreP.h>
+#include <X11/StringDefs.h>
+#include <Xm/XmStrDefs.h>
+#include <Xm/Xm.h>
+#include <Xm/Protocols.h>
+
+#include "dtksh.h"
+#include "xmksh.h"
+#include "dtkcmds.h"
+#include "xmcvt.h"
+#include "widget.h"
+#include "extra.h"
+#include "xmwidgets.h"
+#include "msgs.h"
+#endif
+
#if _hdr_wctype
#include <ast_wchar.h>
#include <wctype.h>
@@ -1481,6 +1503,16 @@
shp->exittrap = 0;
shp->errtrap = 0;
shp->end_fn = 0;
+#ifdef BUILD_DTKSH
+ int * lockedFds = LockKshFileDescriptors();
+ (void) XtSetLanguageProc((XtAppContext)NULL, (XtLanguageProc)NULL,
+ (XtPointer)NULL);
+ DtNlInitialize();
+ _DtEnvControl(DT_ENV_SET);
+ UnlockKshFileDescriptors(lockedFds);
+
+ dtksh_init();
+#endif
return(shp);
}

View file

@ -14,6 +14,19 @@ jobs:
run: bin/package make
- name: Regression tests
run: |
PS4="$PS4[ci.yml] "
set -o xtrace
export TZ=UTC
ulimit -n 1024
: default regression tests &&
script -q -e -c "bin/shtests" &&
: regression tests with OS-provided multibyte locales &&
LANG=nl_NL.UTF-8 script -q -e -c "bin/shtests --locale --nocompile" &&
LANG=ja_JP.SJIS script -q -e -c "bin/shtests --locale --nocompile" &&
: disable most SHOPTs, rebuild ksh &&
sed --regexp-extended --in-place=.orig \
'/^SHOPT (2DMATCH|AUDIT|BGX|BRACEPAT|DEVFD|DYNAMIC|EDPREDICT|ESH|FIXEDARRAY|HISTEXPAND|MULTIBYTE|NAMESPACE|OPTIMIZE|STATS|SUID_EXEC|VSH)=/ s/=1?/=0/' \
src/cmd/ksh93/SHOPT.sh &&
bin/package make &&
: default regression tests with SHOPTs disabled &&
script -q -e -c "bin/shtests"

View file

@ -5,44 +5,25 @@ lcl
# Flat make libs, binaries, etc
/bin/.paths
/bin/ar
/bin/cc
/bin/crossexec
/bin/ditto
/bin/execrate
/bin/filter
/bin/hurl
/bin/iffe
/bin/ksh
/bin/mamake
/bin/mktest
/bin/ok/
/bin/proto
/bin/mktest
/bin/pty
/bin/ratz
/bin/regress
/bin/release
/bin/rt
/bin/shcomp
/bin/suid_exec
/fun/
/include/
/lib/file/
/lib/lib/
/lib/libast.a
/lib/libcmd.a
/lib/libdll.a
/lib/libshell.a
/lib/libsum.a
/lib/make/
/lib/package/gen/
/lib/probe/
/lib/*.a
/man/
# This one keeps changing its license header, causing git to show an
# uncommitted file. It's always re-copied anyway, and not for direct
# invocation, so exclude. The source file is: src/cmd/INIT/execrate.sh
bin/execrate
# Miscellaneous artefacts
*.bak
*.sav
@ -58,3 +39,4 @@ bin/execrate
*.core
core
**/#*#
tags

View file

@ -0,0 +1,249 @@
Announcing: KornShell 93u+m 1.0.0-beta.2
https://github.com/ksh93/ksh
In May 2020, when every KornShell (ksh93) development project was
abandoned, development was rebooted in a new fork based on the last
stable AT&T version: ksh 93u+. This new fork is called ksh 93u+m as a
permanent nod to its origin. We're restarting it at version 1.0. Seven
months after the first beta, the second one is ready. Please test this
second beta and report any bugs you find, or help us fix known bugs.
We're now the default ksh93 in some OS distributions, at least Debian
and Slackware! Even though we don't think it's stable release quality
yet, the consensus seems to be that 93u+m is already much better than
the last AT&T release.
Main developers: Martijn Dekker, Johnothan King, hyenias
Contributors: Andy Fiddaman, Anuradha Weeraman, Chase, Gordon Woodhull,
Govind Kamat, Harald van Dijk, Lev Kujawski, Marc Wilson, Ryan Schmidt,
Sterling Jensen
HOW TO GET IT
Please download the source code tarball from our GitHub releases page:
https://github.com/ksh93/ksh/releases
To build, follow the instructions in README.md or src/cmd/ksh93/README.
HOW TO GET INVOLVED
To report a bug, please open an issue at our GitHub page (see above).
Alternatively, email me at martijn@inlv.org with your report.
To get involved in development, read the brief policy information in
README.md and then jump right in with a pull request or email a patch.
See the TODO file in the top-level directory for a to-do list.
### MAIN CHANGES between 1.0.0-beta.2 and 1.0.0-(unreleased) ###
New features in built-in commands:
- Two bash-like flags for 'whence' were backported from ksh 93v-:
- 'whence -P/type -P' is an alias to the existing -p flag.
- 'whence -t/type -t' will print only the type of a command in a simple
format that is designed to be easy to use for scripts. Example:
$ type -t typeset; whence -t sh
builtin
file
- Added three options to the ulimit builtin with the same names and
functionality as in Bash:
- 'ulimit -k' sets the maximum number of kqueues.
- 'ulimit -P' sets the maximum number of pseudo-terminals.
- 'ulimit -R' sets the maximum time in microseconds a real-time process
can run before blocking.
Note that to use these options the operating system must support the
corresponding resource limit.
### MAIN CHANGES between 1.0.0-beta.1 and 1.0.0-beta.2 ###
New features in built-in commands:
- 'cd' now supports an -e option that, when combined with -P, verifies
that $PWD is correct after changing directories; this helps detect
access permission problems. See:
https://www.austingroupbugs.net/view.php?id=253
- 'printf' now supports a -v option as in bash. This assigns formatted
output directly to variables, which is very fast and will not strip
final newline (\n) characters.
- The 'return' command, when used to return from a function, can now
return any status value in the 32-bit signed integer range, like on
zsh. However, due to a traditional Unix kernel limitation, $? is
still trimmed to its least significant 8 bits whenever leaving a
(sub)shell environment.
- 'test'/'[' now supports all the same operators as [[ (including =~,
\<, \>) except for the different 'and'/'or' operators. Note that
'test'/'[' remains deprecated due to its unfixable pitfalls;
[[ ... ]] is recommended instead.
Shell language changes:
- Several improvements were made to the --noexec shell code linter.
- Arithmetic expressions in native ksh mode no longer interpret a
number with a leading zero as octal in any context. Use 8#octalnumber
instead (e.g. 8#400 == 256). Arithmetic expressions now also behave
identically within and outside ((...)) and $((...)).
- POSIX compatibility mode fixes (only applicable with the --posix shell
option on):
- A leading zero is now consistently recognised as introducing an octal
number in all arithmetic contexts.
- $((inf)) and $((nan)) are now interpreted as regular variables.
- The '.' built-in no longer runs ksh functions and now only runs
files.
Bugs fixed:
- '.' and '..' are now once again completed by tab completion.
- If SIGINT is set to ignore, the interactive shell no longer exits on
Ctrl+C.
- ksh now builds and runs on Apple's new M1 hardware.
- The 'return' and 'exit' commands no longer risk triggering actual
signals by returning or exiting with a status > 256.
- Ksh no longer behaves badly when parsing a type definition command
('typeset -T' or 'enum') without executing it or when executing it in
a subshell. Types can now safely be defined in subshells and defined
conditionally as in 'if condition; then enum ...; fi'.
- Discipline functions, especially those applied to PS2 or .sh.tilde,
will no longer crash your shell upon being interrupted or throwing an
error.
- Fixed a bug that could corrupt output if standard output is closed
upon initialising the shell.
- Fixed a bug in the [[ ... ]] compound command: the '!' logical
negation operator now correctly negates another '!', e.g.,
[[ ! ! 1 -eq 1 ]] now returns 0/true. Note that this has always been
the case for 'test'/'['.
- Fixed SHLVL so that replacing ksh by itself (exec ksh) will not
increase it.
- Arithmetic expressions are no longer allowed to assign out-of-range
values to variables of types declared with enum.
- The 'time' keyword no longer makes the --errexit shell option
ineffective.
- Various bugs in libcmd built-in commands (those bound to the
/opt/ast/bin path by default) have been fixed.
- Various other crashing bugs have been fixed.
Fixes for the shcomp byte code compiler:
- shcomp is now able to compile scripts that define types using enum.
- shcomp now refuses to mess up your terminal by writing bytecode
to it.
### MAIN CHANGES between ksh 93u+ 2012-08-01 and 93u+m 1.0.0-beta.1 ###
Hundreds of bugs have been fixed, including many serious/critical bugs.
This includes upstreamed patches from OpenSUSE, Red Hat, and Solaris, fixes
backported from the abandoned 93v- beta and ksh2020 fork, as well as many
new fixes from the community. See the NEWS file for more information, and
the git commit log for complete documentation of every fix. Incompatible
changes have been minimised, but not at the expense of fixing bugs. For a
list of potentially incompatible changes, see src/cmd/ksh93/COMPATIBILITY.
Though there was a "no new features, bugfixes only" policy, some new
features were found necessary, either to fix serious design flaws or to
complete functionality that was evidently intended, but not finished.
Below is a summary of these new features.
New command line editor features:
- The forward-delete and End keys are now handled as expected in the
emacs and vi built-in line editors.
- In the vi and emacs line editors, repeat count parameters can now also
be used for the arrow keys and the forward-delete key. E.g., in emacs
mode, <ESC> 7 <left-arrow> will now move the cursor seven positions to
the left. In vi control mode, this would be entered as: 7 <left-arrow>.
New shell language features:
- The &>file redirection shorthand (for >file 2>&1) is now available for
all scripts and interactive sessions and not only for profile/login
scripts, bringing ksh 93u+m in line with mksh, bash, and zsh.
- File name generation (a.k.a. pathname expansion, 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 files (dotfiles) in the current
directory, without the harmful inclusion of '.' and '..'.
- Tilde expansion can now be extended or modified by defining a
.sh.tilde.get or .sh.tilde.set discipline function. This replaces a
2004 undocumented attempt to add this functionality via a .sh.tilde
command, which never worked and crashed the shell. See the manual for
details on the new method.
New features in built-in commands:
- Usage error messages now show the --help/--man self-documentation options.
- 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 as expected:
$ /opt/ast/bin/cat --version
version cat (AT&T Research) 2012-05-31
- 'command -x' now looks for external commands only, skipping built-ins.
In addition, its xargs-like functionality no longer freezes the shell on
Linux and macOS, making it effectively a new feature on these systems.
- 'redirect' now checks if all arguments are valid redirections before
performing them. If an error occurs, it issues an error 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.
- 'times' now gives high precision output in a POSIX compliant format.
- 'typeset' now gives an informative error message if an incompatible
combination of options is given.
- 'whence -v/-a' now reports the location of autoloadable functions.
New features in shell options:
- A new --globcasedetect shell option is added on OSs where we can
check for a case-insensitive file system (currently Windows/Cygwin,
macOS, Linux and QNX 7.0+). When this option is turned on, file name
generation (globbing), as well as file name tab completion on
interactive shells, automatically become case-insensitive on file
systems where the difference between upper and lower case is ignored
for file names. This is transparently determined for each directory, so
a path pattern that spans multiple file systems can be part
case-sensitive and part case-insensitive.
- A new --nobackslashctrl shell option disables the special escaping
behaviour of the backslash character in the emacs and vi built-in
editors. Particularly in the emacs editor, this makes it much easier to
go backward, insert a forgotten backslash into a command, and then
continue editing without having your next cursor key replace your
backslash with garbage. Note that Ctrl+V (or whatever other character
was set using 'stty lnext') always escapes all control characters in
either editing mode.
- A new --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.
- Enhancement to -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
you would expect.

View file

@ -0,0 +1,146 @@
ksh 93u+m general copyright notice
########################################################################
# #
# The KornShell 93u+m distribution #
# Copyright (c) 2021 Contributors to ksh 93u+m #
# <https://github.com/ksh93/ksh> #
# Derived from AT&T's ast package (see below) #
# 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) #
# #
# CONTRIBUTORS #
# #
# Martijn Dekker <martijn@inlv.org> #
# Johnothan King <johnothanking@protonmail.com> #
# hyenias <58673227+hyenias@users.noreply.github.com> #
# Anuradha Weeraman <anuradha@weeraman.com> #
# Chase <nicetrynsa@protonmail.ch> #
# Govind Kamat <govind_kamat@yahoo.com> #
# Harald van Dijk <harald@gigawatt.nl> #
# Lev Kujawski <int21h@mailbox.org> #
# Marc Wilson <posguy99@gmail.com> #
# #
########################################################################
ast package general copyright notice
########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1986-2014 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 #
# #
# CONTRIBUTORS #
# #
# Glenn Fowler <gsf@research.att.com> #
# David Korn <dgk@research.att.com> #
# Phong Vo <kpv@research.att.com> #
# Adam Edgar <aedgar@research.att.com> #
# Adam Buchsbaum <alb@adambuchsbaum.com> #
# Aman Shaikh <ashaikh@research.att.com> #
# Bala Krishnamurthy <bala@research.att.com> #
# Brian Russell <brussell@research.att.com> #
# Robin Chen <chen@research.att.com> #
# Don Caldwell <dfwc@research.att.com> #
# Lefty Koutsofios <ek@research.att.com> #
# Bob Gruber <bob.gruber@gmail.com> #
# Jia Wang <jiawang@research.att.com> #
# Jeff Fellin <jkf@research.att.com> #
# Jeff Korn <@google.com> #
# Kathleen Fisher <kfisher@research.att.com> #
# Ken Church <@microsoft.com> #
# Brian Kernigham <bwk@research.bell-labs.com> #
# Dennis Ritchie <dmr@research.bell-labs.com> #
# Doug McIlroy <doug@research.bell-labs.com> #
# Eduardo Krell <ekrell@adexus.cl> #
# John Snyder <jjs@adexus.cl> #
# Herman Rao <rao@fareastone.att.com.tw> #
# AST users mailgroup <ast-users@research.att.com> #
# AST developers mailgroup <ast-developers@research.att.com> #
# #
########################################################################
bsd package general copyright notice
########################################################################
# #
# This software is part of the BSD package #
# Copyright (c) 1979-2012 The Regents of the University of California #
# #
# Redistribution and use in source and binary forms, with or #
# without modification, are permitted provided that the following #
# conditions are met: #
# #
# 1. Redistributions of source code must retain the above #
# copyright notice, this list of conditions and the #
# following disclaimer. #
# #
# 2. Redistributions in binary form must reproduce the above #
# copyright notice, this list of conditions and the #
# following disclaimer in the documentation and/or other #
# materials provided with the distribution. #
# #
# 3. Neither the name of The Regents of the University of California#
# names of its contributors may be used to endorse or #
# promote products derived from this software without #
# specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND #
# CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, #
# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF #
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE #
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS #
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, #
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED #
# TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, #
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON #
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY #
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE #
# POSSIBILITY OF SUCH DAMAGE. #
# #
# Redistribution and use in source and binary forms, with or without #
# modification, are permitted provided that the following conditions #
# are met: #
# 1. Redistributions of source code must retain the above copyright #
# notice, this list of conditions and the following disclaimer. #
# 2. Redistributions in binary form must reproduce the above copyright #
# notice, this list of conditions and the following disclaimer in #
# the documentation and/or other materials provided with the #
# distribution. #
# 3. Neither the name of the University nor the names of its #
# contributors may be used to endorse or promote products derived #
# from this software without specific prior written permission. #
# #
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS" #
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED #
# TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A #
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS #
# OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, #
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT #
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF #
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND #
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, #
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT #
# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF #
# SUCH DAMAGE. #
# #
# CONTRIBUTORS #
# #
# Bill Joy #
# #
########################################################################

View file

@ -1,8 +1,8 @@
Eclipse Public License - v 1.0
## Eclipse Public License - v 1.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
### 1. DEFINITIONS
"Contribution" means:
@ -24,7 +24,7 @@ where such changes and/or additions to the Program originate from and are distri
"Recipient" means anyone who receives the Program under this Agreement, including all Contributors.
2. GRANT OF RIGHTS
### 2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.
@ -34,7 +34,7 @@ c) Recipient understands that although each Contributor grants the licenses to i
d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.
3. REQUIREMENTS
### 3. REQUIREMENTS
A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:
@ -60,21 +60,21 @@ Contributors may not remove or alter any copyright notices contained within the
Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.
4. COMMERCIAL DISTRIBUTION
### 4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor ("Commercial Contributor") hereby agrees to defend and indemnify every other Contributor ("Indemnified Contributor") against any losses, damages and costs (collectively "Losses") arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor's responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.
5. NO WARRANTY
### 5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
### 6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
### 7. GENERAL
If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.

View file

@ -3,6 +3,778 @@ For full details, see the git log at: https://github.com/ksh93/ksh
Any uppercase BUG_* names are modernish shell bug IDs.
2021-12-28:
- Fixed a bug that caused CDPATH to continue working after unsetting it.
- Added three options to the ulimit builtin with the same names and
functionality as in Bash:
- 'ulimit -k' sets the maximum number of kqueues.
- 'ulimit -P' sets the maximum number of pseudo-terminals.
- 'ulimit -R' sets the maximum time in microseconds a real-time process
can run before blocking.
Note that to use these options the operating system must support the
corresponding resource limit.
- Ported performance optimizations from illumos to improve the performance
of the cksum builtin. (Note that the cksum builtin is not enabled by
default.)
2021-12-27:
- Two bash-like flags for 'whence' were backported from ksh 93v-:
- 'whence -P/type -P' is an alias to the existing -p flag.
- 'whence -t/type -t' will print only the type of a command in a simple
format that is designed to be easy to use for scripts. Example:
$ type -t typeset; whence -t sh
builtin
file
- Fixed a crash or freeze that would occur on Linux when using Ctrl+C to
interrupt a command substitution containing a pipe in an interactive shell.
- Fixed a crash that could occur while processing a here-document while
xtrace (set -x) is on and the $PS4 prompt contains parameter expansions or
command substitutions.
- The mkservice and eloop builtins can now be built by enabling the
new SHOPT_MKSERVICE setting in src/cmd/ksh93/SHOPT.sh.
2021-12-26:
- Listing aliases or tracked aliases in a script no longer corrupts
shcomp's generated bytecode.
- Listing specific aliases with 'alias -p' and specific tracked aliases
with 'alias -pt' now works as documented. This means that the following
string of commands now works as you would expect:
$ hash -r; unalias -a
$ alias foo=bar; hash cat
$ alias -p foo; alias -pt cat
alias foo=bar
alias -t cat
- As a result of the above fix, listing all tracked aliases with 'alias -pt'
now prints commands that can be reused to recreate the tracked aliases.
- Attempting to list a non-existent alias or tracked alias with the -p option
now causes an error and sets the exit status to the number of non-existent
aliases passed.
- Attempting to list 256 non-existent aliases now errors out with the exit
status set to one.
2021-12-22:
- Process substitutions run in a profile script no longer print their
process ID when run.
2021-12-21:
- Fixed a bug that caused subshells (such as code blocks in parentheses) to
partially behave like the interactive main shell after running anything
that invokes the parser. For example:
$ (eval :; sleep 1 & echo done)
[1] 30909 <--- incorrect job control output from subshell
done
- Fixed: after suspending (Ctrl+Z) a subshell that is running an external
command, resuming the subshell with 'fg' failed and the job was lost.
$ (vi) <--- press Ctrl+Z
[2] + Stopped (vi)
$ fg
(vi) <--- vi failed to resume; immediate return to command line
$ fg
ksh: no such job
2021-12-17:
- Release 1.0.0-beta.2.
- Ksh no longer behaves badly when parsing a type definition command
('typeset -T' or 'enum') without executing it or when executing it in
a subshell. Types can now safely be defined in subshells and defined
conditionally as in 'if condition; then enum ...; fi'.
- Single digits can now be compared lexically in [[ ... ]] with the
< and > operators.
2021-12-16:
- Changed the default selection of compiled-in /opt/ast/bin built-in libcmd
command to: basename, cat, cp, cut, dirname, getconf, ln, mktemp, mv.
Add /opt/ast/bin to your $PATH to use these. Type 'cp --man', etc. for info.
- A bug introduced on 2020-09-17 was fixed that caused interactive ksh to exit
if Ctrl+C was pressed while SIGINT was being ignored (as in "trap '' INT").
2021-12-13:
- Fixed a bug introduced on 2020-08-09 that prevented '.' and '..' from
being completed when using file name tab completion.
- Fixed a bug on illumos that caused the chown builtin to fail with 'Invalid
argument' after failing to change the ownership of a file twice using an ID
that doesn't exist in /etc/passwd. (Note that the chown builtin is not
enabled by default.)
2021-12-11:
- Fixed two more crashing bugs that occurred if ksh received a signal (such
as SIGINT due to Ctrl+C) while the user is entering a multi-line command
substitution in an interactive shell.
- The shell linter's warning for variable expansion in ((...)) now tells the
user which variable is causing performance degradation.
- The shell linter now warns the user x=$((expr)) is slower than ((x=expr))
when assigning a value to a variable.
2021-12-09:
- Increased the general robustness of discipline function handling, fixing
crashing bugs with PS2.get() and .sh.tilde.get() disciplines, among others.
- Fixed a crash that occurred on the interactive shell if the PS1 prompt
contains multiple command substitutions and the user interrupts input
while the shell is on a PS2 prompt waiting for the user to complete a
command substitution of the form $( ... ).
2021-12-08:
- Fixed: if a function returned with a status > 256 using the 'return' command
and the return value corresponded to a value that could have resulted from a
signal, and an EXIT trap was active, then the shell mistakenly issued that
signal to itself. Depending on the signal, this could cause the shell to
terminate ungracefully, e.g. 'return 267' caused SIGSEGV ("memory fault").
- 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.
- The head and tail builtins now correctly handle files that do not have an
ending newline. (Note that the tail builtin is not compiled in by default.)
2021-12-05:
- Fixed an issue on illumos that caused some parameters in the getconf
builtin to fail.
- The cd built-in command now supports a -e option (as specified in
https://www.austingroupbugs.net/view.php?id=253). Passing -e alongside -P
is used to guarantee the cd built-in returns with exit status 1 if the
current working directory couldn't be determined after successfully changing
the directory.
2021-12-01:
- Fixed a memory fault that occurred when a discipline function exited
with an error from a special builtin or when a discipline function exited
because of a signal.
2021-11-29:
- Fixed a memory fault that prevented ksh from functioning on ARM-based Macs.
- A bug that caused the time keyword to override the errexit shell option has
been fixed.
- Fixed a crash that could occur when a KEYBD trap was set and a multi-line
command substitution was input in an interactive shell.
- The shell linter's warnings for obsolete arithmetic operators in [[ ... ]]
and unnecessary variable expansion in ((...)) have been improved.
2021-11-24:
- The --posix mode was amended to stop the '.' command (but not 'source') from
looking up functions defined with the 'function' keyword. In the POSIX
standard and on other shells, the '.' command finds only script files.
- The rm built-in's -d/--directory option has been fixed. It now properly
removes empty directories and refuses to remove non-empty directories
(as specified in https://www.austingroupbugs.net/view.php?id=802). Note
that the rm built-in command isn't compiled in by default.
2021-11-23:
- A bug was fixed that allowed arithmetic expressions to assign out-of-range
values to variables of an enumeration type defined with the 'enum' command,
causing undefined behavior. Within arithmetic expressions, enumeration
values translate to index numbers from 0 to the number of elements minus 1.
That range is now checked for. Decimal fractions are ignored.
2021-11-21:
- It is now possible to use types defined by 'enum' in contexts where the
script is entirely parsed before (or without) being executed, such as
dotted/sourced scripts and scripts compiled by shcomp.
- Added support for the size mode to the stty(1) built-in. This mode is used
to display the terminal's number of rows and columns. Note that the stty
built-in is not compiled in by default. This can be changed by adding
stty to the table of built-ins in src/cmd/ksh93/data/builtins.c.
2021-11-20:
- Listing types with 'typeset -T' no longer displays incomplete versions of
types created by the enum built-in.
2021-11-18:
- The printf built-in command now supports a -v option as on bash and zsh.
This allows you to assign formatted output directly to a variable.
- Fixed a performance regression introduced on 2021-05-03 that caused
the shbench[*] fibonacci benchmark to run slower.
[*]: https://github.com/ksh-community/shbench
2021-11-16:
- 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, e.g., both of:
$ x=010; echo "$((x)), $(($x))"
$ set -o letoctal; x=010; let y=$x z=010; echo "$y, $z"
would output '10, 8'. These now output '10, 10' and '8, 8', respectively.
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.
2021-11-15:
- In arithmetic evaluation, the --posix compliance option now disables the
special floating point constants Inf and NaN so that $((inf)) and $((nan))
refer to the variables by those names as the standard requires. (BUG_ARITHNAN)
- Fixed two file descriptor leaks in the hist builtin that occurred when
the -s flag ran a command or encountered an error.
2021-11-14:
- Fixed: ksh crashed after unsetting .sh.match and then matching a pattern.
- Another test/[ fix: "test \( string1 -a string2 \)" and "test \( string1 -o
string2 \)" no longer give an incorrect "argument expected" error message.
2021-11-13:
- The test/[ built-in command now supports the '<' and '=~' operators from [[.
As of now, test/[ supports the same operators as [[ except for the different
and/or operators. Note: test/[ remains deprecated due to its many pitfalls.
- The test/[ built-in command is fixed so that the binary -a (and) and -o (or)
operators, as in [ "$a" -a "$b" ] or [ "$a" -o "$b" ], work even if "$a" is
'!' or '('. To avoid breaking backwards compatibility with the nonstandard
unary [ -a "$file" ] and [ -o "$option" ] operators in combination with '!'
or parentheses, this fix is only activated if the posix option is on.
2021-11-07:
- Fixed a bug that could corrupt output if standard output is closed upon
initializing the shell.
- Improved BUG_PUTIOERR fix (2020-05-14) with more error checking. On
systems with the "disk full" error testing device /dev/full, an
echo/print/printf to /dev/full now always yields a non-zero exit status.
2021-09-13:
- Disable the POSIX arithmetic context while running a command substitution
invoked from within an arithmetic expression. This fixes a bug that caused
integer arguments with a leading zero to be incorrectly interpreted as octal
numbers in non-POSIX arithmetic contexts within such command substitutions.
2021-09-12:
- When invoking a script without an interpreter/hashbang path on Linux and
macOS, ksh can now update 'ps' output to show longer command lines.
2021-08-13:
- An issue was fixed that could cause old-style `backtick` command
substitutions to hang in certain cases.
2021-06-03:
- Fixed a bug in the [[ compound command: the '!' logical negation operator
now correctly negates another '!', e.g., [[ ! ! 1 -eq 1 ]] now returns
0/true. Note that this has always been the case for 'test'/'['.
2021-05-18:
- Fixed SHLVL so that replacing ksh by itself (exec ksh) will not increase it.
- Fixed a regression introduced on 2020-08-05 that caused a non-interactive
shell to exit if an I/O redirection of a function call encountered an error.
2021-05-13:
- Fixed a bug with 'test -t 1' that was introduced on 2021-04-26:
v=$(test -t 1 >/dev/tty && echo ok) did not assign 'ok' to v.
2021-05-10:
- Release 1.0.0-beta.1.
2021-05-07:
- Backported three ksh 93v- math.tab changes, allowing for an exp10()
arithmetic function if one exists in the C library, a new float()
function, and lastly an updated int() function that rounds to zero
instead of being an alias to floor().
2021-05-05:
- Fixed: a preceding variable assignment like foo=bar in 'foo=bar command'
(with no command arguments after 'command') incorrectly survived the
'command' regular built-in command invocation.
- Fixed: 'command -p some_utility' intermittently failed to find the utility
under certain conditions due to a memory corruption issue.
2021-05-03:
- 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).
- Fixed program flow corruption that occurred in scripts on executing a
background job in a nested subshell, as in ( ( simple_command & ) ).
- Completed the 2021-04-30 fix for ${var<OP>'{}'} where <OP> is '-', '+',
':-' or ':+' by fixing a bug that caused an extra '}' to be output.
- Following the resolution of Austin Group bug 1393[*] that is set to be
included in the next version of the POSIX standard, the 'command' prefix
in POSIX mode (set -o posix) no longer disables the declaration properties
of declaration built-ins. This reverts a change introduced on 2020-09-11.
[*] https://austingroupbugs.net/view.php?id=1393
- Fixed arithmetic assignment operations for multidimensional indexed arrays.
2021-04-30:
- The emacs 'ESC .' (M-.) and vi '_' commands now take shell quoting into
account when repeating a word from the previous command line. For example, if
the previous command is 'ls Stairway\ To\ Heaven.mp3', then they now insert
'Stairway\ To\ Heaven.mp3' instead of 'Heaven.mp3'. Thanks to Govind Kamat.
- Fixed a bug introduced on 2020-09-05 that caused "echo ${var:+'{}'}"
to be misparsed.
- Fixed: the effects of 'builtin', 'exec' and 'ulimit' leaked out of a parent
virtual subshell if run from a ${ shared-state; } command substitution.
2021-04-26:
- Fixed a bug introduced on 2021-02-20 in which a shared-state command
substitution stopped sharing its state with the calling shell environment
if it executed a command that locally redirected standard output.
2021-04-22:
- shcomp (the shell bytecode compiler) was fixed to correctly compile process
substitutions used as the file name to a redirection, as in 'cmd < <(cmd)'.
- Fixed a bug introduced on 2020-07-13 that set LINENO to the wrong line
number after leaving a virtual subshell in which LINENO had been unset.
2021-04-21:
- Fixed a bug introduced on 2020-09-28 that caused an interactive ksh to exit
if a profile script (such as ~/.kshrc) contains a syntax error.
2021-04-20:
- Fixed three problems with the /opt/ast/bin/getconf built-in command:
1. The -l/--lowercase option did not change all variable names to lower case.
2. The -q/--quote option now quotes all string values. Previously, it only
quoted string values that had a space or other non-shellsafe character.
3. The -c/--call, -n/--name and -s/--standard options matched all variable
names provided by 'getconf -a', even if none were actual matches.
- The readonly attribute of ksh variables is no longer imported from
or exported to other ksh shell instances through the environment.
2021-04-16:
- Fixed a bug in emacs mode: after using tab completion to complete the name
of a directory, it was not possible to type numbers after the slash.
- Fixed an optimization bug that caused the <>; redirection operator to fail
when used with the last command in a -c script.
2021-04-14:
- 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 as expected:
$ /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
Non-canonical paths such as /opt/ast/./bin/cat will not find the built-ins.
- Path-bound built-ins will now also be found on a PATH set locally using an
assignment preceding the command, so the following will now work as expected:
$ PATH=/opt/ast/bin cat --version
version cat (AT&T Research) 2012-05-31
2021-04-13:
- Fixed a few bugs that could cause ksh to show the wrong error message and/or
return the wrong exit status if a command couldn't be executed. In
scenarios where the command was found in the PATH but it was not executable,
ksh now returns with exit status 126. Otherwise, ksh will return with exit
status 127 (such as if the command isn't found or if the command name is
too long).
2021-04-12:
- Corrected a memory fault when an attempt was made to unset the default
nameref KSH_VERSION from the shell environment prior to any other name
reference variable creation or modification.
2021-04-11:
- Fixed two related regressions introduced on 2020-06-16:
1. The += assignment failed to append the value of variables when used
in an invocation-local scope. The following should print '5', but
the regression resulted in '3' being printed instead:
$ integer foo=2; foo+=3 command eval 'echo $foo'
3
2. Any += assignment used in an invocation-local scope could modify
readonly variables.
2021-04-10:
- Fixed: the internal count of the recursion level for arithmetic expressions
was not reset when certain errors occurred in a virtual subshell. This could
cause an erroneous "recursion to deep" error when a loop executed many
subshells containing arithmetic expressions with errors, e.g. for testing.
2021-04-09:
- Fixed a bug that caused ksh to enable -c during the shell's initialization
if the only argument passed was --posix.
- Fixed a related bug that caused 'set --posix' to leave the braceexpand and
letoctal shell options unchanged.
- Fixed a bug that caused 'set --default' to unset the restricted option
in restricted shells.
2021-04-08:
- Path-bound builtins will now be used by restricted shells if /opt/ast/bin
is in the $PATH upon invoking the shell or before setting it to restricted.
- Fixed a bug that caused "printf '%T\n' now" to ignore $LC_ALL and $LC_TIME
if the current locale was previously set, unset then set again.
2021-04-07:
- The $LC_TIME variable is now recognized by ksh and if set to an invalid
locale will show an error.
- Fixed BUG_CSUBSTDO: If standard output is closed before running a command
substitution, redirecting any other file descriptor no longer closes standard
output inside of the command substitution.
2021-04-05:
- Fixed a regression, introduced in ksh 93t+ 2009-07-31, that caused a command
like 'unset arr[3]' to unset not just element 3 of the array but all elements
starting from 3, if a range expansion like ${arr[5..10]} was previously used.
- Several fixes for arrays of a type created by 'enum' were backported from ksh
93v-, further to the two enum array fixes already applied on 2021-02-01:
1. The array[@]} expansion was fixed for associative arrays of an enum type.
2. Assignments now work correctly for all enum values for both indexed and
associative arrays.
3. 'unset' will now completely unset an associative array of an enum type.
2021-04-04:
- A bug was fixed that caused a broken prompt display upon redrawing the
command line if the last line of the prompt includes an xterm escape
sequence that is terminated by $'\a' (the bell character).
- Harden readonly variables. Readonly variables or arrays no longer allow
attribute changes which would otherwise allow their value to be altered.
Expanded support for readonly variables within multidimensional arrays.
2021-04-03:
- Fixed a bug that caused the uname builtin's -d option to change the output
of the -o option.
- Fixed a possible crash that could occur when showing the domain name
with the uname builtin's -d option.
2021-03-31:
- Fixed a bug that caused 'cd -' to ignore the current value of $OLDPWD
when it's set to a different directory in a new scope.
- Fixed a related bug that caused ksh to use the wrong value for $PWD
when in a new scope.
2021-03-29:
- Fixed an intermittent crash that could occur in vi mode when using the 'b'
or 'B' commands to go back one word.
2021-03-27:
- The 'test' builtin will now show an error message when given the invalid ']]'
or '=~' operators; it also properly returns with exit status 2 now (instead
of exit status 1). If the invalid operator is supported by [[ ... ]] (such
as '=~'), test will now suggest the usage of [[ ... ]] instead.
2021-03-22:
- A new --globcasedetect shell option is added to ksh on OSs where we can check
for a case-insensitive file system (currently macOS, Windows/Cygwin, Linux
and QNX 7.0+). When this option is turned on, file name generation
(globbing), as well as file name tab completion on interactive shells,
automatically become case-insensitive on file systems where the difference
between upper- and lowercase is ignored for file names. This is transparently
determined for each directory, so a path pattern that spans multiple file
systems can be part case-sensitive and part case-insensitive.
The option is not compiled into ksh on systems where we do not know of a
method to check for file system case insensitivity. The shell option can be
force-compiled by setting SHOPT_GLOBCASEDET to 1 in src/cmd/ksh93/SHOPT.sh,
but it won't have any effect on non-supported systems, so this is not
recommended. It can be removed from ksh by setting SHOPT_GLOBCASEDET to 0.
2021-03-17:
- Fixed a bug with file name completion on the interactive shell in multibyte
locales. Upon encountering two filenames with multibyte characters starting
with the same byte, a partial multibyte character was autocompleted.
2021-03-16:
- Tilde expansion can now be extended or modified by defining a .sh.tilde.get
or .sh.tilde.set discipline function. This replaces a 2004 undocumented
attempt to add this functionality via a .sh.tilde built-in, which never
worked and crashed the shell. See the manual for details on the new method.
- Fixed a bug in interactive shells: if a variable used by the shell called
a discipline function (such as PS1.get() or COLUMNS.set()), the value of $?
was set to the exit status of the discipline function instead of the last
command run.
2021-03-15:
- If the HOME variable is unset, the bare tilde ~ now expands to the current
user's system-configured home directory instead of merely the username.
- Tighten up potential invalid typeset attribute combos when more than
one numeric type has been requested. In particular, -F and -i are no
longer masked over by previously given float types.
2021-03-13:
- Fixed a file descriptor leak that occurred when ksh used /dev/fd for
process substitutions passed to functions.
- Fixed a separate file descriptor leak that happened when a process
substitution was passed to a nonexistent command.
2021-03-11:
- Fixed an intermittent bug that caused process substitutions to infinitely
loop in Linux virtual machines that use systemd.
- Fixed a bug that caused process substitutions to leave lingering processes
if the command invoking them never reads from them.
2021-03-09:
- The ${!foo@} and ${!foo*} expansions yield variable names beginning with foo,
but excluded 'foo' itself. The fix for this is now backported from 93v- beta.
- test -v var, [ -v var ], and [[ -v var ]] did not correctly test if a
variable is set or unset after it has been given a numeric attribute with
'typeset' but not yet assigned a value. This has been fixed so that
[[ -v var ]] is now equivalent to [[ -n ${var+set} ]] as documented.
2021-03-07:
- Fixed the typeset -p display of short integers without an assigned value.
Also, the last -s or -l attribute option supplied for an integer is used.
- Fixed a bug with -G/--globstar introduced on 2020-08-09: patterns did not
match anything if any pathname component was '.' or '..', e.g. '**/./glob.c'
never matched. The 2020-08-09 fix does still apply to patterns like '.*'.
- Enhancement to -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 you would expect.
- Fixed a bug introduced on 2021-02-11 that caused job control on interactive
ksh sessions to misbehave if the login shell was replaced by ksh using 'exec'.
2021-03-06:
- Fixed an old expansion bug: expansions of type ${var=value} and ${var:=value}
did not perform an assignment and yielded the value 0 if 'var' was typeset as
numeric (integer or float) but had not yet been assigned a value.
- Fixed a bug introduced on 2020-08-19: Ctrl+D would break after an
interactive shell received SIGWINCH.
- Fixed a bug introduced on 2020-05-21: on an interactive shell, command lines
containing a syntax error were not added to the command history file and
sometimes corrupted the command history.
2021-03-05:
- Unbalanced quotes and backticks now correctly produce a syntax error
in -c scripts, 'eval', and backtick-style command substitutions.
2021-03-04:
- Fixed an arbitrary command execution vulnerability that occurred when
parsing the subscripts of arrays within arithmetic commands and expansion.
2021-03-01:
- Fixed the retention of size attributes when 'readonly' or 'typeset -r'
was applied to an existing variable.
2021-02-26:
- Fixed three long-standing bugs with tab completion in the emacs editor:
1. The editor accepted literal tabs without escaping in certain cases,
causing buggy and inconsistent completion behaviour. Details:
https://github.com/ksh93/ksh/issues/71#issuecomment-656970959
https://github.com/ksh93/ksh/issues/71#issuecomment-657216472
To enter a literal tab in emacs, you need to escape it with ^V or \.
2. After completing a filename by choosing from a file completion menu,
the terminal cursor was placed one position too far to the right,
corrupting command line display. This happened with multiline active.
Details: https://github.com/ksh93/ksh/issues/71#issue-655093805
3. A completion menu was displayed if the file name to be completed was
at the point where the rest of it started with a number, even if that
part uniquely identified it so the menu only showed one item. Details:
https://www.mail-archive.com/ast-users@lists.research.att.com/msg00436.html
- A bug with ${.sh.fun} in combination with the DEBUG trap has been fixed.
The ${.sh.fun} variable wrongly continued to contain the name of the last
function executed by the DEBUG trap after the trap action completed.
2021-02-21:
- Fixed: The way that SIGWINCH was handled (i.e. the signal emitted when the
terminal window size changes) could cause strange emacs/vi editor behaviour.
2021-02-20:
- Fixed a bug introduced on 2021-01-20: if a DEBUG trap action yielded exit
status 2, the execution of the next command was not skipped as documented.
- Fixed multiple buffer overflows causing crashes in typeset -L/-R-/-Z.
- Fixed typeset -Z zero-filling: if the number was zero, all zeros
were skipped when changing the initial size value of the -Z attribute,
leaving an empty string.
2021-02-18:
- A bug was fixed in the 'read' builtin that caused it to fail to process
multibyte characters properly in Shift-JIS locales.
2021-02-17:
- Emacs mode fixes:
1. Erasing a backslash while doing a reverse search (^R) no longer deletes
extra characters.
2. The backslash now escapes a subsequent interrupt (^C) as documented.
- Fixed a longstanding bug with shared-state command substitutions of the form
${ command; }. If these were executed in a subshell, changes made within
could survive not only the command substitution but also the parent subshell.
2021-02-15:
- Fixed a regression introduced by ksh93 (was not in ksh88): an empty 'case'
list on a single line ('case x in esac') was a syntax error.
- Fixed a bug in the emacs built-in editor, introduced on 2020-09-17, that
made the Meta-D and Meta-H keys delete single characters instead of words.
- A new 'backslashctrl' shell option has been added. It is on by default.
Turning it off (set +o backslashctrl or set --nobackslashctrl) disables the
special escaping behaviour of the backslash character in the emacs and vi
built-in editors. Particularly in the emacs editor, this makes it much easier
to go back, insert a forgotten backslash into a command, and then continue
editing without having your next cursor key replace your backslash with
garbage. Note that Ctrl+V (or whatever other character was set using
'stty lnext') always escapes all control characters in either editing mode.
2021-02-14:
- Due to a deficiency in some UNIX variants, the 'sleep' built-in command could
occasionally sleep for slightly less than the time specified. It now performs
an additional check against the system clock to make sure it sleeps at least
the given amount of time. Thanks to Lev Kujawski for adding this feature.
- A few bugs were fixed that 93u+m introduced along with the new '-o posix'
shell option on 2020-09-01:
1. 'set --posix' now works as the expected equivalent of 'set -o posix'.
2. As of 2020-09-18, the posix option turns off braceexpand and turns on
letoctal. Any attempt to override that in a single command such as
'set -o posix +o letoctal' was quietly ignored. This now works as long
as the overriding option follows the posix option on the command line.
3. The --default option to 'set' now stops the 'posix' option, if set or
unset in the same 'set' command, from changing other options. This allows
the command output by 'set +o' to correctly restore the current options.
2021-02-11:
- Fixed a bug that caused ksh to lose track of all running background jobs if
a shared-state command substitution of the form v=${ cmd; } was used twice.
- Job control (the -m/-o monitor option) has been fixed for scripts. Background
jobs are now correctly assigned their own process group when run from
subshells (except command substitutions). The 'fg' command now also works for
scripts as it does on other shells, though 'wait' should be preferred.
2021-02-05:
- Fixed a longstanding bug that caused redirections that store a file
descriptor > 10 in a variable, such as {var}>file, to stop working if
brace expansion (the -B or -o braceexpand option) was turned off. (Note
that '{var}' is not a brace expansion as it does not contain ',' or '..'.)
2021-02-04:
- Fixed ksh crashing if an autoloaded function tried to autoload itself.
ksh now errors out gracefully with an "autoload loop" error message.
- Fixed crash on trying a very long nonexistent command.
2021-02-01:
- Fixed a bug in 'typeset': the '-s' modifier option for short integer will
now only be applied if the integer option '-i' is also present, avoiding
inconsistent results and a crash.
- Fixed: scalar arrays (-a) and associative arrays (-A) of a type created by
'enum' allowed values not specified by the enum type, corrupting results.
- Fixed: the "${array[@]}" expansion for associative arrays of a type created
by 'enum' expanded to random numbers instead of the array's values.
2021-01-30:
- The -x option to the 'command' built-in now causes it to bypass built-ins
@ -12,7 +784,7 @@ Any uppercase BUG_* names are modernish shell bug IDs.
a command with many arguments was divided into several command invocations.
- The 2020-08-16 fix is improved with a compile-time feature test that
detects if and how the OS uses data alignment in the arguments list,
detects if the OS requires extra bytes per argument in the arguments list,
maximising the efficiency of 'command -x' for the system it runs on.
2021-01-24:
@ -342,7 +1114,7 @@ Any uppercase BUG_* names are modernish shell bug IDs.
- Added the '${.sh.pid}' variable as an alternative to Bash's '$BASHPID'.
This variable is set to the current shell's PID, unlike '$$' (which is
set to the parent shell's PID). In virtual subshells '${.sh.pid}' is not
set to the main shell's PID). In virtual subshells '${.sh.pid}' is not
changed from its previous value, while in forked subshells '${.sh.pid}'
is set to the subshell's process ID.
@ -610,8 +1382,8 @@ Any uppercase BUG_* names are modernish shell bug IDs.
$RANDOM
$LINENO
- Fixed two bugs that caused `unset .sh.lineno` to always produce a memory
fault and `(unset .sh.level)` to memory fault when run in nested
- Fixed two bugs that caused 'unset .sh.lineno' to always produce a memory
fault and '(unset .sh.level)' to memory fault when run in nested
functions.
2020-06-18:
@ -656,7 +1428,7 @@ Any uppercase BUG_* names are modernish shell bug IDs.
2020-06-13:
- Fixed a timezone name determination bug on FreeBSD that caused the
output from `LC_ALL=C printf '%T' now` to print the wrong time zone name.
output from "LC_ALL=C printf '%T\n' now" to print the wrong time zone name.
2020-06-11:
@ -703,14 +1475,14 @@ Any uppercase BUG_* names are modernish shell bug IDs.
Emacs editing mode is bugged in ksh93u+ and ksh2020. Let's
say you were to run the following commands after starting
a fresh instance of ksh:
$ alias foo='true'
$ alias foo=true
$ unalias foo
If you type 'a' and then press the up arrow on your keyboard,
ksh will complete 'a' to `alias foo='true'` by doing a reverse
ksh will complete 'a' to 'alias foo=true' by doing a reverse
search for the last command that starts with 'a'.
Run the alias command again, then type 'u' and press the up
arrow key again. If ksh is in Vi mode, you will get `unalias foo`,
but in Emacs mode you will get `alias foo='true'` again.
arrow key again. If ksh is in Vi mode, you will get 'unalias foo',
but in Emacs mode you will get 'alias foo=true' again.
All subsequent commands were ignored as ksh was saving the first
command and only based later searches off of it.

View file

@ -7,7 +7,7 @@ to the last stable release (93u+ 2012-08-01) of
[ksh93](http://www.kornshell.com/),
formerly developed by AT&T Software Technology (AST).
The sources in this repository were forked from the
Github [AST repository](https://github.com/att/ast)
GitHub [AST repository](https://github.com/att/ast)
which is no longer under active development.
For user-visible fixes, see [NEWS](https://github.com/ksh93/ksh/blame/master/NEWS)
@ -17,8 +17,8 @@ To see what's left to fix, see [the issue tracker](https://github.com/ksh93/ksh/
## Policy
1. No new features; bug fixes only (but see items 3 and 4).
Feature development is for a future separate branch.
1. Fixing bugs is main focus of the 1.x series.
Major feature development is for future versions (2.x and up).
2. No major rewrites. No refactoring code that is not fully understood.
3. No changes in documented behaviour, except if required for compliance with the
[POSIX shell language standard](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/contents.html)
@ -29,8 +29,10 @@ To see what's left to fix, see [the issue tracker](https://github.com/ksh93/ksh/
6. To help increase everyone's understanding of this code base, fixes and
significant changes should be fully documented in commit messages.
7. Code style varies somewhat in this historic code base.
Your changes should match the style of the code surrounding it.
Your changes should match the style of the code surrounding them.
Indent with tabs, assuming an 8-space tab width.
Opening braces are on a line of their own, at the same indentation level
as their corresponding closing brace.
Comments always use `/*`...`*/`.
8. Good judgment may override this policy.
@ -44,10 +46,19 @@ While that ksh2020 branch is now abandoned and still has many critical bugs,
it also had a lot of bugs fixed. More importantly, the AST issue tracker
now contains a lot of documentation on how to fix those bugs, which made
it possible to backport many of them to the last stable release instead.
This ksh 93u+m reboot now incorporates many of these bugfixes, as well as
many patches from Red Hat, Solaris, as well as new fixes from the community.
Though there are many bugs left to fix, we are confident at this point that
93u+m is already the least buggy branch of ksh93 ever released.
This ksh 93u+m reboot now incorporates many of these bugfixes,
plus patches from
[OpenSUSE](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-OpenSUSE),
[Red Hat](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-Red-Hat),
and
[Solaris](https://github.com/ksh93/ksh/wiki/Patch-Upstream-Report:-Solaris),
as well as many new fixes from the community
([1](https://github.com/ksh93/ksh/pulls?q=is%3Apr+is%3Amerged),
[2](https://github.com/ksh93/ksh/issues?q=is%3Aissue+is%3Aclosed+label%3Abug)).
Though there are many
[bugs left to fix](https://github.com/ksh93/ksh/issues),
we are confident at this point that 93u+m is already the least buggy branch
of ksh93 ever released.
## Build
@ -71,7 +82,7 @@ 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:
```sh
export CCFLAGS="-xc99 -m64 -O" LDFLAGS="-m64"
export CCFLAGS="-m64 -O" LDFLAGS="-m64"
bin/package make
```
Alternatively you can append these to the command, and they will only be
@ -98,7 +109,7 @@ bin/shtests --man
### Install
Automated installation is not supported.
Automated installation is not supported yet.
To install manually:
```sh
cp arch/$(bin/package host type)/bin/ksh /usr/local/bin/
@ -127,7 +138,7 @@ modification.
The code should conform to the
[IEEE POSIX 1003.1 standard](http://www.opengroup.org/austin/papers/posix_faq.html)
and to the proposed ANSI-C standard so that it should be portable to all
and to the 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. It can support multi-byte characters sets with some
@ -166,7 +177,7 @@ KSH-88:
two to sixty-four. You can also do double precision floating point
arithmetic. Almost the complete set of C language operators are available
with the same syntax and precedence. Arithmetic expressions can be used to
as an argument expansion or as a separate command. In addition there is an
as an argument expansion or as a separate command. In addition, there is an
arithmetic for command that works like the for statement in C.
* Arrays: KSH-93 supports both indexed and associative arrays. The subscript
for an indexed array is an arithmetic expression, whereas, the subscript
@ -183,7 +194,7 @@ KSH-88:
case, field width, and justification to shell variables.
* More pattern matching capabilities: KSH-93 allows you to specify extended
regular expressions for file and string matches.
* KSH-93 uses a hierarchal name space for variables. Compound variables can
* 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 it to intercept
assignments and references.

View file

@ -1,17 +1,111 @@
TODO for AT&T ksh93, 93u+m bugfix branch
TODO for ksh 93u+m
See the issue tracker:
See the issue tracker for up-to-date information:
https://github.com/ksh93/ksh/issues
______
Enhancements to do:
* Add -T (-o functrace) option as in bash
https://github.com/ksh93/ksh/issues/162
* History pattern search menu (SHOPT_EDPREDICT) needs work
https://github.com/ksh93/ksh/issues/233
* Use real pipes instead of sockets
https://github.com/ksh93/ksh/issues/327
______
Known bugs in ksh 93u+m 1.0.0-beta.2 (HELP IS WANTED to fix these):
* Memory leak when initialising associative array in subshell
https://github.com/ksh93/ksh/issues/94
* command substitution botches output of non-waited-for child processes
https://github.com/ksh93/ksh/issues/124
* Intermittent coprocess hang on Debian/Ubuntu and Solaris
https://github.com/ksh93/ksh/issues/132
* wrong typeset -p output after unsetting multidimensional array elements
https://github.com/ksh93/ksh/issues/148
* File descriptor is unexpectedly closed after exec in subshell
https://github.com/ksh93/ksh/issues/161
* printf %T date parsing: GNU-style "ago" date spec completely broken
https://github.com/ksh93/ksh/issues/182
* typeset -L/-R: string length breaks on multibyte characters
https://github.com/ksh93/ksh/issues/189
* Linux i386: variable expansion corruption in single-line function
https://github.com/ksh93/ksh/issues/203
* Segfault with very large extended glob patterns
https://github.com/ksh93/ksh/issues/207
* funcname.ksh crashes under standard malloc
https://github.com/ksh93/ksh/issues/212
* process substitution cannot be part of a larger argument
https://github.com/ksh93/ksh/issues/215
* Compound array regression on OpenBSD with standard malloc
https://github.com/ksh93/ksh/issues/229
* 'typeset -m'-related crash on OpenBSD compiled with standard malloc
https://github.com/ksh93/ksh/issues/231
* Freeze/crash on OpenBSD with -D_std_malloc involving typeset and command substitution
https://github.com/ksh93/ksh/issues/264
* Nested compound assignment misparsed in $(...) command substitution
https://github.com/ksh93/ksh/issues/269
* Crash on bin/shtests -px heredoc
https://github.com/ksh93/ksh/issues/306
* Multibyte characters get corrupted when KEYBD trap is set
https://github.com/ksh93/ksh/issues/307
* .sh.match index array result issues, crash after unset
https://github.com/ksh93/ksh/issues/308
* Builtins don't handle I/O errors
https://github.com/ksh93/ksh/issues/313
* block devices not seekable when open on fd 0, 1 or 2
https://github.com/ksh93/ksh/issues/318
* bug in printf when %b and %x$ are used in same format
https://github.com/ksh93/ksh/issues/324
* namespaces don't work properly when defined within functions
https://github.com/ksh93/ksh/issues/325
* Associative arrays of various types fail to be unset
https://github.com/ksh93/ksh/issues/345
* types survive exec of hashbangless script
https://github.com/ksh93/ksh/issues/350
* Backtick command substitutions can't nest double quotes
https://github.com/ksh93/ksh/issues/352
* Line continuation breakage within $(comsub)
https://github.com/ksh93/ksh/issues/367
______
Fix regression test failures:
- There are many regression test failures on NetBSD.
- There are some serious regression test failures on OpenBSD when ksh
is compiled with AST vmalloc disabled, so the system standard malloc(3)
is used. These probably represent real ksh93 bugs exposed by OpenBSD's
security hardening mechanisms.
______
Fix build system:
- ksh does not currently build on QNX.
- Several known memory leaks have their tests disabled in tests/leaks.sh
and are marked TODO. These need tracking down and fixing.
______
Fix currently known bugs affecting shell scripting. These are identified by
@ -23,12 +117,6 @@ https://github.com/modernish/modernish/tree/0.16/lib/modernish/cap/
initial ! (and, on some shells, ^) retains the meaning of negation, even
in quoted strings within bracket patterns, including quoted variables.
- BUG_CSUBSTDO: If standard output (file descriptor 1) is closed before
entering a $(command substitution), and any other file descriptors are
redirected within the command substitution, commands such as 'echo' will
not work within the command substitution, acting as if standard output is
still closed.
- BUG_IFSGLOBS: In glob pattern matching (as in case or parameter
substitution with # and %), if IFS starts with ? or * and the "$*"
parameter expansion inserts any IFS separator characters, those characters

View file

@ -0,0 +1,30 @@
#!/usr/bin/env sh
IFS=''; set -fCu # safe mode: no split/glob = no quoting headaches
CCn='
' # newline
let() { return $((!($1))); }
# Remove unused variable definitions from a Mamfile.
# Usage: Mamfile_rm_unused_vars <Mamfile >Mamfile.new
#
# Should work on all current POSIX compliant shells.
# By Martijn Dekker <martijn@inlv.org>, 2021. Public domain.
#
# All variables are declared with 'setv' and they are used if an expansion
# of the form ${varname} exists (the braces are mandatory in Mamfiles).
mamfile=$(let $# && cat "$1" || cat)
vars=$(printf '%s\n' $mamfile | awk '$1 == "setv" { print $2; }')
rm_unused_ere=
IFS=$CCn; for varname in $vars; do IFS=
case $mamfile in
*"\${$varname}"* )
;;
* ) # add with '|' separator for Extended Regular Expression
rm_unused_ere="${rm_unused_ere:+$rm_unused_ere|}setv[[:blank:]]+$varname([[:blank:]]|$)" ;;
esac
done
case $rm_unused_ere in
'') printf '%s\n' $mamfile ;;
*) printf '%s\n' $mamfile | grep -vE $rm_unused_ere ;;
esac

View 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 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

View 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 #

File diff suppressed because it is too large Load diff

View 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

View file

@ -32,7 +32,7 @@ are Linux, System V Release 4, Solaris, Sun OS, HP-UX Release 8 and above,
AIX 3.2 and above, and Microsoft Windows systems.
<P>
This memo describes how to write and compile programs
that can be loaded into <TT>ksh</TT> at run time as built-in
that can be loaded into <TT>ksh</TT> at run time as built-in
commands.
<P>
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="INTRODUCTION">INTRODUCTION</A></H3></FONT></FONT></CENTER>
@ -93,7 +93,7 @@ The development kit has three directories,
It is best to set the value of the environment variable
<TT>PACKAGE_ast</TT> to the pathname of the directory
containing the development kit.
The <TT>include</TT> directory contains a sub-directory
The <TT>include</TT> directory contains a subdirectory
named <TT>ast</TT> that contains interface prototypes
for functions that you can call from built-ins. The <TT>lib</TT>
directory contains the <TT>ast</TT> library
@ -128,7 +128,7 @@ to terminate your command.
The return value will become the exit status of the command.
The <TT>open</TT> built-in, installed in <TT>lib/ksh</TT> in the AST Toolkit, uses this method.
The <TT>Shbltin_t</TT> structure contains a field named <TT>shp</TT> which is
a pointer the the shell data that is needed for <TT>shell</TT> library callbacks.
a pointer to the shell data that is needed for <TT>shell</TT> library callbacks.
It also contains the fields, <TT>shrun</TT>, <TT>shtrap</TT>, <TT>shexit</TT>,
and <TT>shbltin</TT>
that are function pointers to the <TT>shell</TT> library functions <TT>sh_run</TT>, <TT>sh_trap</TT>
@ -273,7 +273,7 @@ The development kit provides a portable interface
to the C library and to libast.
The header files in the development kit are compatible with
K&amp;R C<FONT SIZE=-6>[3]</FONT>,
ANSI-C<FONT SIZE=-6>[4]</FONT>,
ANSI C<FONT SIZE=-6>[4]</FONT>,
and C++<FONT SIZE=-6>[5]</FONT>.
<P>
The best thing to do is to include the header file <TT>&lt;shell.h&gt;</TT>.
@ -285,7 +285,7 @@ services for your builtins.
The header file <TT>&lt;ast.h&gt;</TT>
provides prototypes for many <STRONG>libast</STRONG> functions
and all the symbol and function definitions from the
ANSI-C headers, <TT>&lt;stddef.h&gt;</TT>,
ANSI C headers, <TT>&lt;stddef.h&gt;</TT>,
<TT>&lt;stdlib.h&gt;</TT>, <TT>&lt;stdarg.h&gt;</TT>, <TT>&lt;limits.h&gt;</TT>,
and <TT>&lt;string.h&gt;</TT>.
It also provides all the symbols and definitions for the
@ -311,7 +311,7 @@ the Safe/Fast I/O library<FONT SIZE=-6>[7]</FONT>,
to perform all I/O operations.
The <STRONG>sfio</STRONG> library, which is part of <STRONG>libast</STRONG>,
provides a superset of the functionality provided by the standard
I/O library defined in ANSI-C.
I/O library defined in ANSI C.
If none of the additional functionality is required,
and if you are not familiar with <STRONG>sfio</STRONG> and
you do not want to spend the time learning it,
@ -412,7 +412,7 @@ The variable <TT>opt_info.num</TT> will contain this
value after the given argument is encountered.
<DT><TT>?</TT><DD>
Used after a <TT>:</TT> or <TT>#</TT> (and after the optional <TT>?</TT>)
to indicate the the
to indicate the
preceding option argument is not required.
<DT><TT>&#0091;</TT>...<TT>&#0093;</TT><DD><BR>
After a <TT>:</TT> or <TT>#</TT>, the characters contained
@ -458,7 +458,7 @@ while(1) switch(n=optget(argv,"xf:&#0091;file&#0093;"))
break;
case '?':
error(ERROR_usage(2), opt_info.arg);
break;
UNREACHABLE();
}
</DIV>
</PRE>
@ -521,7 +521,7 @@ The <STRONG>shell</STRONG> library is used to access other shell services.
<P>
<H4><A name="The nval library">The nval library</A></H4>
A great deal of power is derived from the ability to use
portions of the hierarchal variable namespace provided by <TT>ksh-93</TT>
portions of the hierarchical variable namespace provided by <TT>ksh-93</TT>
and turn these names into active objects.
<P>
The <STRONG>nval</STRONG> library is used to interface with shell
@ -544,7 +544,7 @@ using this handle so that the space can be freed once
the value is unset.
The two most frequent operations are to get the value of
the variable, and to assign value to the variable.
The <TT>nv_getval()</TT> returns a pointer the the
The <TT>nv_getval()</TT> function returns a pointer to the
value of the variable.
In some cases the pointer returned is to a region that
will be overwritten by the next <TT>nv_getval()</TT> call
@ -593,7 +593,7 @@ The <TT>getval()</TT>
function is called by <TT>nv_getval()</TT>
value and must return a string.
The <TT>getnum()</TT>
function is called by by the arithmetic evaluator
function is called by the arithmetic evaluator
and must return double.
If omitted, then it will call <TT>nv_getval()</TT> and
convert the result to a number.

View file

@ -101,7 +101,7 @@ the man page for ksh93 is kept up to date.
The only major new interactive features are key binding and tab completion.
Major new language features are floating point arithmetic,
associative arrays, complete ANSI-C printf, name reference
associative arrays, complete ANSI C printf, name reference
variables, new expansion operators, dynamic loading of
built-in commands, active variables, and compound variables.
Active and compound variables allow shell variables to
@ -164,7 +164,7 @@ bash compatibility mode.
</UL>
<LI>
<EM>version</EM>--
a lower-case letter signifying major release points.
a lowercase letter signifying major release points.
An optional <STRONG>-</STRONG> following <EM>features</EM> signifies an alpha release.
The first stable release has no <STRONG>-</STRONG>.
An optional <STRONG>+</STRONG> signifies a stable release with bug patches and minor enhancements.
@ -180,7 +180,7 @@ in a numeric context is an integer that encodes the release
<DT>What new features are planned for ksh?<DD>
We are in the early stage of planning but the likely additions
are namespaces, ability to read xml and json object into shell variables,
are namespaces, ability to read XML and JSON object into shell variables,
and handling of queued signals.
Support for multi-threading is also being considered.
@ -254,7 +254,7 @@ that supports a subset of the 1988 KornShell language.
ksh has been written to be portable.
It has been ported to virtually run on every known UNIX system.
In addition it runs on non-UNIX systems such as IBM's MVS using OpenEdition, and
In addition, it runs on non-UNIX systems such as IBM's MVS using OpenEdition, and
Microsoft's Windows 9X, Windows NT and Windows 2000.
ksh is part of the UWIN (Unix for Windows)</A>
software,
@ -389,7 +389,7 @@ If you run
kill -l $?
</DIV>
</PRE>
on this signal number, it will give the the name of the signal
on this signal number, it will give the name of the signal
that caused this exit.
<DT>When I type builtin, I notice that some of these are full pathnames. What does this mean?<DD>
@ -464,7 +464,7 @@ is to make the command a builtin. On systems in which the cmd
library is installed, you can invoke 'builtin &#45;f cmd mv' to make
mv a shell builtin in which case the line length limit no longer
applies. Another alternative is to use a for loop and invoke
the mv command for each file, for exampe,
the mv command for each file, for example,
'for i in *;do mv $i ../elsewhere;done'.
Starting with ksh93o+, a new feature was added to ksh to overcome
this limit in some cases. If a command is preceded by
@ -549,9 +549,9 @@ read x
The $'...' string literal syntax was added to ksh93 to solve the problem
of entering special characters in scripts.
It uses
ANSI-C rules to translate the string between the '...'.
ANSI C rules to translate the string between the '...'.
It would have been cleaner to have all "..." strings handle
ANSI-C escapes, but that would not be backward compatible.
ANSI C escapes, but that would not be backward compatible.
<DT>What is the -n option used for?<DD>
@ -600,7 +600,7 @@ hand side, which removes the special meaning of pattern match
characters, then this becomes a string comparison so that
&#0091;&#0091; "$foo" == "bar" &#0093;&#0093; and &#0091;&#0091; "$bar" == "$foo" &#0093;&#0093; are equivalent.
<DT>Why does ksh93 have print since echo already exists is is widely used?<DD>
<DT>Why does ksh93 have print since echo already exists and is widely used?<DD>
The behavior of echo varies from system to system.
The POSIX standard does not define the behavior of echo when
@ -620,7 +620,7 @@ as if you had invoked it as echo foo | (read bar).
<DT>How can I access a substring of a variable?<DD>
The syntax ${varname:offset:len} can be used to generate
the string of length len starting at the the specified
the string of length len starting at the specified
offset. String offsets start at 0. If :len is omitted,
then the remainder of the string will be used. Both offset
and len can be arithmetic expressions. A negative offset is
@ -771,9 +771,9 @@ or indexed, use ${!var&#0091;@&#0093;}.
<DT>How do I do global substitutions on the contents of shell variables?<DD>
Use // instead of / for global substitution, ${var//aa/bb} will
expand to the value of with each "aa" replace by "bb".
expand to the value of var with each "aa" replaced by "bb".
<DT>How can I convert %XX values to ascii?<DD>
<DT>How can I convert %XX values to ASCII?<DD>
You can convert this to a sequence of ANSI C strings and then eval that
string, for example suppose the variable 'foo' contains %XX strings, then
@ -782,7 +782,7 @@ string, for example suppose the variable 'foo' contains %XX strings, then
eval print -r -- "\$'${foo//'%'@(??)/'\x\1"'\$'"}'"
</DIV>
</PRE>
will print out the string in ascii.
will print out the string in ASCII.
<DT>I want to use exec to open a file. How do I prevent the script from exiting if the exec fails?<DD>
@ -894,19 +894,19 @@ Alternatively, &lt;# and &gt;# can be followed by a shell pattern. In this
case, the file will be positioned to beginning of the next line
containing this pattern.
<DT>What is the the &lt;&lt;&lt; redirection operator?<DD>
<DT>What is the &lt;&lt;&lt; redirection operator?<DD>
It denotes a here-document in which the document is contained the
argument that follows &lt;&lt;&lt; and therefore there is no delimiter.
<DT>What is the the &gt;; redirection operator?<DD>
<DT>What is the &gt;; redirection operator?<DD>
This operator writes the output into a temporary file in the same
directory as the file specified after &gt;;. If the command completes
successfully, then the the file is replaced. Otherwise, the
successfully, then the file is replaced. Otherwise, the
original file is unchanged and the temporary file removed.
<DT>What is the the &lt;&gt;; redirection operator?<DD>
<DT>What is the &lt;&gt;; redirection operator?<DD>
The file is opened for reading and writing as with &lt;&gt;. However,
when the file is closed it is truncated to the its current location.

View file

@ -21,7 +21,7 @@ dd { margin-left:3em; }
<P><CENTER><FONT color=red><FONT face=courier><H3><A name="ksh features">ksh features</A></H3></FONT></FONT></CENTER>
KSH-93 is the most recent version of the KornShell Language described in
<EM>The KornShell Command and Programming Language</EM>,
by Morris Bolsky and David Korn of AT&amp;T Research (nee Bell Laboratories).
by Morris Bolsky and David Korn of AT&amp;T Research.
The KornShell is a shell programming language,
which is upward compatible with
<EM>sh</EM>
@ -39,7 +39,7 @@ In addition,
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
@ -120,7 +120,7 @@ Almost the complete set of C language operators are available
with the same syntax and precedence.
Arithmetic expressions can be used to as an argument expansion
or as a separate command.
In addition there is an arithmetic for command that works
In addition, there is an arithmetic for command that works
like the for statement in C.
<P>

View file

@ -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

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,12 +0,0 @@
INIT :PACKAGE:
:CATEGORY: admin utils
:INDEX: the package command with support scripts and utilities
:DESCRIPTION:
The INIT package is required by all but the standalone
and self extracting archive packages. It contains
the package command, support scripts, and utilities.
The package command installs binary packages, makes
source packages, and generates new package tarballs.

View file

@ -1 +0,0 @@
INIT 2012-08-01 2012-08-01 1

View file

@ -1,11 +0,0 @@
ast-ast :PACKAGE: libast
:LICENSE: *.open
:CATEGORY: devel libs
:INDEX: the ast library, period
:DESCRIPTION:
The AT&T Software Technology ast-ast package from AT&T Research
contains the ast library.

View file

@ -1,22 +0,0 @@
ast-base :PACKAGE: \
ksh93 pax html proto bzip tw builtin libast libardir libcmd \
libdll libexpr libodelta librecsort libsum libuu libvdelta \
libbz libz tests 3d coshell cpp cs mam msgcc nmake probe ss \
libcoshell libcs libmam libpp libcodex paxlib codexlib \
libdss libpz dsslib libtaso
:COVERS: ast-make ast-ksh ast-ast
:LICENSE: *.open
:CATEGORY: devel libs shells
:INDEX: ksh, ksh builtin commands, pax, nmake, tw, sfio, and ast libraries
:DESCRIPTION:
The AT&T Software Technology ast-base package from AT&T Research
contains commands and libraries required by all other ast based
packages. Included are ksh93, ksh93 builtin commands, a pax that
generates compact delta archives, nmake, the 3d user level versioning
filesystem, coshell for network execution, a multi-dialect C preprocessor
and companion library, and libraries shared by the other ast packages.

View file

@ -1 +0,0 @@
ast-base 2012-08-01 2012-08-01 1

View file

@ -1,13 +0,0 @@
ast-dss :PACKAGE: dss libdss libpz dsslib
:REQUIRES: ast-base
:LICENSE: *.(open|proprietary|special)
:CATEGORY: algorithms database utils
:INDEX: data stream scan command and support libraries
:DESCRIPTION:
The AT&T Software Technology ast-dss package from AT&T Research
contains the dss command, plugins and support libraries.

View file

@ -1,89 +0,0 @@
ast-ksh :PACKAGE: ksh93 libast libcmd libcoshell libsum libdll
:COVERS: ksh
:LICENSE: *.open
:CATEGORY: shells
:INDEX: ksh and support libraries
:DESCRIPTION:
The AT&T Software Technology ast-ksh package from AT&T Research
contains ksh and support libraries. This is the minimal set of
components needed to build ksh.
:DETAILS: cyg
:README:
This package installs a standalone ksh93 executable ksh93.exe
and its man page ksh93.1. If /bin/ksh.exe does not exist then
these symlinks
/bin/ksh.exe => ksh93.exe
/usr/share/man/man1/ksh93.1 => ksh.1
are created. This allows alternative ksh impelementations,
e.g., /bin/pdksh.exe, to be selected by changing the ksh.exe
and ksh.1 symbolic links. In addition, ksh and ksh93 paths are
added to /etc/shells if not already present.
$()
Each builtin or special command accepts the --man and --html
options to list the man page on the standard error. The --???
option describes the self documenting options available to all
builtin and special commands.
$()
The stanadlone ksh is statically linked with the ast libcmd
library which provides several builtin versions of /bin
commands. "builtin | grep /opt/ast/bin" lists the libcmd
builtins on the standard output. /opt/ast/bin/FOO accesses
the FOO builtin, whether the /opt/ast/bin directory exists
or not. "builtin FOO" allows /opt/ast/bin/FOO to be accessed
as FOO, bypassing the $PATH setting. To enable all libcmd
builtins do one of the following:
(a) create the directory /opt/ast/bin and the file
/opt/ast/bin/.paths with this line
BUILTIN_LIB=.
and place /opt/ast/bin before /bin and /usr/bin in $PATH
(this will affect all ksh subshells and scripts)
(b) run "builtin $( builtin | sed -e '/\//!d' -e 's,.*/,,' )"
(this will affect only the current shell)
Some scripts may run significantly faster with libcmd builtins
enabled.
$()
The ast library checks the DOSPATHVARS environment variable
for variable path values to convert to and from native windows
format when cross-executing between cygwin and non-cygwin
programs. The value is a space separated list of environment
variables to convert. PATH is handled by cygwin so it is not
converted by the ast library.
$()
The astksh cygwin source package provides a bootstrap build
environment that is not suited for an edit/build/debug cycle.
If you want to explore and modify the source then you should
install the (non-cygwinized) ast-base package which includes
AT&T nmake. With ast-base you will also be able to regenerate
the astksh cygwin source and binary packages.
$()
For more information on ksh and other AT&T ast tools see
http://www.research.att.com/sw/download/
:EXPORT:
SHOPT_CMDLIB_DIR=1
bin/ksh93.exe :INSTALL: bin/ksh.exe
share/man/man1/ksh93.1 :INSTALL: man/man1/sh.1
:POSTINSTALL:
if [ ! -e /bin/ksh.exe ]
then ln -fs ksh93.exe /bin/ksh.exe
ln -fs ksh93.1 /usr/share/man/man1/ksh.1
else echo "/bin/ksh.exe already exists"
fi
if [ -f /etc/shells ]
then for i in /bin/ksh93 /bin/ksh /usr/bin/ksh93 /usr/bin/ksh
do if grep $i /etc/shells >/dev/null 2>&1
then echo "$i already in /etc/shells"
else echo $i >> /etc/shells
echo "$i added to /etc/shells"
fi
done
else echo "no /etc/shells file"
fi
exit 0
:TEST: bin/ksh
KSH=$<; cd src/cmd/ksh93/tests; CYGWIN="$$CYGWIN ntsec binmode" SHELL=$$KSH $$KSH shtests

View file

@ -1 +0,0 @@
ast-ksh 2012-08-01 2012-08-01 1

View file

@ -1,19 +0,0 @@
ast-make :PACKAGE: \
nmake cpp probe 3d ksh93 coshell cs ss pax paxlib tw \
libast libardir libcmd libsum libdll libcoshell libpp
:AUXILIARY: bin/proto bin/pax
:LICENSE: *.open
:COVERS: ast-ksh ast-ast
:CATEGORY: devel libs shells
:INDEX: ksh, pax, nmake
:DESCRIPTION:
The AT&T Software Technology ast-make package from AT&T Research
contains an almost minimal set of commands and libraries required
to run ast nmake. ksh, coshell, pax, tw, and the 3d user-level
filesystem are also included.

View file

@ -1,20 +0,0 @@
ast-open :PACKAGE: \
ksh93 kshlib pax html proto bzip libast libardir libcmd libdll \
libexpr libodelta librecsort libsum libuu libvdelta libbz \
libz tests 3d coshell cpp cs mam msgcc nmake probe ss \
libcoshell libcs libmam libpp libcodex paxlib codexlib \
at builtin codex dss dsslib ie mailx mam ncsl pack pzip \
re sort sortlib std tksh tw warp libdss libpz \
libtksh libtk vczip libvcodex libvgraph libtaso jcl libjcl
:COVERS: ast-base ast-dss
:LICENSE: *.open
:CATEGORY: devel libs mail shells utils
:INDEX: ksh, pax, nmake, sfio, and ast open source commands and libraries
:DESCRIPTION:
The AT&T Software Technology ast-open package from AT&T Research
contains all of the ast open source commands and libraries.

View file

@ -1 +0,0 @@
ast-open 2012-08-01 2012-08-01 1

View file

@ -1,49 +0,0 @@
#
# ast default license info
#
message_set=3
contributor+=(
[gsf]="Glenn Fowler <gsf@research.att.com>"
[dgk]="David Korn <dgk@research.att.com>"
[kpv]="Phong Vo <kpv@research.att.com>"
[aedgar]="Adam Edgar <aedgar@research.att.com>"
[alb]="Adam Buchsbaum <alb@adambuchsbaum.com>"
[ashaikh]="Aman Shaikh <ashaikh@research.att.com>"
[bala]="Bala Krishnamurthy <bala@research.att.com>"
[brussell]="Brian Russell <brussell@research.att.com>"
[chen]="Robin Chen <chen@research.att.com>"
[dfwc]="Don Caldwell <dfwc@research.att.com>"
[ek]="Lefty Koutsofios <ek@research.att.com>"
[gruber]="Bob Gruber <bob.gruber@gmail.com>"
[jiawang]="Jia Wang <jiawang@research.att.com>"
[jkf]="Jeff Fellin <jkf@research.att.com>"
[jlk]="Jeff Korn <@google.com>"
[kfisher]="Kathleen Fisher <kfisher@research.att.com>"
[kwc]="Ken Church <@microsoft.com>"
[bwk]="Brian Kernigham <bwk@research.bell-labs.com>"
[dmr]="Dennis Ritchie <dmr@research.bell-labs.com>"
[doug]="Doug McIlroy <doug@research.bell-labs.com>"
[ekrell]="Eduardo Krell <ekrell@adexus.cl>"
[jjs]="John Snyder <jjs@adexus.cl>"
[rao]="Herman Rao <rao@fareastone.att.com.tw>"
[ast-users]="AST users mailgroup <ast-users@research.att.com>"
[ast-developers]="AST developers mailgroup <ast-developers@research.att.com>"
)
license+=(
organization="Information and Software Systems Research"
domain=research.att.com
parent="AT&T"
corporation="Intellectual Property"
company="Research"
location="Florham Park NJ"
package=ast
since=1986
author=gsf+dgk+kpv
)

View file

@ -1,5 +0,0 @@
. ast.def
. epl.def
license+=(
start=2011
)

View file

@ -1,45 +0,0 @@
message_set=18
contributor+=(
[bj]="Bill Joy"
)
license+=(
company="The Regents of the University of California"
package=BSD
since=1979
type=bsd
name="${license.package} Open Source"
url=http://www.opensource.org/licenses/bsd-license
urlmd5=5bfd485a7ffdb6249d1097da94ae75fc
notice='
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
3. Neither the name of the University nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
'
)

View file

@ -1 +0,0 @@
. bsd.def

View file

@ -1,8 +0,0 @@
license+=(
type=epl
id=eclipse
name="Eclipse Public License"
version=1.0
url=http://www.eclipse.org/org/documents/${license.type}-v${license.version//./}.html
urlmd5=b35adb5213ca9657e911e9befb180842
)

View file

@ -1,14 +0,0 @@
ksh :PACKAGE:
:LICENSE: *.open
:CATEGORY: shells
:INDEX: standalone AT&T ksh executable
:DESCRIPTION:
The AT&T Software Technology ksh package from AT&T Research
contains the AT&T ksh executable implemented by David Korn.
The download file is a gzipped ksh executable. If you want
to build ksh from the source then download one of the ast-ksh,
ast-base or ast-open packages.

File diff suppressed because it is too large Load diff

View file

@ -1,39 +0,0 @@
message_set=20
contributor+=(
[jlg]="Jean-loup Gailly"
[ma]="Mark Adler"
)
license+=(
company="Jean-loup Gailly and Mark Adler"
package=zlib
since=1995
type=zlib
name="${license.package} Open Source"
url=http://www.opensource.org/licenses/Zlib
urlmd5=4cfd2c17b0340c2f3c80b577a8e45bee
notice='
This software is provided "as-is", without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would
be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not
be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
'
)

View file

@ -1 +0,0 @@
. zlib.def

View file

@ -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

View file

@ -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

View file

@ -1,2 +0,0 @@
/* stub for pre-2000-05-01 nmake */
":MSGFUN:" : .MAKE .OPERATOR

View file

@ -1,2 +0,0 @@
/* stub for pre-2000-05-01 nmake */
":MSGKEY:" : .MAKE .OPERATOR

View file

@ -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

View file

@ -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))

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,6 +0,0 @@
: linux.i386-64 ar wrapper
case $1 in
*x*) /usr/bin/ar "$@" ;;
*) /usr/bin/ar U"$@" ;;
esac

View file

@ -1,6 +0,0 @@
: linux.i386-64 ar wrapper
case $1 in
*x*) /usr/bin/ar "$@" ;;
*) /usr/bin/ar U"$@" ;;
esac

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,9 +0,0 @@
: FreeBSD cc wrapper
HOSTTYPE=freebsd.generic
case " $* " in
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
esac
exec /usr/bin/cc -P "$@"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 '' "$@" ''

View file

@ -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

View file

@ -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 "$@"

View file

@ -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 "$@"

View file

@ -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 "$@"

View file

@ -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 "$@"

View file

@ -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 "$@"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -1,9 +0,0 @@
: OpenBSD cc wrapper
HOSTTYPE=openbsd.generic
case " $* " in
*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
esac
exec /usr/bin/cc -P "$@"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 "$@"

View file

@ -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 "$@"

View file

@ -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 "$@"

View file

@ -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 "$@"

View 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 #
@ -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

View 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 *

View file

@ -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

View 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 *

View 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 #
@ -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).

View 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 #
@ -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

View 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 *

View 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 *

View 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 *

View 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 *

View file

@ -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
;;
esac
done

View 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 *

File diff suppressed because it is too large Load diff

View file

@ -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>

View 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 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

View 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 *

Some files were not shown because too many files have changed in this diff Show more