From bf00d3b274856780eb8346b466f8f44b3c37e6e9 Mon Sep 17 00:00:00 2001 From: Martijn Dekker Date: Sun, 2 Jan 2022 14:34:46 +0100 Subject: [PATCH] dtksh: Upgrade ksh93 to 1.0.0-beta.2 2021-12-28 Patch from current ksh93 maintainer . 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. --- cde/programs/dtksh/Makefile.am | 20 +- cde/programs/dtksh/dtkcmds.h | 2 +- cde/programs/dtksh/init.patch | 47 - .../dtksh/ksh93/.github/workflows/ci.yml | 13 + cde/programs/dtksh/ksh93/.gitignore | 26 +- cde/programs/dtksh/ksh93/ANNOUNCE | 249 + cde/programs/dtksh/ksh93/COPYRIGHT | 146 + cde/programs/dtksh/ksh93/LICENSE.md | 16 +- cde/programs/dtksh/ksh93/NEWS | 790 ++- cde/programs/dtksh/ksh93/README.md | 37 +- cde/programs/dtksh/ksh93/TODO | 114 +- .../dtksh/ksh93/bin/Mamfile_rm_unused_vars | 30 + cde/programs/dtksh/ksh93/bin/ignore | 11 +- cde/programs/dtksh/ksh93/bin/mamprobe | 1 + cde/programs/dtksh/ksh93/bin/package | 5041 ++-------------- cde/programs/dtksh/ksh93/bin/silent | 11 +- .../dtksh/ksh93/docs/ksh/builtins.html | 22 +- cde/programs/dtksh/ksh93/docs/ksh/faq.html | 34 +- .../dtksh/ksh93/docs/ksh/features.html | 6 +- .../dtksh/ksh93/lib/package/CONVERT.mk | 260 - .../dtksh/ksh93/lib/package/INIT.README | 1029 ---- .../dtksh/ksh93/lib/package/INIT.html | 1007 ---- cde/programs/dtksh/ksh93/lib/package/INIT.pkg | 12 - cde/programs/dtksh/ksh93/lib/package/INIT.req | 0 cde/programs/dtksh/ksh93/lib/package/INIT.ver | 1 - .../dtksh/ksh93/lib/package/ast-ast.pkg | 11 - .../dtksh/ksh93/lib/package/ast-base.pkg | 22 - .../dtksh/ksh93/lib/package/ast-base.req | 0 .../dtksh/ksh93/lib/package/ast-base.ver | 1 - .../dtksh/ksh93/lib/package/ast-dss.pkg | 13 - .../dtksh/ksh93/lib/package/ast-ksh.pkg | 89 - .../dtksh/ksh93/lib/package/ast-ksh.req | 0 .../dtksh/ksh93/lib/package/ast-ksh.ver | 1 - .../dtksh/ksh93/lib/package/ast-make.pkg | 19 - .../dtksh/ksh93/lib/package/ast-open.pkg | 20 - .../dtksh/ksh93/lib/package/ast-open.req | 0 .../dtksh/ksh93/lib/package/ast-open.ver | 1 - cde/programs/dtksh/ksh93/lib/package/ast.def | 49 - cde/programs/dtksh/ksh93/lib/package/ast.lic | 5 - cde/programs/dtksh/ksh93/lib/package/bsd.def | 45 - cde/programs/dtksh/ksh93/lib/package/bsd.lic | 1 - cde/programs/dtksh/ksh93/lib/package/epl.def | 8 - cde/programs/dtksh/ksh93/lib/package/ksh.pkg | 14 - .../dtksh/ksh93/lib/package/package.mk | 1537 ----- cde/programs/dtksh/ksh93/lib/package/zlib.def | 39 - cde/programs/dtksh/ksh93/lib/package/zlib.lic | 1 - .../dtksh/ksh93/src/cmd/INIT/CONVERT.mk | 260 - .../dtksh/ksh93/src/cmd/INIT/MAPLIB.mk | 45 - .../dtksh/ksh93/src/cmd/INIT/MSGFUN.mk | 2 - .../dtksh/ksh93/src/cmd/INIT/MSGKEY.mk | 2 - cde/programs/dtksh/ksh93/src/cmd/INIT/Mamfile | 301 +- .../dtksh/ksh93/src/cmd/INIT/PROBE.mk | 13 - cde/programs/dtksh/ksh93/src/cmd/INIT/RELEASE | 92 +- cde/programs/dtksh/ksh93/src/cmd/INIT/TEST.mk | 197 - cde/programs/dtksh/ksh93/src/cmd/INIT/WWW.mk | 450 -- .../ksh93/src/cmd/INIT/ar.freebsd12.amd64 | 6 - .../dtksh/ksh93/src/cmd/INIT/ar.linux.i386-64 | 6 - .../dtksh/ksh93/src/cmd/INIT/cc.darwin | 52 - .../dtksh/ksh93/src/cmd/INIT/cc.darwin07 | 71 - .../dtksh/ksh93/src/cmd/INIT/cc.darwin11 | 71 - .../dtksh/ksh93/src/cmd/INIT/cc.freebsd | 9 - .../dtksh/ksh93/src/cmd/INIT/cc.hp.ia64 | 4 +- .../dtksh/ksh93/src/cmd/INIT/cc.hp.pa | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.hp.pa64 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.ibm.risc | 4 +- .../dtksh/ksh93/src/cmd/INIT/cc.ibm.risc.gcc | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.linux.aarch64 | 9 - .../dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64 | 9 - .../ksh93/src/cmd/INIT/cc.linux.i386-64-icc | 22 - .../ksh93/src/cmd/INIT/cc.linux.i386-icc | 22 - .../ksh93/src/cmd/INIT/cc.linux.ia64-icc | 22 - .../dtksh/ksh93/src/cmd/INIT/cc.mvs.390 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.next.i386 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.next.m68k | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.openbsd | 9 - .../dtksh/ksh93/src/cmd/INIT/cc.sgi.mips2 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3-o32 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4-n32 | 2 +- .../dtksh/ksh93/src/cmd/INIT/cc.sol11.i386 | 18 - .../dtksh/ksh93/src/cmd/INIT/cc.sol11.i386-64 | 18 - .../dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc | 18 - .../ksh93/src/cmd/INIT/cc.sol11.sparc-64 | 18 - .../dtksh/ksh93/src/cmd/INIT/crossexec.sh | 5 +- cde/programs/dtksh/ksh93/src/cmd/INIT/db.c | 1 + .../dtksh/ksh93/src/cmd/INIT/ditto.sh | 460 -- cde/programs/dtksh/ksh93/src/cmd/INIT/dl.c | 1 + .../dtksh/ksh93/src/cmd/INIT/execrate.sh | 11 +- .../dtksh/ksh93/src/cmd/INIT/filter.sh | 5 +- cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm1.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm2.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/hello.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/hurl.sh | 209 - cde/programs/dtksh/ksh93/src/cmd/INIT/iconv.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.sh | 840 +-- .../dtksh/ksh93/src/cmd/INIT/iffe.tst | 212 +- .../dtksh/ksh93/src/cmd/INIT/ignore.sh | 11 +- cde/programs/dtksh/ksh93/src/cmd/INIT/intl.c | 1 + .../dtksh/ksh93/src/cmd/INIT/ldd.cygwin.i386 | 2 +- .../dtksh/ksh93/src/cmd/INIT/ldd.darwin | 2 +- cde/programs/dtksh/ksh93/src/cmd/INIT/m.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/m2.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/m3.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/m4.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/m5.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/m6.c | 1 + .../dtksh/ksh93/src/cmd/INIT/make.probe | 162 +- .../dtksh/ksh93/src/cmd/INIT/mamake.c | 74 +- .../dtksh/ksh93/src/cmd/INIT/mamprobe.sh | 1 + .../dtksh/ksh93/src/cmd/INIT/mktest.sh | 7 +- .../dtksh/ksh93/src/cmd/INIT/mprobe.sh | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/nsl.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/p.c | 1 + .../dtksh/ksh93/src/cmd/INIT/package.mk | 1537 ----- .../dtksh/ksh93/src/cmd/INIT/package.sh | 5040 ++-------------- .../dtksh/ksh93/src/cmd/INIT/probe.win32 | 13 +- cde/programs/dtksh/ksh93/src/cmd/INIT/proto.c | 5289 ---------------- .../dtksh/ksh93/src/cmd/INIT/proto.sh | 35 + cde/programs/dtksh/ksh93/src/cmd/INIT/ratz.c | 5312 ----------------- .../dtksh/ksh93/src/cmd/INIT/regress.sh | 9 +- .../dtksh/ksh93/src/cmd/INIT/release.c | 367 -- cde/programs/dtksh/ksh93/src/cmd/INIT/rt.sh | 9 +- .../dtksh/ksh93/src/cmd/INIT/silent.sh | 11 +- .../dtksh/ksh93/src/cmd/INIT/socket.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/w.c | 1 + cde/programs/dtksh/ksh93/src/cmd/INIT/w2.c | 1 + .../dtksh/ksh93/src/cmd/builtin/Mamfile | 41 +- .../dtksh/ksh93/src/cmd/builtin/RELEASE | 2 +- .../dtksh/ksh93/src/cmd/builtin/features/pty | 7 +- .../dtksh/ksh93/src/cmd/builtin/pty.c | 76 +- .../dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY | 137 +- cde/programs/dtksh/ksh93/src/cmd/ksh93/DESIGN | 6 +- .../dtksh/ksh93/src/cmd/ksh93/Mamfile | 451 +- .../dtksh/ksh93/src/cmd/ksh93/OBSOLETE | 4 +- .../dtksh/ksh93/src/cmd/ksh93/PROMO.mm | 8 +- cde/programs/dtksh/ksh93/src/cmd/ksh93/README | 273 +- .../dtksh/ksh93/src/cmd/ksh93/RELEASE | 190 +- .../dtksh/ksh93/src/cmd/ksh93/RELEASE88 | 26 +- .../dtksh/ksh93/src/cmd/ksh93/RELEASE93 | 13 +- .../dtksh/ksh93/src/cmd/ksh93/SHOPT.sh | 14 +- cde/programs/dtksh/ksh93/src/cmd/ksh93/TYPES | 6 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/alarm.c | 14 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/cd_pwd.c | 118 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/cflow.c | 51 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/enum.c | 90 +- .../ksh93/src/cmd/ksh93/bltins/getopts.c | 18 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/hist.c | 50 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/misc.c | 164 +- .../ksh93/src/cmd/ksh93/bltins/mkservice.c | 38 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/print.c | 144 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/read.c | 58 +- .../ksh93/src/cmd/ksh93/bltins/regress.c | 17 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/sleep.c | 34 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/test.c | 95 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/trap.c | 54 +- .../ksh93/src/cmd/ksh93/bltins/typeset.c | 326 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/ulimit.c | 36 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/umask.c | 12 +- .../dtksh/ksh93/src/cmd/ksh93/bltins/whence.c | 107 +- .../dtksh/ksh93/src/cmd/ksh93/builtins.mm | 22 +- .../dtksh/ksh93/src/cmd/ksh93/data/aliases.c | 2 +- .../dtksh/ksh93/src/cmd/ksh93/data/builtins.c | 383 +- .../dtksh/ksh93/src/cmd/ksh93/data/keywords.c | 4 +- .../ksh93/src/cmd/ksh93/data/lexstates.c | 53 +- .../dtksh/ksh93/src/cmd/ksh93/data/limits.c | 11 +- .../dtksh/ksh93/src/cmd/ksh93/data/math.tab | 28 +- .../dtksh/ksh93/src/cmd/ksh93/data/msg.c | 10 +- .../dtksh/ksh93/src/cmd/ksh93/data/options.c | 16 +- .../dtksh/ksh93/src/cmd/ksh93/data/signals.c | 1 + .../dtksh/ksh93/src/cmd/ksh93/data/strdata.c | 5 +- .../dtksh/ksh93/src/cmd/ksh93/data/testops.c | 33 +- .../ksh93/src/cmd/ksh93/data/variables.c | 10 +- .../ksh93/src/cmd/ksh93/edit/completion.c | 65 +- .../dtksh/ksh93/src/cmd/ksh93/edit/edit.c | 270 +- .../dtksh/ksh93/src/cmd/ksh93/edit/emacs.c | 174 +- .../dtksh/ksh93/src/cmd/ksh93/edit/hexpand.c | 17 +- .../dtksh/ksh93/src/cmd/ksh93/edit/history.c | 173 +- .../dtksh/ksh93/src/cmd/ksh93/edit/vi.c | 167 +- .../dtksh/ksh93/src/cmd/ksh93/features/cmds | 37 +- .../ksh93/src/cmd/ksh93/features/externs | 77 +- .../dtksh/ksh93/src/cmd/ksh93/features/locale | 22 +- .../ksh93/src/cmd/ksh93/features/math.sh | 40 +- .../ksh93/src/cmd/ksh93/features/options | 36 +- .../dtksh/ksh93/src/cmd/ksh93/features/poll | 4 +- .../ksh93/src/cmd/ksh93/features/rlimits | 12 +- .../ksh93/src/cmd/ksh93/include/argnod.h | 7 +- .../ksh93/src/cmd/ksh93/include/builtins.h | 18 +- .../dtksh/ksh93/src/cmd/ksh93/include/defs.h | 281 +- .../dtksh/ksh93/src/cmd/ksh93/include/edit.h | 78 +- .../dtksh/ksh93/src/cmd/ksh93/include/fault.h | 10 +- .../dtksh/ksh93/src/cmd/ksh93/include/fcin.h | 2 +- .../ksh93/src/cmd/ksh93/include/history.h | 2 +- .../dtksh/ksh93/src/cmd/ksh93/include/io.h | 18 +- .../dtksh/ksh93/src/cmd/ksh93/include/jobs.h | 11 +- .../ksh93/src/cmd/ksh93/include/lexstates.h | 15 +- .../dtksh/ksh93/src/cmd/ksh93/include/name.h | 14 +- .../ksh93/src/cmd/ksh93/include/national.h | 4 +- .../dtksh/ksh93/src/cmd/ksh93/include/nval.h | 32 +- .../dtksh/ksh93/src/cmd/ksh93/include/path.h | 12 +- .../ksh93/src/cmd/ksh93/include/regress.h | 2 +- .../dtksh/ksh93/src/cmd/ksh93/include/shell.h | 283 +- .../dtksh/ksh93/src/cmd/ksh93/include/shlex.h | 55 +- .../ksh93/src/cmd/ksh93/include/shnodes.h | 18 +- .../ksh93/src/cmd/ksh93/include/shtable.h | 2 +- .../ksh93/src/cmd/ksh93/include/streval.h | 6 +- .../ksh93/src/cmd/ksh93/include/terminal.h | 2 +- .../dtksh/ksh93/src/cmd/ksh93/include/test.h | 18 +- .../ksh93/src/cmd/ksh93/include/timeout.h | 1 + .../ksh93/src/cmd/ksh93/include/ulimit.h | 14 +- .../ksh93/src/cmd/ksh93/include/variables.h | 67 +- .../ksh93/src/cmd/ksh93/include/version.h | 10 +- .../dtksh/ksh93/src/cmd/ksh93/mamexec | 6 +- .../dtksh/ksh93/src/cmd/ksh93/mamstate.c | 1 + cde/programs/dtksh/ksh93/src/cmd/ksh93/nval.3 | 550 +- cde/programs/dtksh/ksh93/src/cmd/ksh93/sh.1 | 843 ++- .../dtksh/ksh93/src/cmd/ksh93/sh.memo | 34 +- .../dtksh/ksh93/src/cmd/ksh93/sh/args.c | 142 +- .../dtksh/ksh93/src/cmd/ksh93/sh/arith.c | 102 +- .../dtksh/ksh93/src/cmd/ksh93/sh/array.c | 136 +- .../dtksh/ksh93/src/cmd/ksh93/sh/defs.c | 5 +- .../dtksh/ksh93/src/cmd/ksh93/sh/deparse.c | 57 +- .../dtksh/ksh93/src/cmd/ksh93/sh/expand.c | 54 +- .../dtksh/ksh93/src/cmd/ksh93/sh/fault.c | 61 +- .../dtksh/ksh93/src/cmd/ksh93/sh/fcin.c | 5 +- .../dtksh/ksh93/src/cmd/ksh93/sh/init.c | 455 +- .../dtksh/ksh93/src/cmd/ksh93/sh/io.c | 157 +- .../dtksh/ksh93/src/cmd/ksh93/sh/jobs.c | 215 +- .../dtksh/ksh93/src/cmd/ksh93/sh/lex.c | 279 +- .../dtksh/ksh93/src/cmd/ksh93/sh/macro.c | 250 +- .../dtksh/ksh93/src/cmd/ksh93/sh/main.c | 149 +- .../dtksh/ksh93/src/cmd/ksh93/sh/name.c | 315 +- .../dtksh/ksh93/src/cmd/ksh93/sh/nvdisc.c | 115 +- .../dtksh/ksh93/src/cmd/ksh93/sh/nvtree.c | 27 +- .../dtksh/ksh93/src/cmd/ksh93/sh/nvtype.c | 211 +- .../dtksh/ksh93/src/cmd/ksh93/sh/parse.c | 209 +- .../dtksh/ksh93/src/cmd/ksh93/sh/path.c | 255 +- .../dtksh/ksh93/src/cmd/ksh93/sh/pmain.c | 4 +- .../dtksh/ksh93/src/cmd/ksh93/sh/shcomp.c | 67 +- .../dtksh/ksh93/src/cmd/ksh93/sh/streval.c | 43 +- .../dtksh/ksh93/src/cmd/ksh93/sh/string.c | 10 +- .../dtksh/ksh93/src/cmd/ksh93/sh/subshell.c | 386 +- .../dtksh/ksh93/src/cmd/ksh93/sh/suid_exec.c | 21 +- .../dtksh/ksh93/src/cmd/ksh93/sh/tdump.c | 7 +- .../dtksh/ksh93/src/cmd/ksh93/sh/timers.c | 19 +- .../dtksh/ksh93/src/cmd/ksh93/sh/trestore.c | 7 +- .../dtksh/ksh93/src/cmd/ksh93/sh/waitevent.c | 2 +- .../dtksh/ksh93/src/cmd/ksh93/sh/xec.c | 733 +-- .../dtksh/ksh93/src/cmd/ksh93/shell.3 | 317 +- .../dtksh/ksh93/src/cmd/ksh93/tests/_common | 41 + .../dtksh/ksh93/src/cmd/ksh93/tests/alias.sh | 186 +- .../dtksh/ksh93/src/cmd/ksh93/tests/append.sh | 31 +- .../dtksh/ksh93/src/cmd/ksh93/tests/arith.sh | 273 +- .../dtksh/ksh93/src/cmd/ksh93/tests/arrays.sh | 73 +- .../ksh93/src/cmd/ksh93/tests/arrays2.sh | 60 +- .../ksh93/src/cmd/ksh93/tests/attributes.sh | 130 +- .../dtksh/ksh93/src/cmd/ksh93/tests/basic.sh | 292 +- .../ksh93/src/cmd/ksh93/tests/bracket.sh | 216 +- .../ksh93/src/cmd/ksh93/tests/builtins.sh | 661 +- .../dtksh/ksh93/src/cmd/ksh93/tests/case.sh | 38 +- .../dtksh/ksh93/src/cmd/ksh93/tests/comvar.sh | 39 +- .../ksh93/src/cmd/ksh93/tests/comvario.sh | 35 +- .../ksh93/src/cmd/ksh93/tests/coprocess.sh | 19 +- .../ksh93/src/cmd/ksh93/tests/cubetype.sh | 14 +- .../dtksh/ksh93/src/cmd/ksh93/tests/enum.sh | 122 +- .../dtksh/ksh93/src/cmd/ksh93/tests/exit.sh | 175 +- .../dtksh/ksh93/src/cmd/ksh93/tests/expand.sh | 12 +- .../ksh93/src/cmd/ksh93/tests/functions.sh | 79 +- .../dtksh/ksh93/src/cmd/ksh93/tests/glob.sh | 63 +- .../dtksh/ksh93/src/cmd/ksh93/tests/grep.sh | 13 +- .../ksh93/src/cmd/ksh93/tests/heredoc.sh | 99 +- .../dtksh/ksh93/src/cmd/ksh93/tests/io.sh | 310 +- .../dtksh/ksh93/src/cmd/ksh93/tests/jobs.sh | 90 + .../dtksh/ksh93/src/cmd/ksh93/tests/leaks.sh | 584 +- .../dtksh/ksh93/src/cmd/ksh93/tests/locale.sh | 179 +- .../dtksh/ksh93/src/cmd/ksh93/tests/math.sh | 65 +- .../ksh93/src/cmd/ksh93/tests/nameref.sh | 31 +- .../ksh93/src/cmd/ksh93/tests/namespace.sh | 16 +- .../ksh93/src/cmd/ksh93/tests/options.sh | 68 +- .../dtksh/ksh93/src/cmd/ksh93/tests/path.sh | 414 +- .../ksh93/src/cmd/ksh93/tests/pointtype.sh | 17 +- .../dtksh/ksh93/src/cmd/ksh93/tests/pty.sh | 616 +- .../ksh93/src/cmd/ksh93/tests/quoting.sh | 29 +- .../ksh93/src/cmd/ksh93/tests/quoting2.sh | 63 +- .../ksh93/src/cmd/ksh93/tests/readcsv.sh | 16 +- .../ksh93/src/cmd/ksh93/tests/readonly.sh | 349 ++ .../ksh93/src/cmd/ksh93/tests/recttype.sh | 13 +- .../ksh93/src/cmd/ksh93/tests/restricted.sh | 20 +- .../dtksh/ksh93/src/cmd/ksh93/tests/return.sh | 92 +- .../dtksh/ksh93/src/cmd/ksh93/tests/select.sh | 13 +- .../dtksh/ksh93/src/cmd/ksh93/tests/shtests | 72 +- .../ksh93/src/cmd/ksh93/tests/sigchld.sh | 17 +- .../dtksh/ksh93/src/cmd/ksh93/tests/signal.sh | 74 +- .../ksh93/src/cmd/ksh93/tests/statics.sh | 14 +- .../ksh93/src/cmd/ksh93/tests/subshell.sh | 335 +- .../ksh93/src/cmd/ksh93/tests/substring.sh | 38 +- .../dtksh/ksh93/src/cmd/ksh93/tests/tilde.sh | 94 +- .../ksh93/src/cmd/ksh93/tests/timetype.sh | 13 +- .../ksh93/src/cmd/ksh93/tests/treemove.sh | 16 +- .../dtksh/ksh93/src/cmd/ksh93/tests/types.sh | 59 +- .../ksh93/src/cmd/ksh93/tests/variables.sh | 305 +- .../ksh93/src/cmd/ksh93/tests/vartree1.sh | 16 +- .../ksh93/src/cmd/ksh93/tests/vartree2.sh | 16 +- .../dtksh/ksh93/src/lib/libast/Mamfile | 948 ++- .../dtksh/ksh93/src/lib/libast/README | 2 +- .../dtksh/ksh93/src/lib/libast/RELEASE | 298 +- .../ksh93/src/lib/libast/aso/aso-fcntl.c | 2 +- .../dtksh/ksh93/src/lib/libast/aso/aso-sem.c | 2 +- .../dtksh/ksh93/src/lib/libast/aso/aso.c | 4 +- .../dtksh/ksh93/src/lib/libast/aso/asohdr.h | 5 +- .../dtksh/ksh93/src/lib/libast/aso/asolock.c | 4 +- .../dtksh/ksh93/src/lib/libast/aso/asometh.c | 2 +- .../dtksh/ksh93/src/lib/libast/aso/asorelax.c | 2 +- .../ksh93/src/lib/libast/astsa/README-astsa | 4 +- .../dtksh/ksh93/src/lib/libast/astsa/aso.c | 2 +- .../dtksh/ksh93/src/lib/libast/astsa/aso.h | 1 + .../dtksh/ksh93/src/lib/libast/astsa/ast.c | 2 +- .../dtksh/ksh93/src/lib/libast/astsa/ast.h | 15 +- .../ksh93/src/lib/libast/astsa/ast_common.h | 23 +- .../ksh93/src/lib/libast/astsa/astsa.manifest | 1 - .../ksh93/src/lib/libast/astsa/astsa.omk | 1 - .../dtksh/ksh93/src/lib/libast/astsa/ccode.h | 1 + .../dtksh/ksh93/src/lib/libast/astsa/debug.h | 1 + .../dtksh/ksh93/src/lib/libast/astsa/error.c | 2 +- .../dtksh/ksh93/src/lib/libast/astsa/error.h | 1 + .../ksh93/src/lib/libast/astsa/hashkey.h | 3 +- .../dtksh/ksh93/src/lib/libast/astsa/option.h | 2 +- .../dtksh/ksh93/src/lib/libast/astsa/optlib.h | 3 +- .../dtksh/ksh93/src/lib/libast/astsa/sfstr.c | 1 + .../dtksh/ksh93/src/lib/libast/astsa/sfstr.h | 1 + .../dtksh/ksh93/src/lib/libast/astsa/strdup.c | 2 +- .../ksh93/src/lib/libast/astsa/strmatch.c | 10 +- .../dtksh/ksh93/src/lib/libast/astsa/times.h | 1 + .../ksh93/src/lib/libast/astsa/vmalloc.c | 2 +- .../ksh93/src/lib/libast/astsa/vmalloc.h | 1 + .../dtksh/ksh93/src/lib/libast/cdt/cdtlib.h | 47 +- .../dtksh/ksh93/src/lib/libast/cdt/dtclose.c | 14 +- .../dtksh/ksh93/src/lib/libast/cdt/dtcomp.c | 9 +- .../dtksh/ksh93/src/lib/libast/cdt/dtdisc.c | 27 +- .../dtksh/ksh93/src/lib/libast/cdt/dthash.c | 58 +- .../dtksh/ksh93/src/lib/libast/cdt/dthdr.h | 1 + .../dtksh/ksh93/src/lib/libast/cdt/dtlist.c | 83 +- .../dtksh/ksh93/src/lib/libast/cdt/dtmethod.c | 21 +- .../dtksh/ksh93/src/lib/libast/cdt/dtnew.c | 2 +- .../dtksh/ksh93/src/lib/libast/cdt/dtopen.c | 28 +- .../dtksh/ksh93/src/lib/libast/cdt/dtstat.c | 3 +- .../ksh93/src/lib/libast/cdt/dtstrhash.c | 10 +- .../dtksh/ksh93/src/lib/libast/cdt/dttree.c | 104 +- .../dtksh/ksh93/src/lib/libast/cdt/dtuser.c | 7 +- .../dtksh/ksh93/src/lib/libast/cdt/dtview.c | 34 +- .../dtksh/ksh93/src/lib/libast/cdt/dtwalk.c | 12 +- .../dtksh/ksh93/src/lib/libast/comp/atexit.c | 8 +- .../ksh93/src/lib/libast/comp/basename.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/catopen.c | 10 +- .../ksh93/src/lib/libast/comp/closelog.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/conf.sh | 21 +- .../dtksh/ksh93/src/lib/libast/comp/conf.tab | 39 +- .../dtksh/ksh93/src/lib/libast/comp/creat64.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/dirname.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/dup2.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/eaccess.c | 4 +- .../dtksh/ksh93/src/lib/libast/comp/errno.c | 4 +- .../dtksh/ksh93/src/lib/libast/comp/execlp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/execve.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/execvp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/execvpe.c | 2 +- .../ksh93/src/lib/libast/comp/fakelink.h | 2 +- .../dtksh/ksh93/src/lib/libast/comp/fcntl.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/fmtmsg.h | 2 +- .../ksh93/src/lib/libast/comp/fmtmsglib.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/fnmatch.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/fnmatch.h | 10 +- .../dtksh/ksh93/src/lib/libast/comp/frexp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/frexpl.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/fsync.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/ftw.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/ftw.h | 2 +- .../dtksh/ksh93/src/lib/libast/comp/getdate.c | 2 +- .../ksh93/src/lib/libast/comp/getgroups.c | 2 +- .../ksh93/src/lib/libast/comp/getlogin.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/getopt.c | 14 +- .../dtksh/ksh93/src/lib/libast/comp/getopt.h | 4 +- .../dtksh/ksh93/src/lib/libast/comp/getoptl.c | 4 +- .../dtksh/ksh93/src/lib/libast/comp/getpgrp.c | 8 +- .../ksh93/src/lib/libast/comp/getsubopt.c | 8 +- .../dtksh/ksh93/src/lib/libast/comp/getwd.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/gross.c | 1 + .../ksh93/src/lib/libast/comp/gross_sgi.h | 5 +- .../dtksh/ksh93/src/lib/libast/comp/hsearch.c | 21 +- .../dtksh/ksh93/src/lib/libast/comp/iconv.c | 43 +- .../dtksh/ksh93/src/lib/libast/comp/killpg.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/libgen.h | 2 +- .../dtksh/ksh93/src/lib/libast/comp/link.c | 6 +- .../ksh93/src/lib/libast/comp/localeconv.c | 78 +- .../dtksh/ksh93/src/lib/libast/comp/lstat.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/memccpy.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/memchr.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/memcmp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/memcpy.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/memmove.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/memset.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/mkdir.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/mkfifo.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/mknod.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/mktemp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/mktime.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/mount.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/nftw.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/omitted.c | 64 +- .../dtksh/ksh93/src/lib/libast/comp/open.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/openlog.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/putenv.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/re_comp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/re_comp.h | 2 +- .../ksh93/src/lib/libast/comp/readlink.c | 6 +- .../ksh93/src/lib/libast/comp/realpath.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/regcmp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/regexp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/regexp.h | 2 +- .../dtksh/ksh93/src/lib/libast/comp/remove.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/rename.c | 2 +- .../ksh93/src/lib/libast/comp/resolvepath.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/rmdir.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/setenv.c | 2 +- .../ksh93/src/lib/libast/comp/setlocale.c | 24 +- .../ksh93/src/lib/libast/comp/setlogmask.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/setpgid.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/setsid.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/sigflag.c | 2 +- .../ksh93/src/lib/libast/comp/sigunblock.c | 2 +- .../ksh93/src/lib/libast/comp/spawnveg.c | 18 +- .../dtksh/ksh93/src/lib/libast/comp/statvfs.c | 2 +- .../ksh93/src/lib/libast/comp/strcasecmp.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/strchr.c | 2 +- .../ksh93/src/lib/libast/comp/strftime.c | 2 +- .../ksh93/src/lib/libast/comp/strncasecmp.c | 2 +- .../ksh93/src/lib/libast/comp/strptime.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/strrchr.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/strstr.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/strtod.c | 1 + .../dtksh/ksh93/src/lib/libast/comp/strtol.c | 1 + .../dtksh/ksh93/src/lib/libast/comp/strtold.c | 3 +- .../dtksh/ksh93/src/lib/libast/comp/strtoll.c | 2 + .../dtksh/ksh93/src/lib/libast/comp/strtoul.c | 1 + .../ksh93/src/lib/libast/comp/strtoull.c | 2 + .../dtksh/ksh93/src/lib/libast/comp/swab.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/symlink.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/syslog.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/syslog.h | 4 +- .../ksh93/src/lib/libast/comp/sysloglib.h | 4 +- .../dtksh/ksh93/src/lib/libast/comp/system.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/tempnam.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/tmpnam.c | 2 +- .../ksh93/src/lib/libast/comp/transition.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/tsearch.c | 99 +- .../dtksh/ksh93/src/lib/libast/comp/unlink.c | 2 +- .../ksh93/src/lib/libast/comp/unsetenv.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/vfork.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/waitpid.c | 4 +- .../dtksh/ksh93/src/lib/libast/comp/wc.c | 2 +- .../dtksh/ksh93/src/lib/libast/comp/wordexp.c | 6 +- .../dtksh/ksh93/src/lib/libast/comp/wordexp.h | 4 +- .../dtksh/ksh93/src/lib/libast/dir/dirlib.h | 2 +- .../dtksh/ksh93/src/lib/libast/dir/dirstd.h | 2 +- .../dtksh/ksh93/src/lib/libast/dir/getdents.c | 2 +- .../dtksh/ksh93/src/lib/libast/dir/opendir.c | 2 +- .../dtksh/ksh93/src/lib/libast/dir/readdir.c | 4 +- .../ksh93/src/lib/libast/dir/rewinddir.c | 2 +- .../dtksh/ksh93/src/lib/libast/dir/seekdir.c | 2 +- .../dtksh/ksh93/src/lib/libast/dir/telldir.c | 2 +- .../ksh93/src/lib/libast/disc/memfatal.c | 10 +- .../dtksh/ksh93/src/lib/libast/disc/sfdcdio.c | 66 +- .../dtksh/ksh93/src/lib/libast/disc/sfdcdos.c | 50 +- .../ksh93/src/lib/libast/disc/sfdcfilter.c | 56 +- .../dtksh/ksh93/src/lib/libast/disc/sfdchdr.h | 1 + .../ksh93/src/lib/libast/disc/sfdcmore.c | 51 +- .../ksh93/src/lib/libast/disc/sfdcprefix.c | 27 +- .../ksh93/src/lib/libast/disc/sfdcseekable.c | 50 +- .../ksh93/src/lib/libast/disc/sfdcslow.c | 16 +- .../ksh93/src/lib/libast/disc/sfdcsubstr.c | 67 +- .../dtksh/ksh93/src/lib/libast/disc/sfdctee.c | 33 +- .../ksh93/src/lib/libast/disc/sfdcunion.c | 52 +- .../ksh93/src/lib/libast/disc/sfkeyprintf.c | 2 +- .../ksh93/src/lib/libast/disc/sfstrtmp.c | 2 +- .../ksh93/src/lib/libast/features/align.c | 2 +- .../dtksh/ksh93/src/lib/libast/features/aso | 15 +- .../ksh93/src/lib/libast/features/botch.c | 4 +- .../dtksh/ksh93/src/lib/libast/features/ccode | 12 +- .../ksh93/src/lib/libast/features/common | 147 +- .../ksh93/src/lib/libast/features/dirent | 8 +- .../ksh93/src/lib/libast/features/fcntl.c | 10 +- .../dtksh/ksh93/src/lib/libast/features/float | 55 +- .../dtksh/ksh93/src/lib/libast/features/fs | 30 +- .../dtksh/ksh93/src/lib/libast/features/hack | 50 + .../dtksh/ksh93/src/lib/libast/features/iconv | 1 - .../dtksh/ksh93/src/lib/libast/features/lib | 128 +- .../ksh93/src/lib/libast/features/libpath.sh | 3 +- .../ksh93/src/lib/libast/features/limits.c | 24 +- .../dtksh/ksh93/src/lib/libast/features/map.c | 25 +- .../dtksh/ksh93/src/lib/libast/features/mmap | 19 +- .../ksh93/src/lib/libast/features/mode.c | 2 +- .../ksh93/src/lib/libast/features/nl_types | 1 - .../ksh93/src/lib/libast/features/omitted | 4 +- .../ksh93/src/lib/libast/features/param.sh | 1 + .../ksh93/src/lib/libast/features/preroot.sh | 2 +- .../ksh93/src/lib/libast/features/sfinit.c | 1 + .../dtksh/ksh93/src/lib/libast/features/sfio | 13 +- .../ksh93/src/lib/libast/features/sig.sh | 8 +- .../ksh93/src/lib/libast/features/signal.c | 5 +- .../ksh93/src/lib/libast/features/sizeof | 3 +- .../ksh93/src/lib/libast/features/standards | 215 +- .../dtksh/ksh93/src/lib/libast/features/stdio | 119 - .../dtksh/ksh93/src/lib/libast/features/sys | 9 +- .../ksh93/src/lib/libast/features/syscall | 1 + .../dtksh/ksh93/src/lib/libast/features/time | 1 - .../dtksh/ksh93/src/lib/libast/features/tmlib | 7 - .../dtksh/ksh93/src/lib/libast/features/tmx | 1 - .../dtksh/ksh93/src/lib/libast/features/tty | 6 +- .../dtksh/ksh93/src/lib/libast/features/tv | 1 - .../dtksh/ksh93/src/lib/libast/features/tvlib | 32 + .../dtksh/ksh93/src/lib/libast/features/vfork | 1 - .../ksh93/src/lib/libast/features/vmalloc | 46 +- .../dtksh/ksh93/src/lib/libast/features/wait | 2 +- .../dtksh/ksh93/src/lib/libast/features/wchar | 1 - .../ksh93/src/lib/libast/features/wctype | 1 - .../ksh93/src/lib/libast/hash/hashalloc.c | 15 +- .../ksh93/src/lib/libast/hash/hashdump.c | 2 +- .../ksh93/src/lib/libast/hash/hashfree.c | 2 +- .../ksh93/src/lib/libast/hash/hashlast.c | 2 +- .../dtksh/ksh93/src/lib/libast/hash/hashlib.h | 2 +- .../ksh93/src/lib/libast/hash/hashlook.c | 2 +- .../ksh93/src/lib/libast/hash/hashscan.c | 2 +- .../ksh93/src/lib/libast/hash/hashsize.c | 2 +- .../ksh93/src/lib/libast/hash/hashview.c | 2 +- .../ksh93/src/lib/libast/hash/hashwalk.c | 2 +- .../dtksh/ksh93/src/lib/libast/hash/memhash.c | 2 +- .../dtksh/ksh93/src/lib/libast/hash/memsum.c | 2 +- .../dtksh/ksh93/src/lib/libast/hash/strhash.c | 4 +- .../dtksh/ksh93/src/lib/libast/hash/strkey.c | 2 +- .../dtksh/ksh93/src/lib/libast/hash/strsum.c | 2 +- .../dtksh/ksh93/src/lib/libast/include/aso.h | 4 +- .../dtksh/ksh93/src/lib/libast/include/ast.h | 87 +- .../ksh93/src/lib/libast/include/ast_dir.h | 10 +- .../ksh93/src/lib/libast/include/ast_getopt.h | 2 +- .../ksh93/src/lib/libast/include/ast_std.h | 12 +- .../src/lib/libast/include/ast_windows.h | 6 +- .../ksh93/src/lib/libast/include/ccode.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/cdt.h | 97 +- .../ksh93/src/lib/libast/include/cmdarg.h | 2 +- .../ksh93/src/lib/libast/include/debug.h | 6 +- .../dtksh/ksh93/src/lib/libast/include/dt.h | 2 +- .../ksh93/src/lib/libast/include/error.h | 44 +- .../dtksh/ksh93/src/lib/libast/include/find.h | 4 +- .../dtksh/ksh93/src/lib/libast/include/fnv.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/fts.h | 2 +- .../ksh93/src/lib/libast/include/ftwalk.h | 4 +- .../dtksh/ksh93/src/lib/libast/include/glob.h | 25 +- .../dtksh/ksh93/src/lib/libast/include/hash.h | 2 +- .../ksh93/src/lib/libast/include/hashkey.h | 4 +- .../ksh93/src/lib/libast/include/hashpart.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/ip6.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/ls.h | 4 +- .../ksh93/src/lib/libast/include/magic.h | 2 +- .../ksh93/src/lib/libast/include/magicid.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/mc.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/mime.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/mnt.h | 4 +- .../ksh93/src/lib/libast/include/modecanon.h | 2 +- .../ksh93/src/lib/libast/include/modex.h | 2 +- .../ksh93/src/lib/libast/include/namval.h | 2 +- .../ksh93/src/lib/libast/include/option.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/proc.h | 2 +- .../ksh93/src/lib/libast/include/recfmt.h | 2 +- .../ksh93/src/lib/libast/include/regex.h | 4 +- .../ksh93/src/lib/libast/include/sfdisc.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/sfio.h | 182 +- .../ksh93/src/lib/libast/include/sfio_s.h | 1 + .../ksh93/src/lib/libast/include/sfio_t.h | 23 +- .../ksh93/src/lib/libast/include/shcmd.h | 8 +- .../ksh93/src/lib/libast/include/stack.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/stak.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/stk.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/swap.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/tar.h | 2 +- .../ksh93/src/lib/libast/include/times.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/tm.h | 2 +- .../dtksh/ksh93/src/lib/libast/include/tok.h | 2 +- .../ksh93/src/lib/libast/include/usage.h | 5 +- .../dtksh/ksh93/src/lib/libast/include/vdb.h | 2 +- .../ksh93/src/lib/libast/include/vecargs.h | 2 +- .../ksh93/src/lib/libast/include/vmalloc.h | 143 +- .../dtksh/ksh93/src/lib/libast/include/wait.h | 16 +- .../dtksh/ksh93/src/lib/libast/man/LIBAST.3 | 36 +- .../dtksh/ksh93/src/lib/libast/man/aso.3 | 186 +- .../dtksh/ksh93/src/lib/libast/man/ast.3 | 42 +- .../dtksh/ksh93/src/lib/libast/man/astsa.3 | 12 +- .../dtksh/ksh93/src/lib/libast/man/cdt.3 | 758 +-- .../dtksh/ksh93/src/lib/libast/man/compat.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/error.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/ftwalk.3 | 6 +- .../dtksh/ksh93/src/lib/libast/man/hash.3 | 10 +- .../dtksh/ksh93/src/lib/libast/man/ip6.3 | 8 +- .../dtksh/ksh93/src/lib/libast/man/magic.3 | 10 +- .../ksh93/src/lib/libast/man/modecanon.3 | 3 +- .../dtksh/ksh93/src/lib/libast/man/path.3 | 27 + .../dtksh/ksh93/src/lib/libast/man/preroot.3 | 4 +- .../dtksh/ksh93/src/lib/libast/man/proc.3 | 14 +- .../dtksh/ksh93/src/lib/libast/man/regex.3 | 4 +- .../dtksh/ksh93/src/lib/libast/man/sfdisc.3 | 60 +- .../dtksh/ksh93/src/lib/libast/man/sfio.3 | 1820 +++--- .../dtksh/ksh93/src/lib/libast/man/sig.3 | 23 +- .../dtksh/ksh93/src/lib/libast/man/spawnveg.3 | 29 +- .../dtksh/ksh93/src/lib/libast/man/stak.3 | 76 +- .../dtksh/ksh93/src/lib/libast/man/stk.3 | 84 +- .../dtksh/ksh93/src/lib/libast/man/strcopy.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/strdup.3 | 4 +- .../dtksh/ksh93/src/lib/libast/man/stresc.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/streval.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/strgid.3 | 13 +- .../dtksh/ksh93/src/lib/libast/man/stropt.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/strperm.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/strsort.3 | 4 +- .../dtksh/ksh93/src/lib/libast/man/strtape.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/strton.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/struid.3 | 13 +- .../dtksh/ksh93/src/lib/libast/man/tm.3 | 51 +- .../dtksh/ksh93/src/lib/libast/man/tmx.3 | 148 +- .../dtksh/ksh93/src/lib/libast/man/tok.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/vecargs.3 | 2 +- .../dtksh/ksh93/src/lib/libast/man/vmalloc.3 | 245 +- .../ksh93/src/lib/libast/misc/astintercept.c | 4 +- .../dtksh/ksh93/src/lib/libast/misc/cmdarg.c | 6 +- .../dtksh/ksh93/src/lib/libast/misc/cmdlib.h | 2 +- .../ksh93/src/lib/libast/misc/conformance.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/debug.c | 7 +- .../dtksh/ksh93/src/lib/libast/misc/error.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/errorf.c | 2 +- .../ksh93/src/lib/libast/misc/errormsg.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/errorx.c | 2 +- .../ksh93/src/lib/libast/misc/fastfind.c | 19 +- .../dtksh/ksh93/src/lib/libast/misc/findlib.h | 4 +- .../dtksh/ksh93/src/lib/libast/misc/fmtrec.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/fts.c | 24 +- .../dtksh/ksh93/src/lib/libast/misc/ftwalk.c | 2 +- .../ksh93/src/lib/libast/misc/ftwflags.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/getcwd.c | 6 +- .../dtksh/ksh93/src/lib/libast/misc/getenv.c | 6 +- .../dtksh/ksh93/src/lib/libast/misc/glob.c | 50 +- .../ksh93/src/lib/libast/misc/intercepts.h | 2 +- .../dtksh/ksh93/src/lib/libast/misc/magic.c | 55 +- .../dtksh/ksh93/src/lib/libast/misc/mime.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/mimelib.h | 2 +- .../ksh93/src/lib/libast/misc/mimetype.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/optctx.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/optesc.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/optget.c | 80 +- .../dtksh/ksh93/src/lib/libast/misc/optjoin.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/optlib.h | 4 +- .../ksh93/src/lib/libast/misc/procclose.c | 2 +- .../ksh93/src/lib/libast/misc/procfree.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/proclib.h | 2 +- .../ksh93/src/lib/libast/misc/procopen.c | 4 +- .../dtksh/ksh93/src/lib/libast/misc/procrun.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/recfmt.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/reclen.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/recstr.c | 4 +- .../ksh93/src/lib/libast/misc/setenviron.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/sigcrit.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/sigdata.c | 1 + .../dtksh/ksh93/src/lib/libast/misc/signal.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/stack.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/state.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/stk.c | 7 +- .../ksh93/src/lib/libast/misc/systrace.c | 2 +- .../ksh93/src/lib/libast/misc/translate.c | 6 +- .../ksh93/src/lib/libast/misc/univdata.c | 2 +- .../dtksh/ksh93/src/lib/libast/misc/univlib.h | 2 +- .../ksh93/src/lib/libast/obsolete/spawn.c | 152 - .../ksh93/src/lib/libast/path/pathaccess.c | 2 +- .../dtksh/ksh93/src/lib/libast/path/pathbin.c | 2 +- .../ksh93/src/lib/libast/path/pathcanon.c | 4 +- .../dtksh/ksh93/src/lib/libast/path/pathcat.c | 2 +- .../dtksh/ksh93/src/lib/libast/path/pathcd.c | 2 +- .../ksh93/src/lib/libast/path/pathcheck.c | 2 +- .../ksh93/src/lib/libast/path/pathexists.c | 6 +- .../ksh93/src/lib/libast/path/pathfind.c | 2 +- .../ksh93/src/lib/libast/path/pathgetlink.c | 2 +- .../ksh93/src/lib/libast/path/pathicase.c | 80 + .../dtksh/ksh93/src/lib/libast/path/pathkey.c | 2 +- .../ksh93/src/lib/libast/path/pathnative.c | 2 +- .../ksh93/src/lib/libast/path/pathpath.c | 3 +- .../ksh93/src/lib/libast/path/pathposix.c | 4 +- .../ksh93/src/lib/libast/path/pathprobe.c | 2 +- .../ksh93/src/lib/libast/path/pathprog.c | 2 +- .../ksh93/src/lib/libast/path/pathrepl.c | 2 +- .../ksh93/src/lib/libast/path/pathsetlink.c | 2 +- .../ksh93/src/lib/libast/path/pathshell.c | 12 +- .../ksh93/src/lib/libast/path/pathstat.c | 2 +- .../ksh93/src/lib/libast/path/pathtemp.c | 44 +- .../dtksh/ksh93/src/lib/libast/path/pathtmp.c | 2 +- .../dtksh/ksh93/src/lib/libast/port/astconf.c | 44 +- .../dtksh/ksh93/src/lib/libast/port/astcopy.c | 2 +- .../ksh93/src/lib/libast/port/astdynamic.c | 4 +- .../ksh93/src/lib/libast/port/astlicense.c | 1303 ---- .../dtksh/ksh93/src/lib/libast/port/astmath.c | 1 + .../ksh93/src/lib/libast/port/astquery.c | 4 +- .../ksh93/src/lib/libast/port/aststatic.c | 4 +- .../ksh93/src/lib/libast/port/astwinsize.c | 2 +- .../dtksh/ksh93/src/lib/libast/port/atmain.C | 1 + .../dtksh/ksh93/src/lib/libast/port/iblocks.c | 2 +- .../dtksh/ksh93/src/lib/libast/port/lc.c | 2 +- .../dtksh/ksh93/src/lib/libast/port/lcgen.c | 53 +- .../dtksh/ksh93/src/lib/libast/port/lclang.h | 3 +- .../dtksh/ksh93/src/lib/libast/port/lclib.h | 2 +- .../dtksh/ksh93/src/lib/libast/port/mc.c | 6 +- .../dtksh/ksh93/src/lib/libast/port/mnt.c | 8 +- .../dtksh/ksh93/src/lib/libast/port/touch.c | 2 +- .../ksh93/src/lib/libast/preroot/getpreroot.c | 6 +- .../ksh93/src/lib/libast/preroot/ispreroot.c | 2 +- .../ksh93/src/lib/libast/preroot/realopen.c | 2 +- .../ksh93/src/lib/libast/preroot/setpreroot.c | 2 +- .../ksh93/src/lib/libast/regex/regalloc.c | 4 +- .../ksh93/src/lib/libast/regex/regcache.c | 6 +- .../ksh93/src/lib/libast/regex/regclass.c | 4 +- .../ksh93/src/lib/libast/regex/regcoll.c | 3 +- .../ksh93/src/lib/libast/regex/regcomp.c | 37 +- .../ksh93/src/lib/libast/regex/regdecomp.c | 38 +- .../ksh93/src/lib/libast/regex/regerror.c | 8 +- .../ksh93/src/lib/libast/regex/regexec.c | 6 +- .../ksh93/src/lib/libast/regex/regfatal.c | 4 +- .../ksh93/src/lib/libast/regex/reginit.c | 4 +- .../dtksh/ksh93/src/lib/libast/regex/reglib.h | 15 +- .../ksh93/src/lib/libast/regex/regnexec.c | 81 +- .../ksh93/src/lib/libast/regex/regrecord.c | 2 +- .../ksh93/src/lib/libast/regex/regrexec.c | 13 +- .../ksh93/src/lib/libast/regex/regstat.c | 2 +- .../dtksh/ksh93/src/lib/libast/regex/regsub.c | 2 +- .../ksh93/src/lib/libast/regex/regsubcomp.c | 4 +- .../ksh93/src/lib/libast/regex/regsubexec.c | 14 +- .../ksh93/src/lib/libast/sfio/_sfclrerr.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfdlen.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfeof.c | 6 +- .../ksh93/src/lib/libast/sfio/_sferror.c | 6 +- .../ksh93/src/lib/libast/sfio/_sffileno.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfgetc.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfgetl.c | 6 +- .../ksh93/src/lib/libast/sfio/_sfgetl2.c | 11 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfgetu.c | 6 +- .../ksh93/src/lib/libast/sfio/_sfgetu2.c | 11 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfllen.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfopen.c | 20 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfputc.c | 7 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfputd.c | 9 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfputl.c | 19 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfputm.c | 21 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfputu.c | 19 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfslen.c | 5 +- .../ksh93/src/lib/libast/sfio/_sfstacked.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/_sfulen.c | 6 +- .../ksh93/src/lib/libast/sfio/_sfvalue.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfclose.c | 16 +- .../ksh93/src/lib/libast/sfio/sfclrlock.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfcvt.c | 105 +- .../dtksh/ksh93/src/lib/libast/sfio/sfdisc.c | 39 +- .../dtksh/ksh93/src/lib/libast/sfio/sfdlen.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfecvt.c | 14 +- .../ksh93/src/lib/libast/sfio/sfexcept.c | 14 +- .../ksh93/src/lib/libast/sfio/sfextern.c | 11 +- .../dtksh/ksh93/src/lib/libast/sfio/sffcvt.c | 14 +- .../ksh93/src/lib/libast/sfio/sffilbuf.c | 10 +- .../ksh93/src/lib/libast/sfio/sfflsbuf.c | 10 +- .../dtksh/ksh93/src/lib/libast/sfio/sfgetd.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfgetl.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfgetm.c | 7 +- .../dtksh/ksh93/src/lib/libast/sfio/sfgetr.c | 12 +- .../dtksh/ksh93/src/lib/libast/sfio/sfgetu.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfhdr.h | 219 +- .../dtksh/ksh93/src/lib/libast/sfio/sfllen.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfmode.c | 91 +- .../dtksh/ksh93/src/lib/libast/sfio/sfmove.c | 28 +- .../dtksh/ksh93/src/lib/libast/sfio/sfmutex.c | 7 +- .../dtksh/ksh93/src/lib/libast/sfio/sfnew.c | 18 +- .../ksh93/src/lib/libast/sfio/sfnotify.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfnputc.c | 14 +- .../dtksh/ksh93/src/lib/libast/sfio/sfopen.c | 14 +- .../dtksh/ksh93/src/lib/libast/sfio/sfpeek.c | 16 +- .../dtksh/ksh93/src/lib/libast/sfio/sfpkrd.c | 42 +- .../dtksh/ksh93/src/lib/libast/sfio/sfpoll.c | 27 +- .../dtksh/ksh93/src/lib/libast/sfio/sfpool.c | 54 +- .../dtksh/ksh93/src/lib/libast/sfio/sfpopen.c | 21 +- .../ksh93/src/lib/libast/sfio/sfprintf.c | 42 +- .../ksh93/src/lib/libast/sfio/sfprints.c | 41 +- .../dtksh/ksh93/src/lib/libast/sfio/sfpurge.c | 12 +- .../dtksh/ksh93/src/lib/libast/sfio/sfputd.c | 7 +- .../dtksh/ksh93/src/lib/libast/sfio/sfputl.c | 7 +- .../dtksh/ksh93/src/lib/libast/sfio/sfputm.c | 8 +- .../dtksh/ksh93/src/lib/libast/sfio/sfputr.c | 14 +- .../dtksh/ksh93/src/lib/libast/sfio/sfputu.c | 7 +- .../dtksh/ksh93/src/lib/libast/sfio/sfraise.c | 14 +- .../dtksh/ksh93/src/lib/libast/sfio/sfrd.c | 21 +- .../dtksh/ksh93/src/lib/libast/sfio/sfread.c | 12 +- .../ksh93/src/lib/libast/sfio/sfreserve.c | 46 +- .../ksh93/src/lib/libast/sfio/sfresize.c | 9 +- .../dtksh/ksh93/src/lib/libast/sfio/sfscanf.c | 37 +- .../dtksh/ksh93/src/lib/libast/sfio/sfseek.c | 24 +- .../dtksh/ksh93/src/lib/libast/sfio/sfset.c | 10 +- .../ksh93/src/lib/libast/sfio/sfsetbuf.c | 64 +- .../dtksh/ksh93/src/lib/libast/sfio/sfsetfd.c | 13 +- .../dtksh/ksh93/src/lib/libast/sfio/sfsize.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sfsk.c | 9 +- .../dtksh/ksh93/src/lib/libast/sfio/sfstack.c | 12 +- .../ksh93/src/lib/libast/sfio/sfstrtod.c | 15 +- .../ksh93/src/lib/libast/sfio/sfstrtof.h | 15 +- .../dtksh/ksh93/src/lib/libast/sfio/sfswap.c | 13 +- .../dtksh/ksh93/src/lib/libast/sfio/sfsync.c | 14 +- .../dtksh/ksh93/src/lib/libast/sfio/sftable.c | 28 +- .../dtksh/ksh93/src/lib/libast/sfio/sftell.c | 6 +- .../dtksh/ksh93/src/lib/libast/sfio/sftmp.c | 89 +- .../ksh93/src/lib/libast/sfio/sfungetc.c | 20 +- .../ksh93/src/lib/libast/sfio/sfvprintf.c | 55 +- .../ksh93/src/lib/libast/sfio/sfvscanf.c | 98 +- .../dtksh/ksh93/src/lib/libast/sfio/sfwalk.c | 12 +- .../dtksh/ksh93/src/lib/libast/sfio/sfwr.c | 20 +- .../dtksh/ksh93/src/lib/libast/sfio/sfwrite.c | 12 +- .../dtksh/ksh93/src/lib/libast/sfio/vthread.h | 60 +- .../dtksh/ksh93/src/lib/libast/std/bytesex.h | 3 +- .../dtksh/ksh93/src/lib/libast/std/dirent.h | 1 + .../dtksh/ksh93/src/lib/libast/std/endian.h | 3 +- .../dtksh/ksh93/src/lib/libast/std/iconv.h | 1 + .../dtksh/ksh93/src/lib/libast/std/nl_types.h | 1 + .../dtksh/ksh93/src/lib/libast/std/stdio.h | 1 + .../dtksh/ksh93/src/lib/libast/std/wchar.h | 1 + .../dtksh/ksh93/src/lib/libast/std/wctype.h | 1 + .../ksh93/src/lib/libast/stdio/_doprnt.c | 2 +- .../ksh93/src/lib/libast/stdio/_doscan.c | 2 +- .../ksh93/src/lib/libast/stdio/_filbuf.c | 2 +- .../ksh93/src/lib/libast/stdio/_flsbuf.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdfun.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdopen.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdscanf.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdsprnt.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdvbuf.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdvsnprnt.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdvsprnt.c | 2 +- .../ksh93/src/lib/libast/stdio/_stdvsscn.c | 2 +- .../ksh93/src/lib/libast/stdio/asprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/clearerr.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fclose.c | 2 +- .../ksh93/src/lib/libast/stdio/fcloseall.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fdopen.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/feof.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/ferror.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fflush.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fgetc.c | 2 +- .../ksh93/src/lib/libast/stdio/fgetpos.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fgets.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fgetwc.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fgetws.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fileno.c | 2 +- .../ksh93/src/lib/libast/stdio/flockfile.c | 2 +- .../ksh93/src/lib/libast/stdio/fmemopen.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fopen.c | 2 +- .../ksh93/src/lib/libast/stdio/fprintf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fpurge.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fputc.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fputs.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fputwc.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fputws.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fread.c | 2 +- .../ksh93/src/lib/libast/stdio/freopen.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fscanf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fseek.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fseeko.c | 2 +- .../ksh93/src/lib/libast/stdio/fsetpos.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/ftell.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/ftello.c | 2 +- .../ksh93/src/lib/libast/stdio/ftrylockfile.c | 2 +- .../ksh93/src/lib/libast/stdio/funlockfile.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fwide.c | 2 +- .../ksh93/src/lib/libast/stdio/fwprintf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/fwrite.c | 2 +- .../ksh93/src/lib/libast/stdio/fwscanf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/getc.c | 2 +- .../ksh93/src/lib/libast/stdio/getchar.c | 2 +- .../ksh93/src/lib/libast/stdio/getdelim.c | 2 +- .../ksh93/src/lib/libast/stdio/getline.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/getw.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/getwc.c | 2 +- .../ksh93/src/lib/libast/stdio/getwchar.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/pclose.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/popen.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/printf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/putc.c | 2 +- .../ksh93/src/lib/libast/stdio/putchar.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/puts.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/putw.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/putwc.c | 2 +- .../ksh93/src/lib/libast/stdio/putwchar.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/rewind.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/scanf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/setbuf.c | 2 +- .../ksh93/src/lib/libast/stdio/setbuffer.c | 2 +- .../ksh93/src/lib/libast/stdio/setlinebuf.c | 2 +- .../ksh93/src/lib/libast/stdio/setvbuf.c | 4 +- .../ksh93/src/lib/libast/stdio/snprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/sprintf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/sscanf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/stdhdr.h | 2 +- .../ksh93/src/lib/libast/stdio/stdio_c99.c | 2 +- .../ksh93/src/lib/libast/stdio/swprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/swscanf.c | 2 +- .../ksh93/src/lib/libast/stdio/tmpfile.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/ungetc.c | 2 +- .../ksh93/src/lib/libast/stdio/ungetwc.c | 2 +- .../ksh93/src/lib/libast/stdio/vasprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/vfprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/vfscanf.c | 2 +- .../ksh93/src/lib/libast/stdio/vfwprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/vfwscanf.c | 14 +- .../ksh93/src/lib/libast/stdio/vprintf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/vscanf.c | 2 +- .../ksh93/src/lib/libast/stdio/vsnprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/vsprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/vsscanf.c | 2 +- .../ksh93/src/lib/libast/stdio/vswprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/vswscanf.c | 2 +- .../ksh93/src/lib/libast/stdio/vwprintf.c | 2 +- .../ksh93/src/lib/libast/stdio/vwscanf.c | 2 +- .../ksh93/src/lib/libast/stdio/wprintf.c | 2 +- .../dtksh/ksh93/src/lib/libast/stdio/wscanf.c | 2 +- .../ksh93/src/lib/libast/string/base64.c | 2 +- .../dtksh/ksh93/src/lib/libast/string/ccmap.c | 34 +- .../ksh93/src/lib/libast/string/ccmapid.c | 2 +- .../ksh93/src/lib/libast/string/ccnative.c | 2 +- .../ksh93/src/lib/libast/string/chresc.c | 2 +- .../ksh93/src/lib/libast/string/chrtoi.c | 2 +- .../ksh93/src/lib/libast/string/fmtbase.c | 2 +- .../ksh93/src/lib/libast/string/fmtbuf.c | 2 +- .../ksh93/src/lib/libast/string/fmtclock.c | 8 +- .../ksh93/src/lib/libast/string/fmtdev.c | 5 +- .../ksh93/src/lib/libast/string/fmtelapsed.c | 2 +- .../ksh93/src/lib/libast/string/fmterror.c | 2 +- .../ksh93/src/lib/libast/string/fmtesc.c | 2 +- .../ksh93/src/lib/libast/string/fmtfmt.c | 2 +- .../dtksh/ksh93/src/lib/libast/string/fmtfs.c | 2 +- .../ksh93/src/lib/libast/string/fmtgid.c | 2 +- .../ksh93/src/lib/libast/string/fmtident.c | 2 +- .../ksh93/src/lib/libast/string/fmtint.c | 2 +- .../ksh93/src/lib/libast/string/fmtip4.c | 2 +- .../ksh93/src/lib/libast/string/fmtip6.c | 6 +- .../dtksh/ksh93/src/lib/libast/string/fmtls.c | 2 +- .../ksh93/src/lib/libast/string/fmtmatch.c | 4 +- .../ksh93/src/lib/libast/string/fmtmode.c | 2 +- .../ksh93/src/lib/libast/string/fmtnum.c | 2 +- .../ksh93/src/lib/libast/string/fmtperm.c | 2 +- .../dtksh/ksh93/src/lib/libast/string/fmtre.c | 6 +- .../ksh93/src/lib/libast/string/fmtscale.c | 2 +- .../ksh93/src/lib/libast/string/fmtsignal.c | 2 +- .../ksh93/src/lib/libast/string/fmttime.c | 2 +- .../ksh93/src/lib/libast/string/fmttmx.c | 2 +- .../dtksh/ksh93/src/lib/libast/string/fmttv.c | 2 +- .../ksh93/src/lib/libast/string/fmtuid.c | 2 +- .../ksh93/src/lib/libast/string/fmtversion.c | 2 +- .../ksh93/src/lib/libast/string/memdup.c | 2 +- .../ksh93/src/lib/libast/string/modedata.c | 2 +- .../dtksh/ksh93/src/lib/libast/string/modei.c | 2 +- .../ksh93/src/lib/libast/string/modelib.h | 2 +- .../dtksh/ksh93/src/lib/libast/string/modex.c | 2 +- .../ksh93/src/lib/libast/string/stracmp.c | 2 +- .../ksh93/src/lib/libast/string/strcopy.c | 2 +- .../ksh93/src/lib/libast/string/strdup.c | 12 +- .../ksh93/src/lib/libast/string/strelapsed.c | 4 +- .../ksh93/src/lib/libast/string/strerror.c | 2 +- .../ksh93/src/lib/libast/string/stresc.c | 2 +- .../ksh93/src/lib/libast/string/streval.c | 2 +- .../ksh93/src/lib/libast/string/strexpr.c | 2 +- .../ksh93/src/lib/libast/string/strgid.c | 2 +- .../ksh93/src/lib/libast/string/strlcat.c | 2 +- .../ksh93/src/lib/libast/string/strlcpy.c | 2 +- .../ksh93/src/lib/libast/string/strlook.c | 2 +- .../ksh93/src/lib/libast/string/strmatch.c | 2 +- .../ksh93/src/lib/libast/string/strmode.c | 2 +- .../ksh93/src/lib/libast/string/strnacmp.c | 2 +- .../ksh93/src/lib/libast/string/strncopy.c | 2 +- .../ksh93/src/lib/libast/string/strnpcmp.c | 2 +- .../ksh93/src/lib/libast/string/strntod.c | 1 + .../ksh93/src/lib/libast/string/strntol.c | 1 + .../ksh93/src/lib/libast/string/strntold.c | 1 + .../ksh93/src/lib/libast/string/strntoll.c | 1 + .../ksh93/src/lib/libast/string/strnton.c | 1 + .../ksh93/src/lib/libast/string/strntonll.c | 1 + .../ksh93/src/lib/libast/string/strntoul.c | 1 + .../ksh93/src/lib/libast/string/strntoull.c | 1 + .../ksh93/src/lib/libast/string/strnvcmp.c | 2 +- .../ksh93/src/lib/libast/string/stropt.c | 4 +- .../ksh93/src/lib/libast/string/strpcmp.c | 2 +- .../ksh93/src/lib/libast/string/strperm.c | 12 +- .../ksh93/src/lib/libast/string/strpsearch.c | 2 +- .../ksh93/src/lib/libast/string/strsearch.c | 2 +- .../ksh93/src/lib/libast/string/strsort.c | 2 +- .../ksh93/src/lib/libast/string/strtape.c | 6 +- .../ksh93/src/lib/libast/string/strtoi.h | 26 +- .../ksh93/src/lib/libast/string/strtoip4.c | 2 +- .../ksh93/src/lib/libast/string/strtoip6.c | 2 +- .../ksh93/src/lib/libast/string/strton.c | 1 + .../ksh93/src/lib/libast/string/strtonll.c | 1 + .../ksh93/src/lib/libast/string/struid.c | 2 +- .../ksh93/src/lib/libast/string/struniq.c | 2 +- .../ksh93/src/lib/libast/string/strvcmp.c | 2 +- .../ksh93/src/lib/libast/string/swapget.c | 2 +- .../ksh93/src/lib/libast/string/swapmem.c | 2 +- .../ksh93/src/lib/libast/string/swapop.c | 2 +- .../ksh93/src/lib/libast/string/swapput.c | 2 +- .../dtksh/ksh93/src/lib/libast/string/tok.c | 6 +- .../ksh93/src/lib/libast/string/tokline.c | 4 +- .../ksh93/src/lib/libast/string/tokscan.c | 15 +- .../ksh93/src/lib/libast/string/wc2utf8.c | 18 +- .../dtksh/ksh93/src/lib/libast/tm/tmdata.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmdate.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmequiv.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmfix.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmfmt.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmform.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmgoff.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tminit.c | 12 +- .../dtksh/ksh93/src/lib/libast/tm/tmleap.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmlex.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmlocale.c | 30 +- .../dtksh/ksh93/src/lib/libast/tm/tmmake.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmpoff.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmscan.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmsleep.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmtime.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmtype.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmweek.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmword.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxdate.c | 22 +- .../ksh93/src/lib/libast/tm/tmxduration.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxfmt.c | 14 +- .../ksh93/src/lib/libast/tm/tmxgettime.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxleap.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxmake.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxscan.c | 7 +- .../ksh93/src/lib/libast/tm/tmxsettime.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxsleep.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxtime.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmxtouch.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tmzone.c | 6 +- .../dtksh/ksh93/src/lib/libast/tm/tvcmp.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tvgettime.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tvsettime.c | 2 +- .../dtksh/ksh93/src/lib/libast/tm/tvsleep.c | 160 +- .../dtksh/ksh93/src/lib/libast/tm/tvtouch.c | 2 +- .../dtksh/ksh93/src/lib/libast/uwin/a64l.c | 1 + .../dtksh/ksh93/src/lib/libast/uwin/cbrt.c | 1 + .../dtksh/ksh93/src/lib/libast/uwin/crypt.c | 17 +- .../dtksh/ksh93/src/lib/libast/uwin/erf.c | 4 +- .../dtksh/ksh93/src/lib/libast/uwin/err.c | 4 +- .../dtksh/ksh93/src/lib/libast/uwin/exp.c | 2 +- .../dtksh/ksh93/src/lib/libast/uwin/expm1.c | 2 +- .../dtksh/ksh93/src/lib/libast/uwin/gamma.c | 2 +- .../dtksh/ksh93/src/lib/libast/uwin/getpass.c | 3 +- .../dtksh/ksh93/src/lib/libast/uwin/log1p.c | 2 +- .../dtksh/ksh93/src/lib/libast/uwin/rand48.c | 1 + .../dtksh/ksh93/src/lib/libast/uwin/random.c | 6 +- .../dtksh/ksh93/src/lib/libast/uwin/rint.c | 1 + .../dtksh/ksh93/src/lib/libast/uwin/rlib.h | 1 + .../dtksh/ksh93/src/lib/libast/uwin/support.c | 2 +- .../dtksh/ksh93/src/lib/libast/vec/vecargs.c | 2 +- .../dtksh/ksh93/src/lib/libast/vec/vecfile.c | 2 +- .../dtksh/ksh93/src/lib/libast/vec/vecfree.c | 2 +- .../dtksh/ksh93/src/lib/libast/vec/vecload.c | 2 +- .../ksh93/src/lib/libast/vec/vecstring.c | 2 +- .../ksh93/src/lib/libast/vmalloc/malloc.c | 321 +- .../ksh93/src/lib/libast/vmalloc/vmbest.c | 206 +- .../ksh93/src/lib/libast/vmalloc/vmclear.c | 6 +- .../ksh93/src/lib/libast/vmalloc/vmclose.c | 10 +- .../ksh93/src/lib/libast/vmalloc/vmdcheap.c | 22 +- .../ksh93/src/lib/libast/vmalloc/vmdebug.c | 176 +- .../ksh93/src/lib/libast/vmalloc/vmdisc.c | 9 +- .../ksh93/src/lib/libast/vmalloc/vmexit.c | 20 +- .../ksh93/src/lib/libast/vmalloc/vmgetmem.c | 10 +- .../ksh93/src/lib/libast/vmalloc/vmhdr.h | 91 +- .../ksh93/src/lib/libast/vmalloc/vmlast.c | 98 +- .../ksh93/src/lib/libast/vmalloc/vmmopen.c | 127 +- .../ksh93/src/lib/libast/vmalloc/vmopen.c | 29 +- .../ksh93/src/lib/libast/vmalloc/vmpool.c | 76 +- .../ksh93/src/lib/libast/vmalloc/vmprivate.c | 45 +- .../ksh93/src/lib/libast/vmalloc/vmprofile.c | 129 +- .../ksh93/src/lib/libast/vmalloc/vmregion.c | 8 +- .../ksh93/src/lib/libast/vmalloc/vmsegment.c | 12 +- .../ksh93/src/lib/libast/vmalloc/vmset.c | 12 +- .../ksh93/src/lib/libast/vmalloc/vmstat.c | 9 +- .../ksh93/src/lib/libast/vmalloc/vmstrdup.c | 7 +- .../ksh93/src/lib/libast/vmalloc/vmtrace.c | 53 +- .../ksh93/src/lib/libast/vmalloc/vmwalk.c | 10 +- .../dtksh/ksh93/src/lib/libcmd/Mamfile | 297 +- .../dtksh/ksh93/src/lib/libcmd/RELEASE | 20 +- .../dtksh/ksh93/src/lib/libcmd/basename.c | 11 +- cde/programs/dtksh/ksh93/src/lib/libcmd/cat.c | 11 +- .../dtksh/ksh93/src/lib/libcmd/chgrp.c | 81 +- .../dtksh/ksh93/src/lib/libcmd/chmod.c | 22 +- .../dtksh/ksh93/src/lib/libcmd/chown.c | 2 +- .../dtksh/ksh93/src/lib/libcmd/cksum.c | 23 +- cde/programs/dtksh/ksh93/src/lib/libcmd/cmd.h | 2 +- .../dtksh/ksh93/src/lib/libcmd/cmdinit.c | 2 +- cde/programs/dtksh/ksh93/src/lib/libcmd/cmp.c | 37 +- .../dtksh/ksh93/src/lib/libcmd/comm.c | 18 +- cde/programs/dtksh/ksh93/src/lib/libcmd/cp.c | 62 +- cde/programs/dtksh/ksh93/src/lib/libcmd/cut.c | 34 +- .../dtksh/ksh93/src/lib/libcmd/date.c | 52 +- .../dtksh/ksh93/src/lib/libcmd/dirname.c | 11 +- .../dtksh/ksh93/src/lib/libcmd/expr.c | 90 +- cde/programs/dtksh/ksh93/src/lib/libcmd/fds.c | 27 +- cde/programs/dtksh/ksh93/src/lib/libcmd/fmt.c | 9 +- .../dtksh/ksh93/src/lib/libcmd/fold.c | 11 +- .../dtksh/ksh93/src/lib/libcmd/fts_fix.c | 57 - .../dtksh/ksh93/src/lib/libcmd/fts_fix.h | 49 - .../dtksh/ksh93/src/lib/libcmd/getconf.c | 164 +- .../dtksh/ksh93/src/lib/libcmd/head.c | 50 +- cde/programs/dtksh/ksh93/src/lib/libcmd/id.c | 24 +- .../dtksh/ksh93/src/lib/libcmd/join.c | 28 +- cde/programs/dtksh/ksh93/src/lib/libcmd/lib.c | 2 +- cde/programs/dtksh/ksh93/src/lib/libcmd/ln.c | 2 +- .../dtksh/ksh93/src/lib/libcmd/logname.c | 18 +- .../dtksh/ksh93/src/lib/libcmd/md5sum.c | 2 +- .../dtksh/ksh93/src/lib/libcmd/mkdir.c | 13 +- .../dtksh/ksh93/src/lib/libcmd/mkfifo.c | 15 +- .../dtksh/ksh93/src/lib/libcmd/mktemp.c | 11 +- cde/programs/dtksh/ksh93/src/lib/libcmd/mv.c | 2 +- .../dtksh/ksh93/src/lib/libcmd/paste.c | 24 +- .../dtksh/ksh93/src/lib/libcmd/pathchk.c | 9 +- .../dtksh/ksh93/src/lib/libcmd/pids.c | 17 +- cde/programs/dtksh/ksh93/src/lib/libcmd/rev.c | 16 +- cde/programs/dtksh/ksh93/src/lib/libcmd/rev.h | 2 +- .../dtksh/ksh93/src/lib/libcmd/revlib.c | 2 +- cde/programs/dtksh/ksh93/src/lib/libcmd/rm.c | 50 +- .../dtksh/ksh93/src/lib/libcmd/rmdir.c | 10 +- .../dtksh/ksh93/src/lib/libcmd/stty.c | 80 +- cde/programs/dtksh/ksh93/src/lib/libcmd/sum.c | 2 +- .../dtksh/ksh93/src/lib/libcmd/sync.c | 12 +- .../dtksh/ksh93/src/lib/libcmd/tail.c | 65 +- cde/programs/dtksh/ksh93/src/lib/libcmd/tee.c | 16 +- cde/programs/dtksh/ksh93/src/lib/libcmd/tty.c | 9 +- .../dtksh/ksh93/src/lib/libcmd/uname.c | 78 +- .../dtksh/ksh93/src/lib/libcmd/uniq.c | 19 +- .../dtksh/ksh93/src/lib/libcmd/vmstate.c | 25 +- cde/programs/dtksh/ksh93/src/lib/libcmd/wc.c | 11 +- cde/programs/dtksh/ksh93/src/lib/libcmd/wc.h | 2 +- .../dtksh/ksh93/src/lib/libcmd/wclib.c | 8 +- .../dtksh/ksh93/src/lib/libdll/Mamfile | 50 +- .../dtksh/ksh93/src/lib/libdll/dlfcn.c | 12 +- .../dtksh/ksh93/src/lib/libdll/dll_lib.c | 2 +- .../dtksh/ksh93/src/lib/libdll/dllcheck.c | 2 +- .../dtksh/ksh93/src/lib/libdll/dllerror.c | 2 +- .../dtksh/ksh93/src/lib/libdll/dllfind.c | 2 +- .../dtksh/ksh93/src/lib/libdll/dlllib.h | 2 +- .../dtksh/ksh93/src/lib/libdll/dlllook.c | 2 +- .../dtksh/ksh93/src/lib/libdll/dllnext.c | 2 +- .../dtksh/ksh93/src/lib/libdll/dllopen.c | 6 +- .../dtksh/ksh93/src/lib/libdll/dllplug.c | 2 +- .../dtksh/ksh93/src/lib/libdll/dllscan.c | 4 +- .../dtksh/ksh93/src/lib/libdll/features/dll | 12 +- .../dtksh/ksh93/src/lib/libsum/Mamfile | 60 +- .../dtksh/ksh93/src/lib/libsum/RELEASE | 2 +- .../dtksh/ksh93/src/lib/libsum/sum-ast4.c | 6 +- .../dtksh/ksh93/src/lib/libsum/sum-att.c | 72 +- .../dtksh/ksh93/src/lib/libsum/sum-bsd.c | 2 +- .../dtksh/ksh93/src/lib/libsum/sum-crc.c | 163 +- .../dtksh/ksh93/src/lib/libsum/sum-lmd.c | 16 +- .../dtksh/ksh93/src/lib/libsum/sum-md5.c | 1 - .../dtksh/ksh93/src/lib/libsum/sum-prng.c | 2 +- .../dtksh/ksh93/src/lib/libsum/sum-sha1.c | 1 - .../dtksh/ksh93/src/lib/libsum/sum-sha2.c | 9 +- cde/programs/dtksh/ksh93/src/lib/libsum/sum.h | 2 +- .../dtksh/ksh93/src/lib/libsum/sumlib.c | 8 +- cde/programs/dtksh/setup.sh | 9 - 1179 files changed, 22005 insertions(+), 45914 deletions(-) delete mode 100644 cde/programs/dtksh/init.patch create mode 100644 cde/programs/dtksh/ksh93/ANNOUNCE create mode 100644 cde/programs/dtksh/ksh93/COPYRIGHT create mode 100755 cde/programs/dtksh/ksh93/bin/Mamfile_rm_unused_vars delete mode 100644 cde/programs/dtksh/ksh93/lib/package/CONVERT.mk delete mode 100644 cde/programs/dtksh/ksh93/lib/package/INIT.README delete mode 100644 cde/programs/dtksh/ksh93/lib/package/INIT.html delete mode 100644 cde/programs/dtksh/ksh93/lib/package/INIT.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/INIT.req delete mode 100644 cde/programs/dtksh/ksh93/lib/package/INIT.ver delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-ast.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-base.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-base.req delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-base.ver delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-dss.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-ksh.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-ksh.req delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-ksh.ver delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-make.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-open.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-open.req delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast-open.ver delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast.def delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ast.lic delete mode 100644 cde/programs/dtksh/ksh93/lib/package/bsd.def delete mode 100644 cde/programs/dtksh/ksh93/lib/package/bsd.lic delete mode 100644 cde/programs/dtksh/ksh93/lib/package/epl.def delete mode 100644 cde/programs/dtksh/ksh93/lib/package/ksh.pkg delete mode 100644 cde/programs/dtksh/ksh93/lib/package/package.mk delete mode 100644 cde/programs/dtksh/ksh93/lib/package/zlib.def delete mode 100644 cde/programs/dtksh/ksh93/lib/package/zlib.lic delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/CONVERT.mk delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/MAPLIB.mk delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/MSGFUN.mk delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/MSGKEY.mk delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/PROBE.mk delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/TEST.mk delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/WWW.mk delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/ar.freebsd12.amd64 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/ar.linux.i386-64 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin07 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin11 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.freebsd delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.aarch64 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64-icc delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-icc delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.ia64-icc delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.openbsd delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386-64 delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc delete mode 100755 cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc-64 delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/ditto.sh delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/hurl.sh delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/package.mk delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/proto.c create mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/proto.sh delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/ratz.c delete mode 100644 cde/programs/dtksh/ksh93/src/cmd/INIT/release.c mode change 100755 => 100644 cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty create mode 100644 cde/programs/dtksh/ksh93/src/cmd/ksh93/tests/_common create mode 100755 cde/programs/dtksh/ksh93/src/cmd/ksh93/tests/jobs.sh create mode 100755 cde/programs/dtksh/ksh93/src/cmd/ksh93/tests/readonly.sh delete mode 100644 cde/programs/dtksh/ksh93/src/lib/libast/obsolete/spawn.c create mode 100644 cde/programs/dtksh/ksh93/src/lib/libast/path/pathicase.c delete mode 100644 cde/programs/dtksh/ksh93/src/lib/libast/port/astlicense.c delete mode 100644 cde/programs/dtksh/ksh93/src/lib/libcmd/fts_fix.c delete mode 100644 cde/programs/dtksh/ksh93/src/lib/libcmd/fts_fix.h delete mode 100755 cde/programs/dtksh/setup.sh diff --git a/cde/programs/dtksh/Makefile.am b/cde/programs/dtksh/Makefile.am index 603ba6af4..6226c2f51 100644 --- a/cde/programs/dtksh/Makefile.am +++ b/cde/programs/dtksh/Makefile.am @@ -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 diff --git a/cde/programs/dtksh/dtkcmds.h b/cde/programs/dtksh/dtkcmds.h index df063e3d5..d5fd46988 100644 --- a/cde/programs/dtksh/dtkcmds.h +++ b/cde/programs/dtksh/dtkcmds.h @@ -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[]; diff --git a/cde/programs/dtksh/init.patch b/cde/programs/dtksh/init.patch deleted file mode 100644 index c0bf6cd69..000000000 --- a/cde/programs/dtksh/init.patch +++ /dev/null @@ -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
-+#include
-+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 - #include -@@ -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); - } diff --git a/cde/programs/dtksh/ksh93/.github/workflows/ci.yml b/cde/programs/dtksh/ksh93/.github/workflows/ci.yml index 8da245115..c0d0217a4 100644 --- a/cde/programs/dtksh/ksh93/.github/workflows/ci.yml +++ b/cde/programs/dtksh/ksh93/.github/workflows/ci.yml @@ -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" diff --git a/cde/programs/dtksh/ksh93/.gitignore b/cde/programs/dtksh/ksh93/.gitignore index 652d8f18f..f68096577 100644 --- a/cde/programs/dtksh/ksh93/.gitignore +++ b/cde/programs/dtksh/ksh93/.gitignore @@ -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 diff --git a/cde/programs/dtksh/ksh93/ANNOUNCE b/cde/programs/dtksh/ksh93/ANNOUNCE new file mode 100644 index 000000000..332b8ad4e --- /dev/null +++ b/cde/programs/dtksh/ksh93/ANNOUNCE @@ -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, 7 will now move the cursor seven positions to + the left. In vi control mode, this would be entered as: 7 . + +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. diff --git a/cde/programs/dtksh/ksh93/COPYRIGHT b/cde/programs/dtksh/ksh93/COPYRIGHT new file mode 100644 index 000000000..72982159b --- /dev/null +++ b/cde/programs/dtksh/ksh93/COPYRIGHT @@ -0,0 +1,146 @@ +ksh 93u+m general copyright notice + +######################################################################## +# # +# The KornShell 93u+m distribution # +# Copyright (c) 2021 Contributors to ksh 93u+m # +# # +# 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 # +# Johnothan King # +# hyenias <58673227+hyenias@users.noreply.github.com> # +# Anuradha Weeraman # +# Chase # +# Govind Kamat # +# Harald van Dijk # +# Lev Kujawski # +# Marc Wilson # +# # +######################################################################## + +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 # +# David Korn # +# Phong Vo # +# Adam Edgar # +# Adam Buchsbaum # +# Aman Shaikh # +# Bala Krishnamurthy # +# Brian Russell # +# Robin Chen # +# Don Caldwell # +# Lefty Koutsofios # +# Bob Gruber # +# Jia Wang # +# Jeff Fellin # +# Jeff Korn <@google.com> # +# Kathleen Fisher # +# Ken Church <@microsoft.com> # +# Brian Kernigham # +# Dennis Ritchie # +# Doug McIlroy # +# Eduardo Krell # +# John Snyder # +# Herman Rao # +# AST users mailgroup # +# AST developers mailgroup # +# # +######################################################################## + +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 # +# # +######################################################################## diff --git a/cde/programs/dtksh/ksh93/LICENSE.md b/cde/programs/dtksh/ksh93/LICENSE.md index 16cc69a52..b0e51e253 100644 --- a/cde/programs/dtksh/ksh93/LICENSE.md +++ b/cde/programs/dtksh/ksh93/LICENSE.md @@ -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. diff --git a/cde/programs/dtksh/ksh93/NEWS b/cde/programs/dtksh/ksh93/NEWS index bdea546ec..1ee13ee67 100644 --- a/cde/programs/dtksh/ksh93/NEWS +++ b/cde/programs/dtksh/ksh93/NEWS @@ -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'{}'} where 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. diff --git a/cde/programs/dtksh/ksh93/README.md b/cde/programs/dtksh/ksh93/README.md index f2337accd..24eabdfec 100644 --- a/cde/programs/dtksh/ksh93/README.md +++ b/cde/programs/dtksh/ksh93/README.md @@ -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. diff --git a/cde/programs/dtksh/ksh93/TODO b/cde/programs/dtksh/ksh93/TODO index aa6c8e839..eba7aeca9 100644 --- a/cde/programs/dtksh/ksh93/TODO +++ b/cde/programs/dtksh/ksh93/TODO @@ -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 diff --git a/cde/programs/dtksh/ksh93/bin/Mamfile_rm_unused_vars b/cde/programs/dtksh/ksh93/bin/Mamfile_rm_unused_vars new file mode 100755 index 000000000..07b78e54e --- /dev/null +++ b/cde/programs/dtksh/ksh93/bin/Mamfile_rm_unused_vars @@ -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.new +# +# Should work on all current POSIX compliant shells. +# By Martijn Dekker , 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 diff --git a/cde/programs/dtksh/ksh93/bin/ignore b/cde/programs/dtksh/ksh93/bin/ignore index 09611b70b..1c16225de 100755 --- a/cde/programs/dtksh/ksh93/bin/ignore +++ b/cde/programs/dtksh/ksh93/bin/ignore @@ -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 diff --git a/cde/programs/dtksh/ksh93/bin/mamprobe b/cde/programs/dtksh/ksh93/bin/mamprobe index d3f513fc9..294a9aaf6 100755 --- a/cde/programs/dtksh/ksh93/bin/mamprobe +++ b/cde/programs/dtksh/ksh93/bin/mamprobe @@ -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 # diff --git a/cde/programs/dtksh/ksh93/bin/package b/cde/programs/dtksh/ksh93/bin/package index 0d57a3bfa..1559ef771 100755 --- a/cde/programs/dtksh/ksh93/bin/package +++ b/cde/programs/dtksh/ksh93/bin/package @@ -1,8 +1,8 @@ -USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyright (c) 1994-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html]" ######################################################################## # # # This software is part of the ast package # # Copyright (c) 1994-2012 AT&T Intellectual Property # +# Copyright (c) 2020-2021 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # @@ -18,61 +18,68 @@ USAGE_LICENSE="[-author?Glenn Fowler ][-copyright?Copyrigh # Glenn Fowler # # # ######################################################################## -### this script contains archaic constructs that work with all sh variants ### -# package - source and binary package control -# Glenn Fowler +### this sh script is POSIX compliant and compatible with shell bugs ### +# KornShell 93u+m build system, main control script # +# based on AST 'package' by Glenn Fowler # +# simplified and rewritten by Martijn Dekker # +######################################################################## -command=package +# Escape from a non-POSIX shell +# ('test X -ef Y' is technically non-POSIX, but practically universal) +min_posix='test / -ef / && path=Bad && case $PATH in (Bad) exit 1;; esac && '\ +'PWD=Bad && cd -P -- / && case $PWD in (/) ;; (*) exit 1;; esac && '\ +'! { ! case x in ( x ) : ${0##*/} || : $( : ) ;; esac; } && '\ +'trap "exit 0" 0 && exit 1' +if (eval "$min_posix") 2>/dev/null +then : good shell +else "$SHELL" -c "$min_posix" 2>/dev/null && exec "$SHELL" -- "$0" ${1+"$@"} + sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} + DEFPATH=`getconf PATH` 2>/dev/null || DEFPATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin + PATH=$DEFPATH:$PATH + export PATH + sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} + echo "$0: Can't escape from obsolete or broken shell. Run me with a POSIX shell." >&2 + exit 128 +fi +readonly min_posix # use for checksh() +# Set standards compliance mode (command set -o posix) 2>/dev/null && set -o posix -path=Bad -case $PATH in -Bad*) echo "Cannot be run by zsh in native mode; use a sh symlink to zsh" >&2 - exit 1 ;; -esac +# Sanitize 'cd' unset CDPATH + +# Make the package root the current working directory +# This makes it possible to run '/my/path/package make' without cd'ing first +# (for all its featuritis, the AT&T version never could manage this) case $0 in --*) +[0123456789+-]*) echo "dodgy \$0: $0" >&2 - exit 1 ;; -*/package) - mydir=`echo "$0" | sed 's,/package$,,'` - cd "$mydir" || exit - case $PWD in - */bin) ;; - *) echo "this script must live in bin/" >&2 - exit 1 ;; - esac - cd .. || exit - unset mydir ;; -package) - echo "this script must be invoked with a direct path, e.g. bin/package" >&2 - exit 1 ;; + exit 128 ;; +*/*) + me=$0 ;; *) - echo "this script must be named 'package'" >&2 - exit 1 ;; + me=$(command -v "$0") || exit 128 ;; esac +me=$(dirname "$me") +cd "$me" || exit +unset -v me +case $PWD in +*/arch/*/*/bin) + cd .. ;; +*/arch/*/bin) + cd ../../.. ;; +*/bin) + cd .. ;; +*) + echo "this script must live in bin/" >&2 + exit 1 ;; +esac || exit # shell checks checksh() { - "$1" -ec ' - # reject csh - case 1 in - 1) ;; - esac - # reject special use of $path (to use zsh, use a "sh -> zsh" symlink, which disables this) - path=Bad - case $PATH in - Bad*) exit 1 ;; - esac - # catch (our own) pipe/socket configuration mismatches - date | "$1" -c "read x" || exit 1 - # check Bourne/POSIX compatible trap exit status (should exit with status 0) - trap "exit 0" 0 - exit 1 - ' x "$1" 2>/dev/null || return 1 + "$1" -c "$min_posix" 2>/dev/null || return 1 } LC_ALL=C @@ -84,94 +91,65 @@ export TMPDIR src="cmd contrib etc lib" use="/usr/common /exp /usr/local /usr/add-on /usr/addon /usr/tools /usr /opt" usr="/home" -lib="" # nee /usr/local/lib /usr/local/shlib +lib="" # need /usr/local/lib /usr/local/shlib ccs="/usr/kvm /usr/ccs/bin" org="gnu GNU" makefiles="Mamfile" # ksh 93u+m no longer uses these: Nmakefile nmakefile Makefile makefile -env="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH" -checksum=md5sum -checksum_commands="$checksum md5" -checksum_empty="d41d8cd98f00b204e9800998ecf8427e" +env="HOSTTYPE PACKAGEROOT INSTALLROOT PATH" package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' -PACKAGE_admin_tail_timeout=${PACKAGE_admin_tail_timeout:-"1m"} - CROSS=0 -admin_db=admin.db -admin_env=admin.env -admin_ditto="ditto --checksum --delete --verbose" -admin_ditto_update=--update -admin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*" -admin_list='PACKAGE.$type.lst' -admin_ping="ping -c 1 -w 5" - -default_url=default.url MAKESKIP=${MAKESKIP:-"*[-.]*"} -RATZ=ratz -SED= -TAR=tar -TARFLAGS=xv -TARPROBE=B -TR= all_types='*.*|sun4' # all but sun4 match *.* -case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +command=${0##*/} +case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in 0123) USAGE=$' [-? -@(#)$Id: package (AT&T Research) 2012-06-28 $ -]'$USAGE_LICENSE$' -[+NAME?package - source and binary package control] -[+DESCRIPTION?The \bpackage\b command controls source and binary - packages. It is a \bsh\b(1) script coded for maximal portability. All - package files are in the \b$PACKAGEROOT\b directory tree. - \b$PACKAGEROOT\b must at minimum contain a \bbin/package\b command or a - \blib/package\b directory. Binary package files are in the - \b$INSTALLROOT\b (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where - \ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b - require the current directory to be under \b$PACKAGEROOT\b. See - \bDETAILS\b for more information.] +@(#)$Id: '$command$' (ksh 93u+m) 2021-12-31 $ +] +[-author?Glenn Fowler ] +[-author?Contributors to https://github.com/ksh93/ksh] +[-copyright?(c) 1994-2012 AT&T Intellectual Property] +[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh] +[-license?http://www.eclipse.org/org/documents/epl-v10.html] +[+NAME?'$command$' - build, test and install ksh 93u+m] +[+DESCRIPTION?The \b'$command$'\b command is the main control script + for building and installing KornShell 93u+m. + It is a POSIX \bsh\b(1) script coded for maximal portability. + A POSIX shell and C compiler installation are the only requirements. + All package files are in the \b$PACKAGEROOT\b directory tree. + Binary package files are in the \b$INSTALLROOT\b + (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where + \ahosttype\a=$(\bbin/package host type\b). + See \bDETAILS\b for more information.] [+?Note that no environment variables need be set by the user; - \bpackage\b determines the environment based on the current working + \b'$command$'\b determines the environment based on the current working directory. The \buse\b action starts a \bsh\b(1) with the environment initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set by explicit command argument assignments to override the defaults.] -[+?Packages are composed of components. Each component is built and - installed by an \bast\b \bnmake\b(1) makefile. Each package is also - described by an \bnmake\b makefile that lists its components and - provides a content description. The package makefile and component - makefiles provide all the information required to read, write, build - and install packages.] -[+?Package recipients only need \bsh\b(1) and \bcc\b(1) to build and - install source packages, and \bsh\b to install binary packages. - \bnmake\b and \bksh93\b are required to write new packages. An - \b$INSTALLROOT/bin/cc\b script may be supplied for some architectures. - This script supplies a reasonable set of default options for compilers - that accept multiple dialects or generate multiple object/executable - formats.] [+?The command arguments are composed of a sequence of words: zero or more \aqualifiers\a, one \aaction\a, and zero or more action-specific - \aarguments\a, and zero or more \aname=value\a definitions. \apackage\a - names a particular package. The naming scheme is a \b-\b separated - hierarchy; the leftmost parts describe ownership, e.g., - \bgnu-fileutils\b, \bast-base\b. If no packages are specified then all - packages are operated on. \boptget\b(3) documentation options are also - supported. The default with no arguments is \bhost type\b.] + \aarguments\a, and zero or more \aname=value\a definitions. + \boptget\b(3) documentation options such as \b--man\b, \b--html\b + and \b--nroff\b are also supported. + The default with no arguments is \bhost type\b.] [+?The qualifiers are:] { - [+authorize \aname\a?Remote authorization user name or license - acceptance phrase.] [+debug|environment?Show environment and actions but do not execute.] - [+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto - \b$PACKAGEROOT\b.] + [+flat?With the \bmake\b action, create a flat view by linking all + files from \b$INSTALLROOT\b, minus \b*.old\b files, + onto their corresponding path under \b$PACKAGEROOT\b. + Only one architecture can have a flat view. + If \bflat\b is specified with the \bclean\b action, then + only clean up this flat view and do not delete \b$INSTALLROOT\b.] [+force?Force the action to override saved state.] [+never?Run make -N and show other actions.] [+only?Only operate on the specified packages.] - [+password \apassword\a?Remote authorization or license - acceptance password.] [+quiet?Do not list captured action output.] [+show?Run make -n and show other actions.] [+verbose?Provide detailed action output.] @@ -179,64 +157,11 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in } [+?The actions are:] { - [+admin\b [\ball\b]] [\bdb\b \afile\a]] [\bon\b \apattern\a]][\aaction\a ...]]?Apply - \aaction\a ... to the hosts listed in \afile\a. If \afile\a is - omitted then \badmin.db\b is assumed. The caller must have - \brcp\b(1) and \brsh\b(1) or \bscp\b(1) and \bssh\b(1) access - to the hosts. Output for \aaction\a is saved per-host in the - file \aaction\a\b.log/\b\ahost\a. Logs can be viewed by - \bpackage admin\b [\bon\b \ahost\a]] \bresults\b [\aaction\a]]. - By default only local PACKAGEROOT hosts are selected from - \afile\a; \ball\b selects all hosts. \bon\b \apattern\a selects - only hosts matching the \b|\b separated \apattern\a. \afile\a - contains four types of lines. Blank lines and lines beginning - with \b#\b are ignored. Lines starting with \aid\a=\avalue\a - are variable assignments. Set admin_ping to local conventions - if \"'$admin_ping$'\" fails. If a package list is not specified - on the command line the \aaction\a applies to all packages; a - variable assignment \bpackage\b=\"\alist\a\" applies \aaction\a - to the packages in \alist\a for subsequent hosts in \afile\a. - The remaining line type is a host description consisting of 6 - tab separated fields. The first 3 are mandatory; the remaining - 3 are updated by the \badmin\b action. \afile\a is saved in - \afile\a\b.old\b before update. The fields are:] - { - [+hosttype?The host type as reported by - \"\bpackage\b\".] - [+[user@]]host?The host name and optionally user name - for \brcp\b(1) and \brsh\b(1) access.] - [+[remote::[[master]]::]]]]PACKAGEROOT?The absolute remote package - root directory and optionally the remote protocol (rsh - or ssh) if the directory is on a different server than - the master package root directory. If - \blib/package/admin/'$admin_env$'\b exists under this - directory then it is sourced by \bsh\b(1) before - \aaction\a is done. If this field begins with \b-\b - then the host is ignored. If this field contains \b:\b - then \bditto\b(1) is used to sync the remote \bsrc\b - directory hierarchy to the local one. If [\amaster\a]]: - is specified then the sync is deferred to the \amaster\a - host. If \amaster\a is omitted (two :) then the sync is - disabled. These directories must exist on the remote side: - \blib/package\b, \bsrc/cmd\b, \bsrc/lib\b.] - [+date?\aYYMMDD\a of the last action.] - [+time?Elapsed wall time for the last action.] - [+M T W?The \badmin\b action \bmake\b, \btest\b and - \bwrite\b action error counts. A non-numeric value in - any of these fields disables the corresponding action.] - [+owner?The owner contact information.] - [+attributes?\aname=value\a attributes. Should at least contain - \bcc\b=\acompiler-version\a.] - } - [+clean | clobber?Delete the \barch/\b\aHOSTTYPE\a hierarchy; this + [+clean | clobber?Clean up the flat view, if any. + Then, unless \bflat\b was given, + delete the \barch/\b\aHOSTTYPE\a hierarchy; this deletes all generated files and directories for \aHOSTTYPE\a. - The hierarchy can be rebuilt by \bpackage make\b.] - [+contents\b [ \apackage\a ... ]]?List description and - components for \apackage\a on the standard output.] - [+copyright\b [ \apackage\a ... ]]?List the general copyright - notice(s) for \apackage\a on the standard output. Note that - individual components in \apackage\a may contain additional or - replacement notices.] + The hierarchy can be rebuilt by \b'$command$' make\b.] [+export\b [ \avariable\a ...]]?List \aname\a=\avalue\a for \avariable\a, one per line. If the \bonly\b attribute is specified then only the variable values are listed. If no @@ -250,11 +175,11 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in \aattribute\a order. The attributes are:] { [+canon \aname\a?An external host type name to be - converted to \bpackage\b syntax.] - [+cpu?The number of cpus; 1 if the host is not a + converted to \b'$command$'\b syntax.] + [+cpu?The number of CPUs; 1 if the host is not a multiprocessor.] [+name?The host name.] - [+rating?The cpu rating in pseudo mips; the value is + [+rating?The CPU rating in pseudo mips; the value is useful useful only in comparisons with rating values of other hosts. Other than a vax rating (mercifully) fixed at 1, ratings can vary wildly but consistently from @@ -269,188 +194,45 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in release incompatibilities has for the most part been futile.] } - [+html\b [ \aaction\a ]]?Display html help text on the standard - error (standard output for \aaction\a).] - [+install\b [ \aarchitecture\a ... ]] \adirectory\a [ \apackage\a ... ]]?Copy - the package binary hierarchy to \adirectory\a. If - \aarchitecture\a is omitted then all architectures are - installed. If \bflat\b is specified then exactly one - \aarchitecture\a must be specified; this architecture will be - installed in \adirectory\a without the \barch/\b\aHOSTTYPE\a - directory prefixes. Otherwise each architecture will be - installed in a separate \barch/\b\aHOSTTYPE\a subdirectory of - \adirectory\a. The \aarchitecture\a \b-\b names the current - architecture. \adirectory\a must be an existing directory. If - \apackage\a is omitted then all binary packages are installed. - This action requires \bnmake\b.] - [+license\b [ \apackage\a ... ]]?List the source license(s) for - \apackage\a on the standard output. Note that individual - components in \apackage\a may contain additional or replacement - licenses.] - [+list\b [ \apackage\a ... ]]?List the name, version and - prerequisites for \apackage\a on the standard output.] + [+install\b To be reimplemented.] [+make\b [ \apackage\a ]] [ \aoption\a ... ]] [ \atarget\a ... ]]?Build and install. The default \atarget\a is \binstall\b, which makes and installs \apackage\a. If the standard output is a terminal then the output is also captured in \b$INSTALLROOT/lib/package/gen/make.out\b. The build is done in the \b$INSTALLROOT\b directory tree viewpathed on top of the - \b$PACKAGEROOT\b directory tree. If \bflat\b is specified then - the \b$INSTALLROOT\b { bin fun include lib } directories are - linked to the same directories in the package root. Only one - architecture may be \bflat\b. Leaf directory names matching the + \b$PACKAGEROOT\b directory tree. Leaf directory names matching the \b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The \bview\b action is done before making. \aoption\a operands are passed to the underlying make command.] - [+read\b [ \apackage\a ... | \aarchive\a ... ]]?Read the named - package or archive(s). Must be run from the package root - directory. Archives are searched for in \b.\b and - \blib/package/tgz\b. Each package archive is read only once. - The file \blib/package/tgz/\b\apackage\a[.\atype\a]]\b.tim\b - tracks the read time. See the \bwrite\b action for archive - naming conventions. Text file archive member are assumed to be - ASCII or UTF-8 encoded.] - [+regress?\bdiff\b(1) the current and previous \bpackage test\b - results.] - [+release\b [ [\aCC\a]]\aYY-MM-DD\a [ [\acc\a]]\ayy-mm-dd\a ]]]] [ \apackage\a ]]?Display - recent changes for the date range [\aCC\a]]\aYY-MM-DD\a (up to - [\acc\a]]\ayy-mm-dd\a.), where \b-\b means lowest (or highest.) - If no dates are specified then changes for the last 4 months - are listed. \apackage\a may be a package or component name.] - [+remove\b [ \apackage\a ]]?Remove files installed for - \apackage\a.] [+results\b [ \bfailed\b ]] [ \bpath\b ]] [ \bold\b ]] [\bmake\b | \btest\b | \bwrite\b ]]?List results and interesting messages captured by the most recent \bmake\b (default), \btest\b or \bwrite\b action. \bold\b specifies the previous results, if any (current and previous - results are retained.) \b$HOME/.pkgresults\b, if it exists, + results are retained). \b$HOME/.pkgresults\b, if it exists, must contain an \begrep\b(1) expression of result lines to be ignored. \bfailed\b lists failures only and \bpath\b lists the results file path name only.] - [+setup\b [ beta ]] [ binary ]] [ source ]] [ \aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?This - action initializes the current directory as a package root, runs the - \bupdate\b action to download new or out of date packages, and runs the - \bread\b action on those packages. If \bflat\b is specified then the - \b$INSTALLROOT\b { bin fun include lib } directories are linked to the - same directories in the package root. Only one architecture may be - \bflat\b. See the \bupdate\b and \bread\b action descriptions for - argument details.] - [+test\b [ \apackage\a ]]?Run the regression tests for - \apackage\a. If the standard output is a terminal then the - output is also captured in - \b$INSTALLROOT/lib/package/gen/test.out\b. In general a package - must be made before it can be tested. Components tested with - the \bregress\b(1) command require \bksh93\b. If \bonly\b is - also specified then only the listed package components are - tested, otherwise the closure of the components is tested.] - [+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download - the latest release of the selected and required packages from \aurl\a - (e.g., \bhttp://www.research.att.com/sw/download\b) into the directory - \b$PACKAGEROOT/lib/package/tgz\b. \bbeta\b accesses beta packages; - download these at your own risk. If \aarchitecture\a is omitted then - only architectures already present in the \btgz\b directory will be - downloaded. If \aarchitecture\a is \b-\b then all posted architectures - will be downloaded. If \aurl\a matches \b*.url\b then it is interpreted - as a file containing shell variable assignments for \burl\b, - \bauthorize\b and \bpassword\b. If \aurl\a is omitted then the - definitions for \burl\b, \bauthorize\b and \bpassword\b in - \b$PACKAGEROOT/lib/package/tgz/default.url\b, if it exists, are used. - If \b$PACKAGEROOT/lib/package/tgz/default.url\b does not exist then it - is initialized with the current \burl\b, \bauthorize\b and \bpassword\b - values and read permission for the current user only. If \apackage\a is - omitted then only packages already present in the tgz directory will be - downloaded. If \apackage\a is \b-\b then all posted packages will be - downloaded. If \bsource\b and \bbinary\b are omitted then both source - and binary packages will be downloaded. If \bonly\b is specified then - only the named packages are updated; otherwise the closure of required - packages is updated. This action requires \bwget\b(1), \blynx\b(1), - \bcurl\b(1) or a shell that supports io to - \b/dev/tcp/\b\ahost\a/\aport\a.] + [+test\b [ \aargument\a ... ]]?Run the regression tests for + \bksh\b. If the standard output is a terminal then the + output is also captured in \b$INSTALLROOT/lib/package/gen/test.out\b. + \bksh\b must be made before it can be tested. + All \aargument\as following \atest\a are passed to \bbin/shtests\b. + See \bbin/shtests --man\b for more information.] [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run \acommand\a, or an interactive shell if \acommand\a is omitted, with the environment initialized for using the package (can you say \ashared\a \alibrary\a or \adll\a without cussing?) If \auid\a or \apackage\a or \a.\a is specified then it is used to determine a \b$PACKAGEROOT\b, possibly different from - the current directory. For example, to try out bozo`s package: + the current directory. For example, to try out bozo'\'$'s package: \bpackage use bozo\b. The \buse\b action may be run from any directory. If the file \b$INSTALLROOT/lib/package/profile\b is readable then it is sourced to initialize the environment. 32 or 64 implies \b$PACKAGEROOT\b of . and specifies the target architecture - word size (which may be silently ignored.)] - [+verify\b [ \apackage\a ]]?Verify installed binary files - against the checksum files in - \b$INSTALLROOT/lib/\b\apackage\a\b/gen/*.sum\b. The checksum - files contain mode, user and group information. If the checksum - matches for a given file then the mode, user and group are - changed as necessary to match the checksum entry. A warning is - printed on the standard error for each mismatch. Requires the - \bast\b package \bcksum\b(1) command.] + word size (which may be silently ignored).] [+view\b?Initialize the architecture specific viewpath - hierarchy. If \bflat\b is specified then the \b$INSTALLROOT\b { - bin fun include lib } directories are linked to the same - directories in the package root. Only one architecture may be - \bflat\b. The \bmake\b action implicitly calls this action.] - [+write\b [\aformat\a]] \atype\a ... [ \apackage\a ...]]?Write - a package archive for \apackage\a. All work is done in the - \b$PACKAGEROOT/lib/package\b directory. \aformat\a-specific - files are placed in the \aformat\a subdirectory. A - \apackage\a[.\atype\a]]\b.tim\b file in this directory tracks - the write time and prevents a package from being read in the - same root it was written. If more than one file is generated - for a particular \aformat\a then those files are placed in the - \aformat\a/\apackage\a subdirectory. File names in the - \aformat\a subdirectory will contain the package name, a - \ayyyy-mm-dd\a date, and for binary packages, \aHOSTTYPE\a. If - \apackage\a is omitted then an ordered list of previously - written packages is generated. If \bonly\b is specified then - only the named packages will be written; otherwise prerequisite - packages are written first. Package components must be listed - in \apackage\a\b.pkg\b. \aformat\a may be one of:] - { - [+cyg?Generate a \bcygwin\b package.] - [+exp?Generate an \bexptools\b maintainer source - archive and \aNPD\a file, suitable for \bexpmake\b(1)] - [+lcl?Generate a package archive suitable for - restoration into the local source tree (i.e., the - source is not annotated for licencing.)] - [+pkg?Generate a \bpkgmk\b(1) package suitable for - \bpkgadd\b(1).] - [+rpm?Generate an \brpm\b(1) package.] - [+tgz?Generate a \bgzip\b(1) \btar\b(1) package - archive. This is the default.] - [+tst?Generate a \btgz\b format package archive in the - \btst\b subdirectory. Version state files are not updated.] - } - [+?\btype\b specifies the package type which must be one of - \bsource\b, \bbinary\b or \bruntime\b. A source package - contains the source needed to build the corresponding binary - package. A binary package includes the libraries and headers - needed for compiling and linking against the public interfaces. - A runtime package contains the commands and required dynamic - libraries.] - [+?A package may be either a \bbase\b or \bdelta\b. A base - package contains a complete copy of all components. A delta - package contains only changes from a previous base package. - Delta recipients must have the \bast\b \bpax\b(1) command (in - the \bast-base\b package.) If neither \bbase\b nor \bdelta\b is - specified, then the current base is overwritten if there are no - deltas referring to the current base. Only the \btgz\b and - \blcl\b formats support \bdelta\b. If \bbase\b is specified - then a new base and two delta archives are generated: one delta - to generate the new base from the old, and one delta to - generate the old base from the new; the old base is then - removed. If \bdelta\b is specified then a new delta referring - to the current base is written.] - [+?\apackage\a\b.pkg\b may reference other packages. By default - a pointer to those packages is written. The recipient \bpackage - read\b will then check that all required packages have been - downloaded. If \bclosure\b is specified then the components for - all package references are included in the generated package. - This may be useful for \blcl\b and versioning.] - [+?All formats but \blcl\b annotate each \bsource\b file (not - already annotated) with a license comment as it is written to - the package archive using \bproto\b(1).] + hierarchy. The \bmake\b action implicitly calls this action.] } [+DETAILS?The package directory hierarchy is rooted at \b$PACKAGEROOT\b. All source and binaries reside under this tree. A two @@ -461,102 +243,46 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in architectures can be made from a single copy of the source.] [+?Independent \b$PACKAGEROOT\b hierarchies can be combined by appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The - \bVPATH\b viewing order is from left to right. Each \b$PACKAGEROOT\b - must have a \b$PACKAGEROOT/lib/package\b directory.] -[+?Each package contains one or more components. Component source for - the \afoo\a command is in \b$PACKAGEROOT/src/cmd/\b\afoo\a, and source - for the \abar\a library is in \b$PACKAGEROOT/src/lib/lib\b\abar\a. This - naming is for convenience only; the underlying makefiles handle - inter-component build order. The \bINIT\b component, which contains - generic package support files, is always made first, then the - components named \bINIT\b*, then the component order determined by the - closure of component makefile dependencies.] -[+?\b$PACKAGEROOT/lib/package\b contains package specific files. The - package naming convention is \agroup\a[-\apart\a]]; e.g., \bast-base\b, - \bgnu-fileutils\b. The *\b.pkg\b files are ast \bnmake\b(1) makefiles - that contain the package name, package components, references to other - packages, and a short package description. *\b.pkg\b files are used by - \bpackage write\b to generate new source and binary packages.] -[+?\b$PACKAGEROOT/lib/package/\b\agroup\a\b.lic\b files contain license - information that is used by the \bast\b \bproto\b(1) and \bnmake\b(1) - commands to generate source and binary license strings. \agroup\a is - determined by the first \b:PACKAGE:\b operator name listed in the - component \bnmake\b makefile. \agroup\a\b.lic\b files are part of the - licensing documentation. Each component may have its own \bLICENSE\b file - that overrides the \agroup\a\b.lic\b file. The full text of the licenses - are in the \b$PACKAGEROOT/lib/package/LICENSES\b and - \b$INSTALLROOT/lib/package/LICENSES\b directories.] -[+?A few files are generated in \b$PACKAGEROOT/lib/package/gen\b and - \b$INSTALLROOT/lib/package/gen\b. \apackage\a\b.ver\b contains one line - consisting of \apackage version release\a \b1\b for the most recent - instance of \apackage\a read into \b$PACKAGEROOT\b, where \apackage\a - is the package name, \aversion\a is the \aYYYY-MM-DD\a base version, - and \arelease\a is \aversion\a for the base release or \aYYYY-MM-DD\a - for delta releases. \apackage\a\b.req\b contains *\b.ver\b entries for - the packages required by \apackage\a, except that the fourth field is - \b0\b instead of \b1\b. All packages except \bINIT\b require the - \bINIT\b package. A simple sort of \apackage\a\b.pkg\b and *\b.ver\b - determines if the required package have been read in. Finally, - \apackage\a\b.README\b and \apackage\a\a.html\b contain the README text - for \apackage\a and all its components. Included are all changes added - to the component \bRELEASE\b, \bCHANGES\b or \bChangeLog\b files dated - since the two most recent base releases. Component \bRELEASE\b files - contain tag lines of the form [\aYY\a]]\aYY-MM-DD\a [ \atext\a ]] (or - \bdate\b(1) format dates) followed by README text, in reverse - chronological order (newer entries at the top of the file.) \bpackage - release\b lists this information, and \bpackage contents ...\b lists - the descriptions and components.] + \bVPATH\b viewing order is from left to right.] [+?\b$HOSTYPE\b names the current binary architecture and is determined - by the output of \bpackage\b (no arguments.) The \b$HOSTTYPE\b naming + by the output of \b'$command$'\b (no arguments). The \b$HOSTTYPE\b naming scheme is used to separate incompatible executable and object formats. All architecture specific binaries are placed under \b$INSTALLROOT\b - (\b$PACKAGEROOT/arch/$HOSTTYPE\b.) There are a few places that match + (\b$PACKAGEROOT/arch/$HOSTTYPE\b). There are a few places that match against \b$HOSTTYPE\b when making binaries; these are limited to makefile compiler workarounds, e.g., if \b$HOSTTYPE\b matches \bhp.*\b then turn off the optimizer for these objects. All other architecture - dependent logic is handled either by the \bast\b \biffe\b(1) command or + dependent logic is handled either by the \bAST\b \biffe\b(1) command or by component specific configure scripts. Explicit \b$HOSTYPE\b values matching *,*cc*[,-*,...]] optionally set the default \bCC\b and \bCCFLAGS\b. This is handy for build farms that support different compilers on the same architecture.] -[+?Each component contains an \bast\b \bnmake\b(1) makefile (either - \bNmakefile\b or \bMakefile\b) and a \bMAM\b (make abstract machine) - file (\bMamfile\b.) A Mamfile contains a portable makefile description - that is used by \bmamake\b(1) to simulate \bnmake\b. Currently there is - no support for old-make/gnu-make makefiles; if the binaries are just - being built then \bmamake\b will suffice; if source or makefile - modifications are anticipated then \bnmake\b (in the \bast-base\b - package) should be used. Mamfiles are automatically generated by - \bpackage write\b.] -[+?Most component C source is prototyped. If \b$CC\b (default value - \bcc\b) is not a prototyping C compiler then \bpackage make\b runs - \bproto\b(1) on portions of the \b$PACKAGEROOT/src\b tree and places - the converted output files in the \b$PACKAGEROOT/proto/src\b tree. - Converted files are then viewpathed over the original source. - \bproto\b(1) converts an ANSI C subset to code that is compatible with - K&R, ANSI, and C++ dialects.] +[+?Each component contains a \bMAM\b (make abstract machine) + file (\bMamfile\b). A Mamfile contains a portable makefile description + written in a simple dependency tree language using indented + \bmake\b...\bdone\b blocks.] [+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b - relative pathnames (via the \bast\b \bpathpath\b(3) function); there + relative pathnames (via the \bAST\b \bpathpath\b(3) function); there are no embedded absolute pathnames. This means that binaries generated under \b$PACKAGEROOT\b may be copied to a different root; users need only change their \b$PATH\b variable to reference the new installation - root \bbin\b directory. \bpackage install\b installs binary packages in + root \bbin\b directory. \b'$command$' install\b installs binary packages in a new \b$INSTALLROOT\b.] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] [+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexecrate\b(1), \bexpmake\b(1), - \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bnmake\b(1), \bpax\b(1), - \bpkgadd\b(1), \bpkgmk\b(1), \bproto\b(1), \bratz\b(1), \brpm\b(1), + \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bpax\b(1), + \bpkgadd\b(1), \bpkgmk\b(1), \brpm\b(1), \bsh\b(1), \btar\b(1), \boptget\b(3)] ' case $* in help) set -- --man ;; esac - while getopts -a $command "$USAGE" OPT + while getopts -a "$command" "$USAGE" OPT do : done - shift $OPTIND-1 + shift $((OPTIND-1)) ;; esac @@ -576,38 +302,28 @@ case $NM in esac action= -admin_all=1 -admin_on= -authorize= bit= exec= flat=0 force=0 global= hi= -html=0 ifs=${IFS-' '} lo= make= makeflags='-K' -nmakeflags= -nmakesep= nl=" " noexec= only=0 output= -package_src= -password= quiet=0 show=: tab=" " verbose=0 AUTHORIZE= DEBUG= -HURL= -PROTOROOT=- SHELLMAGIC=- unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true @@ -617,20 +333,11 @@ do case $# in 0) set host type ;; esac case $1 in - admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST) + clean|clobber|export|host|install|make|remove|results|test|use|view) action=$1 shift break ;; - authorize) - case $# in - 1) echo $command: $1: authorization user name argument expected >&2; exit 1 ;; - esac - shift - authorize=$1 - shift - continue - ;; debug|environment) exec=echo make=echo show=echo ;; @@ -642,15 +349,6 @@ do case $# in ;; only) only=1 ;; - password) - case $# in - 1) echo $command: $1: authorization password argument expected >&2; exit 1 ;; - esac - shift - password=$1 - shift - continue - ;; quiet) quiet=1 ;; show) exec=echo noexec=-n @@ -662,624 +360,191 @@ do case $# in set -x ;; help|HELP|html|man|--[?m]*) - case $1 in + case $1 in help) code=0 case $2 in '') exec 1>&2 ;; esac ;; - html) code=0 html=1 + html) code=0 html=1 + echo "$command help

$command help

"
 			;;
 		*)	code=2
 			exec 1>&2
 			;;
 		esac
-		case $html in
-		1)	bO="
-
-$2 package installation instructions
-
-"
-			eO='
-'
-			bH="

" - eH='

' - bP='

' - bL='

' - bL2='

' - eL='

' - bT='' - bD='' eD='' - bB='' eB='' - bI='' eI='' - bX='

'			eX='
' - bF='' eF='' - Camp='&' - Mcurl='curl(1)' - Mdate='date(1)' - Mfile='file(1)' - Mgunzip='gunzip(1)' - Mhurl='hurl(1)' - Mlynx='lynx(1)' - Mnmake='nmake(1)' - Mpackage='package(1)' - Mproto='proto(1)' - Mratz='ratz' - Mtar='tar(1)' - Mwget='wget(1)' - ;; - *) bO='' eO='' - bH='' eH=':' - bP='' - bL='' eL='' - bL2='' - bT=' ' - bD=' ' eD='' - bB='' eB='' - bI='' eI='' - bX='' eX='' - bF='"' eF='"' - Camp='&' - Mcurl='curl(1)' - Mdate='date(1)' - Mfile='file(1)' - Mgunzip='gunzip(1)' - Mhurl='hurl(1)' - Mlynx='lynx(1)' - Mnmake='nmake(1)' - Mpackage='package(1)' - Mproto='proto(1)' - Mratz='ratz' - Mtar='tar(1)' - Mwget='wget(1)' - ;; - esac - case $2 in - binary) echo "${bO} -${bH}Binary Package Installation Instructions${eH} -${bL} -${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may - have setuid executables, few must be owned by ${bI}root${eI}. These are best - changed manually when the security implications are understood.${eD} -${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work - area for all packages.${eD} -${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the - download site. If you already clicked, or if your system does not have - ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions - for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} - script which works with ksh and modern bash. The top level URL is:${bX} - URL=http://www.research.att.com/sw/download${eX}${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} - test -d bin || mkdir bin - url=\$URL/package - (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package - chmod +x bin/package${eX}${eD} -${bT}(5)${bD}Determine the list of package names you want from the download site, then - use the ${Mpackage} command to do the actual download:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - setup binary \$URL ${bI}PACKAGE${eI} ...${eX} - (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for - ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest - binary package(s); covered and up-to-date packages are not downloaded again unless - ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. - If the package root will contain only one architecture then you can install in ${bB}bin${eB} and - ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this - instead:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - flat setup binary \$URL ${bB}PACKAGE${eB} ...${eX} - To update the same packages from the same URL run:${bX} - bin/package setup binary${eX}${eD} -${bT}(6)${bD}The packaged binaries are position independent, i.e., they do not - contain hard-coded paths. However, commands with related files, like - ${Mfile} and ${Mnmake}, require the path of the bin directory to be - exported in ${bB}PATH${eb}.${eD} -${bT}(7)${bD}You can run the binaries directly from the package root, or you can - install them in a public root (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} - bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} - This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to - preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the - ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a - flat install:${bX} - cd \$INSTALLROOT - cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} -${bT}(8)${bD}To summarize, after the first time, the download cycle for the latest - binary release is:${bX} - bin/package setup binary${eX}${eD}${eL} + # Plain-text fallback. Regenerate with: + # ksh -c 'COLUMNS=80 bin/package --man' 2>&1 | sed "s/'/'\\\\''/g; 1s/^/echo '/; \$s/\$/'/" + echo 'NAME + package - build, test and install ksh 93u+m -${bH}Binary Package Installation Instructions -- Plan B${eH} -${bL} -${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives - into that directory.${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} - binary package:${bX} - gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz | - ${TAR} ${TARFLAGS}f -${eX} - Note that some browsers automatically unzip downloaded without warning. - If the gunzip fails try: - ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz - If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} - binary package:${bX} - mkdir bin - cp lib/package/tgz/ratz.${bI}YYYY-MM-DD.HOSTTYPE${eI}.exe bin/ratz - chmod +x bin/ratz - bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD/HOSTTYPE${eI}.tgz -${bT}(5)${bD}Read all unread package archive(s):${bX} - bin/package read${eX} - Both source and binary packages will be read by this step.${eD}${eL}${eO}" - ;; - intro) echo "${bO} -${bH}Package Hierarchy Details${eH} -${bP} -The package directory hierarchy is rooted at ${bB}\$PACKAGEROOT${eB}. All source and -binaries reside under this tree. A two level viewpath is used to separate -source and binaries. The top view is architecture specific, the bottom view -is shared source. All building is done in the architecture specific view; -no source view files are intentionally changed. This means that many -different binary architectures can be made from a single copy of the source. -${bP} -Each package contains one or more components. Component source for the ${bI}FOO${eI} -command is in ${bB}\$PACKAGEROOT/src/cmd/${eB}${bI}FOO${eI}, and source for the ${bI}BAR${eI} library is -in ${bB}\$PACKAGEROOT/src/lib/lib${eB}${bI}BAR${eI}. This naming is for convenience only; the -underlying makefiles handle inter-component build order. The ${bB}INIT${eB} component, -which contains generic package support files, is always made first, then the -components named ${bB}INIT${eB}*, then the order determined by the closure of component -makefile dependencies. -${bP} -${bB}\$PACKAGEROOT/lib/package${eB} contains package specific files. The package naming -convention is ${bI}GROUP${eI}[${bI}-PART${eI}]; e.g., ${bB}ast-base${eB}, ${bB}gnu-fileutils${eB}. The *${bB}.pkg${eB} files -are ${bB}ast${eB} ${Mnmake} makefiles that contain the package name, package components, -references to other packages, and a short package description. *${bB}.pkg${eB} files -are used by ${bF}package write${eF} to generate new source and binary packages. -${bP} -${bB}\$PACKAGEROOT/lib/package/${eB}${bI}GROUP${eI}${bB}.lic${eB} files contain license information that -is used by the ${bB}ast${eB} ${Mproto} and ${Mnmake} commands to generate source and -binary license strings. ${bI}GROUP${eI} is determined by the first ${bB}:PACKAGE:${eB} operator -name listed in the component ${bB}nmake${eB} makefile. ${bI}GROUP${eI}${bB}.lic${eB} files are part of the -licensing documentation. Each component may have its own ${bB}LICENSE${eB} file that -overrides the ${bI}GROUP${eI}${bB}.lic${eB} file. The full text of the licenses are in the -${bB}\$PACKAGEROOT/lib/package/LICENSES${eB} and ${bB}\$INSTALLROOT/lib/package/LICENSES${eB} -directories. -${bP} -A few files are generated in ${bB}\$PACKAGEROOT/lib/package/gen${eB} and -${bB}\$INSTALLROOT/lib/package/gen${eB}. ${bI}PACKAGE${eI}${bB}.ver${eB} contains one line consisting of${bX} - ${bI}PACKAGE VERSION RELEASE${eI} 1${eX} -for the most recent instance of ${bI}PACKAGE${eI} read into ${bB}\$PACKAGEROOT${eB}, where -${bI}PACKAGE${eI} is the package name, ${bI}VERSION${eI} is the ${bI}YYYY-MM-DD${eI} base version, -and ${bI}RELEASE${eI} is ${bI}VERSION${eI} for the base release or ${bI}YYYY-MM-DD${eI} for delta releases. -${bI}PACKAGE${eI}${bB}.req${eB} contains *${bB}.ver${eB} entries for the packages required by -${bI}PACKAGE${eI}, except that the fourth field is 0 instead of 1. All packages -except ${bB}INIT${eB} and ${Mratz} require the ${bB}INIT${eB} package. A simple sort of ${bI}PACKAGE${eI}${bB}.pkg${eB} -and *${bB}.ver${eB} determines if the required package have been read in. Finally, -${bI}PACKAGE${eI}${bB}.README${eB} contains the ${bB}README${eB} text for ${bI}PACKAGE${eI} and all its -components. Included are all changes added to the component ${bB}RELEASE${eB}, -${bB}CHANGES${eB} or ${bB}ChangeLog${eB} files dated since the two most recent base -releases. Component ${bB}RELEASE${eB} files contain tag lines of the form -[${bI}CC${eI}]${bI}YY-MM-DD${eI} [ ${bI}TEXT${eI} ] (or ${Mdate} format dates) followed by README -text, in reverse chronological order (newer entries at the top of the -file.) ${bF}package release${eF} generates this information, and -${bF}package contents ...${eF} lists the descriptions and components. -${bP} -${bB}\$HOSTYPE${eB} names the current binary architecture and is determined by the -output of ${bF}package${eF} (no arguments.) The ${bB}\$HOSTTYPE${eB} naming scheme is used -to separate incompatible executable and object formats. All architecture -specific binaries are placed under ${bB}\$INSTALLROOT${eB} (${bB}\$PACKAGEROOT/arch/\$HOSTTYPE${eB}.) -There are a few places that match against ${bB}\$HOSTTYPE${eB} when making binaries; these -are limited to makefile compiler workarounds, e.g., if ${bB}\$HOSTTYPE${eB} matches -'hp.*' then turn off the optimizer for these objects. All other architecture -dependent logic is handled either by ${bB}\$INSTALLROOT/bin/iffe${eB} or by component -specific configure scripts. Explicit ${bB}\$HOSTYPE${eB} values matching *,*cc*[,-*,...] -optionally set the default ${bB}CC${eB} and ${bB}CCFLAGS${eB}. This is handy for build -farms that support different compilers on the same architecture. -${bP} -Each component contains an ${bB}ast${eB} ${Mnmake} makefile (either ${bB}Nmakefile${eB} or ${bB}Makefile${eB}) -and a ${bI}MAM${eI} (make abstract machine) file (${bB}Mamfile${eB}.) A Mamfile contains a portable -makefile description that is used by ${bB}\$INSTALLROOT/bin/mamake${eB} to simulate -${bB}nmake${eB}. Currently there is no support for old-make/gnu-make makefiles; if -the binaries are just being built then ${bB}mamake${eB} will suffice; if source or -makefile modifications are anticipated then ${bB}nmake${eB} (from the ${bB}ast-open${eB} or -${bB}ast-base${eB} package) should be used. Mamfiles are automatically generated by -${bF}package write${eF}. -${bP} -Most component C source is prototyped. If ${bB}\$CC${eB} (default value ${bB}cc${eB}) is not a -prototyping C compiler then ${bF}package make${eF} runs ${Mproto} on portions of the -${bB}\$PACKAGEROOT/src${eB} tree and places the converted output files in the -${bB}\$PACKAGEROOT/proto/src${eB} tree. Converted files are then viewpathed over the -original source. The ${bB}ast${eB} ${Mproto} command converts an ANSI C subset to code -that is compatible with K&R, ANSI, and C++ dialects. -${bP} -All scripts and commands under ${bB}\$PACKAGEROOT${eB} use ${bB}\$PATH${eB} relative pathnames; -there are no embedded absolute pathnames. This means that binaries generated -under ${bB}\$PACKAGEROOT${eB} may be copied to a different root; users need only change -their ${bB}\$PATH${eB} variable to reference the new installation root bin directory. -${bF}package install${eF} installs binary packages in a new ${bB}\$INSTALLROOT${eB}. -${eO}" - ;; - source) echo "${bO} -${bH}Source Package Installation Instructions${eH} -${bL} -${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may - have setuid executables, few must be owned by ${bI}root${eI}. These are best - changed manually when the security implications are understood.${eD} -${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work - area for all packages. -${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the - download site. If you already clicked, or if your system does not have - ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions - for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} - script which works with ksh and modern bash. The top level URL is:${bX} - URL=http://www.research.att.com/sw/download${eX}${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} - test -d bin || mkdir bin - url=\$URL/package - (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package - chmod +x bin/package${eX}${eD} -${bT}(5)${bD}Determine the list of package names you want from the download site, then - use the ${Mpackage} command to do the actual download:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - setup source \$URL ${bB}PACKAGE${eB} ...${eX} - (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for - ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest - source package(s); covered and up-to-date packages are not downloaded again unless - ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. - If the package root will contain only one architecture then you can install in ${bB}bin${eB} and - ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this - instead:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - flat setup source \$URL ${bB}PACKAGE${eB} ...${eX} - To update the same packages from the same URL run:${bX} - bin/package setup source${eX}${eD} -${bT}(6)${bD}Build and install; all generated files are placed under ${bB}arch/${eB}${bI}HOSTTYPE${eI} - (${bB}\$INSTALLROOT${eB}), where ${bI}HOSTTYPE${eI} is the output of ${bB}bin/package${eB} (with no - arguments.) ${bI}name=value${eI} arguments are supported; ${bB}CC${eB} and ${bB}debug=1${eB} (compile - with -g instead of -O) are likely candidates. The output is written to - the terminal and captured in ${bB}\$INSTALLROOT/lib/package/gen/make.out${eB}:${bX} - bin/package make${eX}${eD} -${bT}(7)${bD}List make results and interesting errors:${bX} - bin/package results${eX} - Run the regression tests:${bX} - bin/package test${eX} - List test results and errors:${bX} - bin/package results test${eX}${eD} -${bT}(8)${bD}The generated binaries are position independent, i.e., they do not - contain hard-coded paths. However, commands with related files, like - ${Mfile} and ${Mnmake}, require the path of the bin directory to be - exported in ${bB}PATH${eb}.${eD} -${bT}(9)${bD}You can run the binaries directly from the package root, or you can - install them in a public root after you are satisfied with the make and - test actions (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} - bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} - This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to - preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the - ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a - flat install:${bX} - cd \$INSTALLROOT - cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} -${bT}(10)${bD}To summarize, after the first time the download, build, and test cycle - for the latest source release is:${bX} - bin/package setup source - bin/package make - bin/package test${eX}${eD}${eL} +SYNOPSIS + package [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] -${bH}Source Package Installation Instructions -- Plan B${eH} -${bL} -${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives - into that directory.${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} - source package:${bX} - gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz | ${TAR} ${TARFLAGS}f -${eX} - Note that some browsers automatically unzip downloaded without warning. - If the gunzip fails try: - ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz - If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} - source package, compile it, and manually read the ${bB}INIT${eB} - source package:${bX} - mkdir bin - cp lib/package/tgz/ratz.${bI}YYYY-MM-DD${eI}.c lib/package/tgz/ratz.c - cc -o bin/ratz lib/package/tgz/ratz.c - bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz -${bT}(5)${bD}Read all unread package archive(s):${bX} - bin/package read${eX} - Both source and binary packages will be read by this step.${eD}${eL}${eO}" - ;; - *) echo "Usage: $command [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] +DESCRIPTION + The package command is the main control script for building and installing + KornShell 93u+m. It is a POSIX sh(1) script coded for maximal portability. A + POSIX shell and C compiler installation are the only requirements. All + package files are in the $PACKAGEROOT directory tree. Binary package files + are in the $INSTALLROOT ($PACKAGEROOT/arch/hosttype) tree, where + hosttype=$(bin/package host type). See DETAILS for more information. - The $command command controls source and binary packages. It must be run - within the package root directory tree. See \"$command help intro\" for - details. In the following, PACKAGE names either a package or a component - within a package; if omitted, all packages are operated on. The default - action is \"host type\". + Note that no environment variables need be set by the user; package + determines the environment based on the current working directory. The use + action starts a sh(1) with the environment initialized. CC, CCFLAGS, HOSTTYPE + and SHELL may be set by explicit command argument assignments to override the + defaults. - qualifier: - authorize NAME Remote authorization name or license acceptance phrase. - debug|environment Show environment and actions; do not execute. - flat Collapse \$INSTALLROOT { bin fun include lib } onto \$PACKAGEROOT. - force Force the action to override saved state. - never Run make -N; otherwise show other actions. - only Only operate on the specified packages. - password PASSWORD Remote authorization or license acceptance password. - quiet Do not list captured make and test action output. - show Run make -n; otherwise show other actions. - DEBUG Trace the package script actions in detail for debugging. - action: - admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ] - Apply ACTION ... to the hosts listed in FILE. If FILE is - omitted then "admin.db" is assumed. The caller must have rcp(1) - and rsh(1) or scp(1) and ssh(1) access to the hosts. Output - for the action is saved per-host in ACTION.log/HOST. Logs - can be viewed by \"package admin [on HOST] results [ACTION]\". - By default only local PACKAGEROOT hosts are selected from FILE; - \"all\" selects all hosts. \"on PATTERN\" selects only - hosts matching the | separated PATTERN. FILE contains four - types of lines. Blank lines and lines beginning with # are - ignored. Lines starting with id=value are variable assignments. - Set admin_ping to local conventions if \"$admin_ping\" fails. - If a package list is not specified on the command line the - action applies to all packages; a variable assignment - package=list applies action to the packages in list for - subsequent hosts in FILE. The remaining line type is a host - description consisting of 6 tab separated fields. The first 3 - are mandatory; the remaining 3 are updated by the admin action: - hosttype - The host type as reported by package. - [user@]host - The host name and optionally user name for rcp(1) - and rsh(1) access. - [remote:[[master]:]]PACKAGEROOT - The absolute remote package root directory and - optionally the remote prorocol (rsh or ssh) if - the directory is on a different server than the - master package root directory. If - lib/package/admin/$admin_env exists under - this directory then it is sourced by sh(1) - before ACTION is done. If this field begins with - - then the host is ignored. If this field contains - : then ditto(1) is used to sync the remote src - directory hierarchy to the local one. If [master]: - is specified then the sync is deferred to the - master host. If master is omitted (two :) then - the sync is disabled. These directories must exist - on the remote side: lib/package, src/cmd, src/lib. - date YYMMDD of the last action. - date Elapsed wall time of the last action. - M T W The admin action make, test and write action error - counts. A non-numeric value in any of these fields - disables the corresponding action. - owner The owner contact information. - attributes - NAME=VALUE attributes. Should at least contain - cc=compiler-version. - clean | clobber - Delete the arch/HOSTTYPE hierarchy; this deletes all generated - files and directories for HOSTTYPE. The hierarchy can be rebuilt - by package make.] - contents [ package ... ] - List description and components for PACKAGE on the standard - output. - copyright [ package ... ] - List the general copyright notice(s) for PACKAGE on the - standard output. Note that individual components in PACKAGE - may contain additional or replacement notices. - export [ VARIABLE ... ] - List NAME=VALUE for each VARIABLE, one per line. If the - \"only\" attribute is specified then only the variable - values are listed. If no variables are specified then - $env are assumed. - help [ ACTION ] - Display help text on the standard error [ standard output - for ACTION ]. - host [ canon cpu name rating type ... ] - List architecture/implementation dependent host information - on the standard output. type is listed if no attributes are - specified. Information is listed on a single line in attributes - order. The attributes are: - canon The next argument is a host type name to be - converted to package syntax. - cpu The number of cpus; 1 if the host is not a - multiprocessor. - name The host name. - rating The cpu rating in pseudo mips; the value is useful - useful only in comparisons with rating values of - other hosts. Other than a vax rating fixed at 1, - ratings can vary wildly but consistently from - vendor mips ratings. cc(1) may be required to - determine the rating. - type The host type, usually of the form - vendor.architecture, with an optional trailing - -version. The main theme is that type names within - a family of architectures are named in a similar, - predictable style. Os point release information is - avoided as much as possible, but vendor resistance - to release incompatibilities has for the most part - been futile. - html [ ACTION ] - Display html help text on the standard error [ standard output - for ACTION ]. - install [ ARCHITECTURE ... ] DIR [ PACKAGE ... ] - Copy the package binary hierarchy to DIR. If ARCHITECTURE is - omitted then all architectures are installed. If the \"flat\" - attribute is specified then exactly one ARCHITECTURE must be - specified; this architecture will be installed in DIR without - the \"arch/HOSTTYPE\" directory prefixes. Otherwise each - architecture will be installed in a separate \"arch/HOSTTYPE\" - subdirectory of DIR. The ARCHITECTURE - names the current - architecture. DIR must be an existing directory. If PACKAGE - is omitted then all binary packages are installed. This action - requires nmake. - license [ package ... ] - List the source license(s) for PACKAGE on the standard output. - Note that individual components in PACKAGE may contain - additional or replacement licenses. - list [ PACKAGE ... ] - List the name, version and prerequisites for PACKAGE on the - standard output. - make [ PACKAGE ] [ OPTION ... ] [ TARGET ... ] - Build and install. The default TARGET is install, which - makes and installs all packages. If the standard output - is a terminal then the output is also captured in - \$INSTALLROOT/lib/package/gen/make.out. The build is done - in the \$INSTALLROOT directory tree viewpathed on top of - the \$PACKAGEROOT directory tree. If \"flat\" is specified then - the \$INSTALLROOT { bin fun include lib } directories are - linked to the same directories in the package root. Only - one architecture may be flat. Leaf directory names matching - the |-separated shell pattern \$MAKESKIP are ignored. The - view action is done before making. OPTION operands are - passed to the underlying make command. - read [ package ... | archive ... ] - Read the named package archive(s). Must be run from the - package root directory. Archives are searched for in . - and lib/package/tgz. Each package is read only once. The - file lib/package/tgz/package[.type].tim tracks the read time. - See the write action for archive naming conventions. Text - file archive member are assumed to be ASCII or UTF-8 encoded. - regress diff(1) the current and previous package test results. - release [ [CC]YY-MM-DD [ [cc]yy-mm-dd ] ] [ package ] - Display recent changes since [CC]YY-MM-DD (up to [cc]yy-mm-dd), - where - means lowest (or highest.) If no dates are specified - then changes for the last 4 months are listed. PACKAGE may - be a package or component name. - remove PACKAGE - Remove files installed for PACKAGE. - results [ path ] [ old ] [ make | test ] - List results and interesting messages captured by the most - recent make (default), test or write action. old specifies the - previous results, if any (current and previous results are - retained.) $HOME/.pkgresults, if it exists, must contain an - egrep(1) expression of result lines to be ignored. failed lists - failures only and path lists the results file path only. - setup [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] - The action initializes the current directory as a package root, - runs the update action to download new or out of date packages, - and runs the read action on those packages. If \"flat\" is - specified then the \$INSTALLROOT { bin fun include lib } - directories are linked to the same directories in the package - root. Only one architecture may be flat. See the update and - read actions for argument details. - test [ PACKAGE ] - Run the regression tests for PACKAGE. If the standard output - is a terminal then the output is also captured in - \$INSTALLROOT/lib/package/gen/test.out. In general a package - must be made before it can be tested. Components tested with - the \bregress\b(1) command require \bksh93\b. If only is - also specified then only the listed package components are - tested, otherwise the closure of the components is tested. - update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] - Download the latest release of the selected and required - packages from URL (e.g., - http://www.research.att.com/sw/download) into the directory - \$PACKAGEROOT/lib/package/tgz. beta accesses beta packages; - download these at your own risk. If ARCHITECTURE is omitted - then only architectures already present in the tgz directory - will be downloaded. If ARCHITECTURE is - then all posted - architectures will be downloaded. If URL matches *.url then - it is interpreted as a file containing shell variable - assignments for url, authorize and password. If URL is - omitted then the definitions for url, authorize and password - in \$PACKAGEROOT/lib/package/tgz/$default_url, if it exists, - are used. If \$PACKAGEROOT/lib/package/tgz/$default_url does - not exist then it is initialized with the current url, - authorize and password values and read permission for the - current user only. If PACKAGE is omitted then only - packages already present in the tgz directory will be - downloaded. If PACKAGE is - then all posted packages will be - downloaded. If source and binary are omitted then both source - and binary packages will be downloaded. If \bonly\b is - specified then only the named packages are updated; otherwise - the closure of required packages is updated. This action - requires wget(1), lynx(1), curl(1) or a shell that supports - io to /dev/tcp/HOST/PORT. - use [ uid | PACKAGE | . [ 32 | 64 ] | 32 | 64 | - ] [ COMMAND ... ] - Run COMMAND or an interactive shell if COMMAND is omitted, with - the environment initialized for using the package (can you say - shared library without cussing?) If uid or PACKAGE or . is - specified then it is used to determine a \$PACKAGEROOT, - possibly different from the current directory. For example, to - try out bozo's package: \"package use bozo\". In this case the - command may be run from any directory. If the file - \$INSTALLROOT/lib/package/profile is readable then it is - sourced to initialize the environment. 32 or 64 implies - \$PACKAGEROOT of . and specifies the target architecture word - size (which may be silently ignored.) - verify [ PACKAGE ] - Verify installed binary files against the checksum files in - \$INSTALLROOT/lib/package/gen/*.sum. The checksum files contain - mode, user and group information. If the checksum matches - for a given file then the mode, user and group are changed - as necessary to match the checksum entry. A warning is printed - on the standard error for each mismatch. Requires the ast - package cksum(1) command. - view - Initialize the architecture specific viewpath hierarchy. The - make action implicitly calls this action. If \"flat\" is specified - then the \$INSTALLROOT { bin fun include lib } directories are - linked to the same directories in the package root. Only one - architecture may be flat. - write [closure] [cyg|exp|lcl|pkg|rpm|tgz|tst] [base|delta] - [binary|runtime|source] PACKAGE - Write a package archive for PACKAGE. All work is done in the - \$PACKAGEROOT/lib/package directory. FORMAT-specific files - are placed in the FORMAT subdirectory. A PACKAGE[.TYPE].tim - file in this directory tracksthe write time and prevents a - package from being read in the same root it was written. If - more than one file is generated for a particular FORMAT then - those files are placed in the FORMAT/PACKAGE subdirectory. - File names in the FORMAT subdirectory will contain the package - name, a YYYY-MM-DD date, and for binary packages, HOSTTYPE. - If PACKAGE is omitted then an ordered list of previously - written packages is generated. If \"only\" is specified then - only the named packages will be written; otherwise - prerequisite packages are written first. Package components - must be listed in PACKAGE.pkg. FORMAT may be one of: - cyg generate a cygwin package - exp generate an exptools(1) maintainer source archive - and NPD file in the exp subdirectory, suitable for - expmake(1); support files are placed in the - exp/PACKAGE subdirectory - lcl generate a package archive or delta in the lcl - subdirectory, suitable for restoration into the - primary source tree (no source licence annotation) - pkg generate a pkgmk(1) package, suitable for pkgadd(1) - rpm generate an rpm(1) package - tgz generate a gzip(1) tar(1) package archive; this is - the default - tst generate tgz FORMAT package archive in the tst - subdirectory; version state files are not updated - The package type must be one of source, binary or runtime. - A source package contains the source needed to build the - corresponding binary package. A binary package includes the - libraries and headers needed for compiling and linking - against the public interfaces. A runtime package contains - the commands and required dynamic libraries. A package may - be either a base or delta. A base package contains a - complete copy of all components. A delta package contains - only changes from a previous base package. Delta recipients - must have the ast pax(1) command (in the ast-base package.) - If neither base nor delta is specified, then the current - base is overwritten if there are no deltas referring to the - current base. Only the tgz and lcl formats support delta. - If base is specified then a new base and two delta archives - are generated: one delta to generate the new base from the - old, and one delta to generate the old base from the new; - the old base is then removed. If delta is specified then a - new delta referring to the current base is written. - package.pkg may reference other packages. By default a - pointer to those packages is written. The recipient package - read will then check that all required packages have been - downloaded. If closure is specified then the components for - all package references are included in the generated - package. This may be useful for lcl and versioning. All - formats but lcl annotate each source file (not already - annotated) with a license comment as it is written to the - package archive using proto(1). - name=value: - variable definition: typically CC=cc or CCFLAGS=-g." - ;; + The command arguments are composed of a sequence of words: zero or more + qualifiers, one action, and zero or more action-specific arguments, and zero + or more name=value definitions. optget(3) documentation options such as + --man, --html and --nroff are also supported. The default with no arguments + is host type. + + The qualifiers are: + debug|environment + Show environment and actions but do not execute. + flat With the make action, create a flat view by linking all files from + $INSTALLROOT, minus *.old files, onto their corresponding path under + $PACKAGEROOT. Only one architecture can have a flat view. If flat is + specified with the clean action, then only clean up this flat view + and do not delete $INSTALLROOT. + force Force the action to override saved state. + never Run make -N and show other actions. + only Only operate on the specified packages. + quiet Do not list captured action output. + show Run make -n and show other actions. + verbose + Provide detailed action output. + DEBUG Trace the package script actions in detail. + + The actions are: + clean | clobber + Clean up the flat view, if any. Then, unless flat was given, delete + the arch/HOSTTYPE hierarchy; this deletes all generated files and + directories for HOSTTYPE. The hierarchy can be rebuilt by package + make. + export [ variable ...] + List name=value for variable, one per line. If the only attribute is + specified then only the variable values are listed. If no variables + are specified then HOSTTYPE PACKAGEROOT INSTALLROOT PATH are assumed. + help [ action ] + Display help text on the standard error (standard output for action). + host [ attribute ... ] + List architecture/implementation dependent host information on the + standard output. type is listed if no attributes are specified. + Information is listed on a single line in attribute order. The + attributes are: + canon name + An external host type name to be converted to package syntax. + cpu The number of CPUs; 1 if the host is not a multiprocessor. + name The host name. + rating + The CPU rating in pseudo mips; the value is useful useful + only in comparisons with rating values of other hosts. Other + than a vax rating (mercifully) fixed at 1, ratings can vary + wildly but consistently from vendor mips ratings. cc(1) may + be required to determine the rating. + type The host type, usually in the form vendor.architecture, with + an optional trailing -version. The main theme is that type + names within a family of architectures are named in a + similar, predictable style. OS point release information is + avoided as much as possible, but vendor resistance to release + incompatibilities has for the most part been futile. + install To be reimplemented. + make [ package ] [ option ... ] [ target ... ] + Build and install. The default target is install, which makes and + installs package. If the standard output is a terminal then the + output is also captured in $INSTALLROOT/lib/package/gen/make.out. The + build is done in the $INSTALLROOT directory tree viewpathed on top of + the $PACKAGEROOT directory tree. Leaf directory names matching the + |-separated shell pattern $MAKESKIP are ignored. The view action is + done before making. option operands are passed to the underlying make + command. + results [ failed ] [ path ] [ old ] [make | test | write ] + List results and interesting messages captured by the most recent + make (default), test or write action. old specifies the previous + results, if any (current and previous results are retained). + $HOME/.pkgresults, if it exists, must contain an egrep(1) expression + of result lines to be ignored. failed lists failures only and path + lists the results file path name only. + test [ argument ... ] + Run the regression tests for ksh. If the standard output is a + terminal then the output is also captured in + $INSTALLROOT/lib/package/gen/test.out. ksh must be made before it can + be tested. All arguments following test are passed to bin/shtests. + See bin/shtests --man for more information. + use [ uid | package | . [ 32 | 64 ] | 32 | 64 | - ] [ command ...] + Run command, or an interactive shell if command is omitted, with the + environment initialized for using the package (can you say shared + library or dll without cussing?) If uid or package or . is specified + then it is used to determine a $PACKAGEROOT, possibly different from + the current directory. For example, to try out bozo'\''s package: + package use bozo. The use action may be run from any directory. If + the file $INSTALLROOT/lib/package/profile is readable then it is + sourced to initialize the environment. 32 or 64 implies $PACKAGEROOT + of . and specifies the target architecture word size (which may be + silently ignored). + view Initialize the architecture specific viewpath hierarchy. The make + action implicitly calls this action. + +DETAILS + The package directory hierarchy is rooted at $PACKAGEROOT. All source and + binaries reside under this tree. A two level viewpath is used to separate + source and binaries. The top view is architecture specific, the bottom view + is shared source. All building is done in the architecture specific view; no + source view files are intentionally changed. This means that many different + binary architectures can be made from a single copy of the source. + + Independent $PACKAGEROOT hierarchies can be combined by appending + $INSTALLROOT:$PACKAGEROOT pairs to VPATH. The VPATH viewing order is from + left to right. + + $HOSTYPE names the current binary architecture and is determined by the + output of package (no arguments). The $HOSTTYPE naming scheme is used to + separate incompatible executable and object formats. All architecture + specific binaries are placed under $INSTALLROOT + ($PACKAGEROOT/arch/$HOSTTYPE). There are a few places that match against + $HOSTTYPE when making binaries; these are limited to makefile compiler + workarounds, e.g., if $HOSTTYPE matches hp.* then turn off the optimizer for + these objects. All other architecture dependent logic is handled either by + the AST iffe(1) command or by component specific configure scripts. Explicit + $HOSTYPE values matching *,*cc*[,-*,...] optionally set the default CC and + CCFLAGS. This is handy for build farms that support different compilers on + the same architecture. + + Each component contains a MAM (make abstract machine) file (Mamfile). A + Mamfile contains a portable makefile description written in a simple + dependency tree language using indented make...done blocks. + + All scripts and commands under $PACKAGEROOT use $PATH relative pathnames (via + the AST pathpath(3) function); there are no embedded absolute pathnames. This + means that binaries generated under $PACKAGEROOT may be copied to a different + root; users need only change their $PATH variable to reference the new + installation root bin directory. package install installs binary packages in + a new $INSTALLROOT. + +SEE ALSO + autoconfig(1), cksum(1), execrate(1), expmake(1), gzip(1), make(1), + mamake(1), pax(1), pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3) + +IMPLEMENTATION + version package (ksh 93u+m) 2021-12-31 + author Glenn Fowler + author Contributors to https://github.com/ksh93/ksh + copyright (c) 1994-2012 AT&T Intellectual Property + copyright (c) 2020-2021 Contributors to https://github.com/ksh93/ksh + license http://www.eclipse.org/org/documents/epl-v10.html' + case $1 in + html) echo "
" ;; esac exit $code ;; *=*) set DEFAULT host type "$@" ;; - *) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + *) # simulate AST getopt(3) usage output + echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + echo " Help: $command [ --help | --man ] 2>&1" >&2 exit 2 ;; esac @@ -1344,7 +609,7 @@ do case $i in *:*=*) args="$args $i" continue ;; - *=*) eval `echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'','` + *=*) n=${i%%=*} v=${i#*=} ;; esac case $i in @@ -1364,8 +629,6 @@ do case $i in ?*) KEEP_HOSTTYPE=1 ;; esac ;; - HURL=*) eval $n='$'v - ;; PACKAGEROOT=*) eval $n='$'v case $PACKAGEROOT in @@ -1377,11 +640,6 @@ do case $i in ?*) KEEP_SHELL=1 ;; esac ;; - TAR=*) eval $n='$'v - ;; - TARFLAGS=*) - eval $n='$'v - ;; VPATH=*)eval USER_$n='$'v ;; 'debug=1') @@ -1410,13 +668,13 @@ esac # Add build type flags via KSH_RELFLAGS, which is used in src/cmd/ksh93/Mamfile. # (Avoid using CCFLAGS; setting it would overwrite autodetected optimization flags.) ksh_relflags= -case `git branch 2>/dev/null` in +case $(git branch 2>/dev/null) in '' | *\*\ [0-9]*.[0-9]*) # If we're not on a git branch (tarball) or on a branch that starts # with a number (release branch), then compile as a release version ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_ksh_release" ;; *) # Otherwise, add 8-character git commit hash if available, and if the working dir is clean - git_commit=`git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD` + git_commit=$(git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD) case $git_commit in ????????) ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_git_commit=\\\"$git_commit\\\"" ;; @@ -1449,52 +707,6 @@ esac # grab action specific args case $action in -admin) while : - do case $# in - 0) set list - break - ;; - esac - case $1 in - all) admin_all=1 - ;; - db) case $# in - 1) echo $command: $action: $1: db file argument expected >&2 - exit 1 - ;; - esac - shift - admin_db=$1 - ;; - on) case $# in - 1) echo $command: $action: $1: host pattern argument expected >&2 - exit 1 - ;; - esac - shift - admin_on=$1 - ;; - *) break - ;; - esac - shift - done - admin_action=$1 - admin_args=$* - for i - do case $i in - debug|environment|force|never|only|quiet|show|DEBUG) - ;; - *) admin_action=$i - break - ;; - esac - done - ;; -setup) PACKAGEROOT=${PWD:-`pwd`} - export PACKAGEROOT - KEEP_PACKAGEROOT=1 - ;; use) case $1 in .|32|64)case $1 in 32|64) bit=$1 ;; @@ -1505,7 +717,7 @@ use) case $1 in case $HOSTTYPE in win32.*)sys=uwin - wow=`uname -i` + wow=$(uname -i) case $bit in 32) case $HOSTTYPE in *-64) HOSTTYPE=${HOSTTYPE%-64} ;; @@ -1516,7 +728,7 @@ use) case $1 in *) HOSTTYPE=$HOSTTYPE-64 ;; esac case $wow in - */32) echo $command: cannot build $bit-bit on $wow $sys >&2; exit 2 ;; + */32) err_out "cannot build $bit-bit on $wow $sys" ;; esac ;; esac @@ -1528,8 +740,8 @@ use) case $1 in $exec umask 002 $exec unset MAKESKIP - $exec export P=$PWD - $exec export A=$P/arch/$HOSTTYPE + P=$PWD + A=$P/arch/$HOSTTYPE $exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package $exec export INSTALLROOT=$A @@ -1558,7 +770,7 @@ use) case $1 in exit ;; esac - PACKAGEROOT=${PWD:-`pwd`} + PACKAGEROOT=$PWD $show export PACKAGEROOT esac ;; @@ -1582,7 +794,7 @@ executable() # [!] command } # initialize SHELLMAGIC -# tangible proof of cygwin's disdain for unix (well, this and execrate) +# tangible proof of Cygwin's disdain for Unix (well, this and execrate) shellmagic() { @@ -1627,17 +839,6 @@ onpath() # command return 1 } -# true if no nmake or nmake not from AT&T or nmake too old - -nonmake() # nmake -{ - _nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) /dev/null || echo 19840919` - if test $_nonmake_version -lt 20001031 - then return 0 - fi - return 1 -} - # determine local host attributes hostinfo() # attribute ... @@ -1657,28 +858,8 @@ hostinfo() # attribute ... done PATH=$PATH:$i/bin done - # LD_LIBRARY_PATH may be out of sync with PATH here - case $SED in - '') SED=sed - $SED 1d < /dev/null > /dev/null 2>&1 || - for dir in /bin /usr/bin - do if test -x $dir/$SED - then SED=$dir/$SED - break - fi - done - TR=tr - $TR < /dev/null > /dev/null 2>&1 || - for dir in /bin /usr/bin - do if test -x $dir/$TR - then TR=$dir/$TR - break - fi - done - ;; - esac case $PACKAGE_PATH in - ?*) for i in `echo $PACKAGE_PATH | $SED 's,:, ,g'` + ?*) for i in $(echo "$PACKAGE_PATH" | sed 's,:, ,g') do PATH=$PATH:$i/bin done ;; @@ -1702,16 +883,14 @@ hostinfo() # attribute ... cpu|name|rating|type) something=1 ;; - *) echo "$command: $action: $info: unknown attribute" >&2 - exit 1 + *) err_out "$action: $info: unknown attribute" ;; esac ;; esac done case $canon in - -) echo "$command: $action: canon: host type name expected" >&2 - exit 1 + -) err_out "$action: canon: host type name expected" ;; esac case $something in @@ -1729,20 +908,14 @@ hostinfo() # attribute ... for info do case $info in - cpu) case $NPROC in - [123456789]*) - _hostinfo_="$_hostinfo_ $NPROC" - continue - ;; - esac - cpu=`sysctl -n hw.ncpu` + cpu) cpu=$(sysctl -n hw.ncpu) case $cpu in [123456789]*) _hostinfo_="$_hostinfo_ $cpu" continue ;; esac - cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo` + cpu=$(grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo) case $cpu in [123456789]*) _hostinfo_="$_hostinfo_ $cpu" @@ -1761,7 +934,7 @@ hostinfo() # attribute ... do case $# in 0) break ;; esac - i=`$1 2>/dev/null | grep -c "$2"` + i=$($1 2>/dev/null | grep -c "$2") case $i in [123456789]*) cpu=$i @@ -1779,8 +952,8 @@ hostinfo() # attribute ... 0) break ;; esac if executable $1 - then case `$1 | grep -ic '^cpu '` in - 1) cpu=`$1 | grep -ic '^ *[0123456789][0123456789]* '` + then case $($1 | grep -ic '^cpu ') in + 1) cpu=$($1 | grep -ic '^ *[0123456789][0123456789]* ') break ;; esac @@ -1802,9 +975,9 @@ hostinfo() # attribute ... do case $# in 0) break ;; esac - i=`$1 2>/dev/null | $TR ' ' ' + i=$($1 2>/dev/null | tr ' ' ' -' | grep -c "^$2"` +' | grep -c "^$2") case $i in [123456789]*) cpu=$i @@ -1831,7 +1004,7 @@ hostinfo() # attribute ... do case $# in 0) break ;; esac - i=`$1 2>/dev/null | $SED -e "${2}!d" -e "s${3}"` + i=$($1 2>/dev/null | sed -e "${2}!d" -e "s${3}") case $i in [123456789]*) cpu=$i @@ -1843,7 +1016,7 @@ hostinfo() # attribute ... ;; esac case $cpu in - 0|1) cpu=`( + 0|1) cpu=$( cd "$TMPDIR" tmp=hi$$ trap 'rm -f $tmp.*' 0 1 2 @@ -1863,7 +1036,7 @@ int main() break fi done - )` + ) case $cpu in [0123456789]*) ;; *) cpu=1 ;; @@ -1872,10 +1045,10 @@ int main() esac _hostinfo_="$_hostinfo_ $cpu" ;; - name) _name_=`hostname || uname -n || cat /etc/whoami || echo local` + name) _name_=$(hostname || uname -n || cat /etc/whoami || echo local) _hostinfo_="$_hostinfo_ $_name_" ;; - rating) for rating in `grep -i ^bogomips /proc/cpuinfo 2>/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'` + rating) for rating in $(grep -i ^bogomips /proc/cpuinfo 2>/dev/null | sed -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,') do case $rating in [0123456789]*) break ;; esac @@ -1964,7 +1137,7 @@ int main() for o in -DTZ -DTD '' do if $CC $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 || gcc $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 - then rating=`./$tmp.exe` + then rating=$(./$tmp.exe) break fi done @@ -1995,10 +1168,10 @@ int main() ;; esac case $cc in - /*) a=`$cc -dumpmachine $CCFLAGS 2>/dev/null` + /*) a=$($cc -dumpmachine $CCFLAGS 2>/dev/null) case $a in '') case $CCFLAGS in - ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + ?*) a=$($cc -dumpmachine 2>/dev/null) ;; esac ;; esac @@ -2031,10 +1204,10 @@ int main() '') case $cc in /*|cc) ;; *) if executable $i/$cc - then a=`$i/$cc -dumpmachine $CCFLAGS 2>/dev/null` + then a=$($i/$cc -dumpmachine $CCFLAGS 2>/dev/null) case $a in '') case $CCFLAGS in - ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + ?*) a=$($cc -dumpmachine 2>/dev/null) ;; esac ;; esac @@ -2053,7 +1226,7 @@ int main() ;; esac if test -f "$i/$f" - then map="`grep -v '^#' $i/$f` $map" + then map="$(grep -v '^#' $i/$f) $map" fi done @@ -2061,25 +1234,25 @@ int main() case -${canon}- in --|*-powerpc-*) - h=`hostname || uname -n || cat /etc/whoami` + h=$(hostname || uname -n || cat /etc/whoami) case $h in '') h=local ;; esac - a=`arch || uname -m || att uname -m || uname -s || att uname -s` + a=$(arch || uname -m || att uname -m || uname -s || att uname -s) case $a in - *[\ \ ]*) a=`echo $a | $SED "s/[ ]/-/g"` ;; + *[\ \ ]*) a=$(echo $a | sed "s/[ ]/-/g") ;; esac case $a in '') a=unknown ;; esac - m=`mach || machine || uname -p || att uname -p` + m=$(mach || machine || uname -p || att uname -p) case $m in - *[\ \ ]*) m=`echo $m | $SED "s/[ ]/-/g"` ;; + *[\ \ ]*) m=$(echo $m | sed "s/[ ]/-/g") ;; esac case $m in '') m=unknown ;; esac - x=`uname -a || att uname -a` + x=$(uname -a || att uname -a) case $x in '') x="unknown $host unknown unknown unknown unknown unknown" ;; esac @@ -2097,7 +1270,7 @@ int main() esac case $os in [abcdefghijklmnopqrstuvwxyz]*[0123456789]) - eval `echo $os | $SED -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/'` + eval $(echo $os | sed -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/') ;; esac ;; @@ -2108,7 +1281,7 @@ int main() esac type=unknown case $host in - *.*) host=`echo $host | $SED -e 's/\..*//'` ;; + *.*) host=$(echo $host | sed -e 's/\..*//') ;; esac case $mach in unknown) @@ -2168,14 +1341,14 @@ int main() 9000/[78]*) type=hp.pa ;; - */*) type=hp.`echo $arch | $SED 's,/,_,g'` + */*) type=hp.$(echo $arch | sed 's,/,_,g') ;; *) type=hp.$arch ;; esac ;; [Ii][Rr][Ii][Xx]*) - set xx `hinv | $SED -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + set xx $(hinv | sed -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) shift type=$1 n= @@ -2220,12 +1393,12 @@ int main() fi split=' ' - a=`strings $a < /dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q` + a=$(strings $a < /dev/null | sed -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | sed -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q) case $a in [0123456789]) n=$a ;; esac case $n in - 4) a=`$cc -${type}3 2>&1` + 4) a=$($cc -${type}3 2>&1) case $a in *unknown*|*install*|*conflict*) ;; @@ -2234,7 +1407,7 @@ int main() esac ;; esac - a=`$cc -show F0oB@r.c 2>&1` + a=$($cc -show F0oB@r.c 2>&1) case $n:$a in [!2]:*mips2*) n=2 ;; [!23]:*mips3*) n=3 ;; @@ -2256,7 +1429,7 @@ int main() type=sco ;; [Ss]ol*) - v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + v=$(echo $rel | sed -e 's/^[25]\.//' -e 's/\.[^.]*$//') case $v in [6789]|[1-9][0-9]) ;; @@ -2275,7 +1448,7 @@ int main() esac type=sol$v.$arch ;; - [Ss]un*)type=`echo $arch | $SED -e 's/\(sun.\).*/\1/'` + [Ss]un*)type=$(echo $arch | sed -e 's/\(sun.\).*/\1/') case $type in sparc) type=sun4 ;; esac @@ -2296,7 +1469,7 @@ int main() esac ;; esac - v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + v=$(echo $rel | sed -e 's/^[25]\.//' -e 's/\.[^.]*$//') case $v in [6789]|[1-9][0-9]) ;; @@ -2353,7 +1526,7 @@ int main() FTX*|ftx*) case $mach in *[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*) - mach=`echo $mach | $SED -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//'` + mach=$(echo $mach | sed -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//') ;; esac type=stratus.$mach @@ -2363,7 +1536,7 @@ int main() type=os2 arch=$rel ;; - *) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'` + *) type=$(echo $os | sed -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//') ;; esac case $type in @@ -2372,7 +1545,7 @@ int main() ;; [Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt]) type=win32 - arch=`echo $arch | $SED -e 's/_[^_]*$//'` + arch=$(echo $arch | sed -e 's/_[^_]*$//') ;; esac case $arch in @@ -2421,16 +1594,16 @@ int main() esac case $type in *[-_]32|*[-_]64|*[-_]128) - bits=`echo $type | $SED 's,.*[-_],,'` - type=`echo $type | $SED 's,[-_][0-9]*$,,'` + bits=$(echo $type | sed 's,.*[-_],,') + type=$(echo $type | sed 's,[-_][0-9]*$,,') ;; *) bits= ;; esac - type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + type=$(echo $type | sed -e 's%[-+/].*%%' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) case $type in - *.*) lhs=`echo $type | $SED -e 's/\..*//'` - rhs=`echo $type | $SED -e 's/.*\.//'` + *.*) lhs=$(echo $type | sed -e 's/\..*//') + rhs=$(echo $type | sed -e 's/.*\.//') case $rhs in [x0123456789]*86) rhs=i$rhs ;; 68*) rhs=m$rhs ;; @@ -2440,7 +1613,7 @@ int main() rhs=i386 ;; powerpc) rhs=ppc ;; s[0123456789]*[0123456789]x) - rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;; + rhs=$(echo $rhs | sed -e 's/x$/-64/') ;; esac case $rhs in arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*) @@ -2454,12 +1627,12 @@ int main() ?*dwarf)x=coff ;; ?*elf) x=elf ;; esac - lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"` + lhs=$(echo ${lhs}XXX | sed -e "s/${x}XXX//") ;; esac case $lhs in bsdi) lhs=bsd ;; - darwin) case `/usr/bin/cc --version` in + darwin) case $(/usr/bin/cc --version) in *'(GCC)'*) case $rel in [0-9].*|10.*) lhs=darwin07 ;; *) lhs=darwin11 ;; @@ -2468,7 +1641,7 @@ int main() ;; freebsd) case $rel in [01234].*) lhs=${lhs}4 ;; - [123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;; + [123456789]*.*) lhs=${lhs}$(echo $rel | sed -e 's/\..*//') ;; esac ;; hpux) lhs=hp ;; @@ -2497,7 +1670,7 @@ int main() *) abi=-64 ;; esac ;; - *) pwd=`pwd` + *) pwd=$PWD cd "$TMPDIR" tmp=hi$$ trap 'rm -f $tmp.*' 0 1 2 @@ -2522,7 +1695,7 @@ int b() { return 0; } esac if $cc $abi -mips$i -c $tmp.b.c && $cc -o $tmp.exe $tmp.a.o $tmp.b.o - then type=`echo $type | $SED -e 's/.$//'`$i + then type=$(echo $type | sed -e 's/.$//')$i break fi done @@ -2553,14 +1726,17 @@ int b() { return 0; } esac ;; *) case $bits in - '') bits=` cd "$TMPDIR" + '') bits=$( set -e + cd "$TMPDIR" tmp=hi$$ - trap 'rm -f $tmp.*' 0 1 2 + trap 'rm -rf "$tmp".*' 0 1 2 echo 'int main() { return 0; }' > $tmp.a.c + checkcc $cc $CCFLAGS -o $tmp.a.exe $tmp.a.c /dev/null 2>&1 - file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" ` + file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" ) case $bits in - *64*) bits=64 ;; + *\ 64-bit* | *\ 64\ bit* | *\ 64bit*) + bits=64 ;; *) bits= ;; esac ;; @@ -2611,7 +1787,13 @@ int b() { return 0; } note() # message ... { - echo $command: "$@" >&2 + printf "$command: %s\\n" "$@" >&2 +} + +err_out() +{ + note "$@" + exit 1 } # cc checks @@ -2625,7 +1807,10 @@ checkcc() if onpath $CC then cc=$_onpath_ else case $CC in - cc) if onpath gcc + cc) if onpath clang + then CC=clang + cc=$_onpath_ + elif onpath gcc then CC=gcc cc=$_onpath_ fi @@ -2634,7 +1819,7 @@ checkcc() fi case $cc in '') case $action in - make|test) note "$CC: not found"; exit 1 ;; + make|test) err_out "$CC: not found" ;; *) note "warning: $CC: not found" ;; esac ;; @@ -2694,8 +1879,7 @@ case $x in OK=ok KSH=$EXECROOT/bin/ksh - MAKE=nmake - NMAKE=$EXECROOT/bin/$MAKE + MAKE=mamake SUM=$EXECROOT/bin/sum TEE=$EXECROOT/bin/tee INITROOT=$PACKAGEROOT/src/cmd/INIT @@ -2716,10 +1900,10 @@ case $x in -|.) ;; /*) PACKAGEROOT=$1 ;; - *) i=`echo ~$1` + *) i=$(echo ~$1) if packageroot $i then PACKAGEROOT=$i - else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use + else for i in $(echo $HOME | sed -e 's,/[^/]*$,,') $usr $use do if packageroot $i/$1 then PACKAGEROOT=$i/$1 break @@ -2738,7 +1922,7 @@ case $x in ;; esac case $PACKAGEROOT in - '') PACKAGEROOT=${PWD:-`pwd`} ;; + '') PACKAGEROOT=$PWD ;; esac # . must be within the PACKAGEROOT tree @@ -2805,7 +1989,7 @@ case $x in export HOSTTYPE INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE case $action in - admin|install|make|read|remove|test|verify|view|write) + install|make|remove|test|view) ;; *) if test ! -d $INSTALLROOT then INSTALLROOT=$PACKAGEROOT @@ -2820,16 +2004,12 @@ case $x in case $action in export|use) - packageroot $PACKAGEROOT || { - echo "$command: $PACKAGEROOT: invalid package root directory" >&2 - exit 1 - } + packageroot $PACKAGEROOT || err_out "$PACKAGEROOT: invalid package root directory" case $KEEP_HOSTTYPE:$hosttype in 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype then KEEP_HOSTTYPE=1 HOSTTYPE=$hosttype - else echo "$command: $hosttype: package root not found" >&2 - exit 1 + else err_out "$hosttype: package root not found" fi ;; esac @@ -2837,22 +2017,17 @@ case $x in *) packageroot $PACKAGEROOT || { case $KEEP_PACKAGEROOT in 1) ;; - *) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2 - exit 1 + *) err_out "$PACKAGEROOT: must be in the package root directory tree" ;; esac } - case $action in - admin) ;; - *) for i in arch arch/$HOSTTYPE - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - for i in lib - do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit - done - ;; - esac + for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in lib + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done # no $INITROOT means INIT already installed elsewhere @@ -2862,9 +2037,9 @@ case $x in for i in execrate ignore mamprobe silent do test -h $PACKAGEROOT/bin/$i 2>/dev/null || - case `ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null` in + case $(ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null) in "$INITROOT/$i.sh"*) - note update $PACKAGEROOT/bin/$i + note "update $PACKAGEROOT/bin/$i" shellmagic case $SHELLMAGIC in '') $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit @@ -2904,11 +2079,10 @@ cat $INITROOT/$i.sh cp $INITROOT/hello.c pkg$$.c || exit 3 $cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || { if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1 - then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2 + then err_out "${warn}$CC: must be a C compiler (not C++)" else cat pkg$$.e - echo "$command: ${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" >&2 + err_out "${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" fi - exit 2 } if ./pkg$$.exe >/dev/null 2>&1 then code=0 @@ -2936,7 +2110,7 @@ cat $INITROOT/$i.sh if executable /lib32/$x || executable /lib64/$x then case $INSTALLROOT in */sgi.mips[0123456789]*) - u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'` + u=$(echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,') ;; *) u= ;; @@ -3085,10 +2259,10 @@ cat $INITROOT/$i.sh $show export PATH export PATH ;; - *) for i in package proto nmake + *) for i in package do if onpath $i - then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'` - EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'` + then EXECROOT=$(echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,') + EXECTYPE=$(echo $EXECROOT | sed -e 's,.*/,,') break fi done @@ -3100,11 +2274,10 @@ cat $INITROOT/$i.sh EXECTYPE=$_hostinfo_ case $HOSTTYPE in $EXECTYPE) - echo "$command: $CC: seems to be a cross-compiler" >&2 - echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2 - echo "$command: If not, your $TMPDIR directory may be mounted without execute permission." >&2 - echo "$command: Try exporting TMPDIR as a directory where you can execute binary files." >&2 - exit 1 + err_out "$CC seems to be a cross-compiler." \ + "Set HOSTTYPE to something other than the native $EXECTYPE." \ + "If not, your $TMPDIR directory may be mounted without execute permission." \ + "Try exporting TMPDIR as a directory where you can execute binary files." ;; esac ;; @@ -3122,8 +2295,7 @@ cat $INITROOT/$i.sh OK=ok KSH=$EXECROOT/bin/ksh - MAKE=nmake - NMAKE=$EXECROOT/bin/$MAKE + MAKE=mamake SUM=$EXECROOT/bin/sum TEE=$EXECROOT/bin/tee @@ -3132,7 +2304,7 @@ cat $INITROOT/$i.sh checksh "$SHELL" || KEEP_SHELL=0 case $KEEP_SHELL in 0) save_PATH=$PATH - if PATH=`getconf PATH 2>/dev/null` + if PATH=$(getconf PATH 2>/dev/null) then PATH=$PATH:$path else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path fi @@ -3146,8 +2318,8 @@ cat $INITROOT/$i.sh PATH=$save_PATH unset save_PATH case $KEEP_SHELL in - 0) echo "Cannot find good default shell, please supply SHELL=/path/to/shell" >&2 - exit 1 ;; + 0) err_out "Cannot find a good default shell; please supply SHELL=/path/to/shell" + ;; esac ;; esac @@ -3205,9 +2377,6 @@ cat $INITROOT/$i.sh ?*) USER_VPATH=$USER_VPATH:$i USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i" p=$i - case $PROTOROOT in - -) executable $i/bin/mamake && PROTOROOT= ;; - esac ;; esac done @@ -3216,7 +2385,6 @@ cat $INITROOT/$i.sh ;; esac -PACKAGESRC=$PACKAGEROOT/lib/package PACKAGEBIN=$INSTALLROOT/lib/package case $action:$run in use:-) set '' $args @@ -3235,7 +2403,7 @@ if test -r $INSTALLROOT/lib/package/profile then . $INSTALLROOT/lib/package/profile fi -# more cygwin hassles +# more Cygwin hassles case $HOSTTYPE in cygwin.*) @@ -3262,8 +2430,7 @@ cygwin.*) ;; esac case $lose in - ?*) echo "$command: $HOSTTYPE: export '$lose' in CYGWIN or languish in windows" >&2 - exit 1 + ?*) err_out "$HOSTTYPE: export '$lose' in CYGWIN or languish in Windows" ;; esac ;; @@ -3330,7 +2497,7 @@ view() # [test] [-|type] [src|bin|all] file esac _view_= case $_view_t_ in - ?*) echo $command: $1: $_view_t_ not found >&2 ;; + ?*) note "$1: $_view_t_ not found" ;; esac return 1 } @@ -3338,83 +2505,6 @@ view() # [test] [-|type] [src|bin|all] file # determine the package and targets case $action in -admin) case $admin_action in - results)action=$admin_action - set '' $admin_args - shift;shift - admin_args="admin $*" - case $admin_on in - '') target=$admin_args ;; - *) target="on $admin_on $admin_args" ;; - esac - ;; - esac - ;; -release)set '' $args - target= - while : - do shift - case $1 in - -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) - target="$target $1" - ;; - *) break - ;; - esac - done - package=$* - ;; -setup) # { update read } with optional (bin|fun|include|lib) symlinks - # flat option sets up { bin fun include lib } symlinks from - # $INSTALLROOT to $PACKAGEROOT - - # . is the package root - - set '' $args - shift - types= - url= - while : - do case $# in - 0) break ;; - esac - case $1 in - --) shift - break - ;; - flat) flat=1 # backwards compatibility -- documentation dropped - ;; - *://*|*.url) - url=$1 - shift - break - ;; - *) types="$types $1" - ;; - esac - shift - done - if test ! -d $PACKAGEROOT/lib/package/tgz - then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit - fi - case " $types " in - *" source "*) - case " $* " in - ' ') ;; - *" INIT "*) - ;; - *) view - all src/cmd/INIT || - set INIT "$@" - ;; - esac - ;; - esac - packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT` - case $packages in - ?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT - esac - exit - ;; *) package= target= set '' $args @@ -3438,127 +2528,22 @@ setup) # { update read } with optional (bin|fun|include|lib) symlinks ;; esac -# flatten -- assumes symlink support - -case $flat in -1) case $action in - make|read|setup|update|use|view) - if test ! -d $INSTALLROOT - then $exec mkdir -p $INSTALLROOT || exit - fi - for i in bin include lib fun man share - do if test ! -d $INSTALLROOT/../../$i - then $exec mkdir $INSTALLROOT/../../$i - fi - if test ! -d $INSTALLROOT/$i - then if test ! -h $INSTALLROOT/$i - then $exec ln -s ../../$i $INSTALLROOT/$i - fi - elif test ! -h $INSTALLROOT/$i - then for x in $INSTALLROOT/$i/.[a-z]* $INSTALLROOT/$i/* - do if test -f $x -o -d $x - then if test ! -d $INSTALLROOT/$i/$x || test ! -d $INSTALLROOT/../../$i/$x - then $exec mv $x $INSTALLROOT/../../$i - fi - fi - done - $exec rm -rf $INSTALLROOT/$i - $exec ln -s ../../$i $INSTALLROOT/$i - fi - done - ;; - esac - ;; -esac - # check that cmd args are up to date a.out's checkaout() # cmd ... { - case $PROTOROOT in - -) PROTOROOT= - case $* in - ratz) if test -f $INITROOT/ratz.c -a -w $PACKAGEROOT - then test -f $INITROOT/hello.c || { - cat > $INITROOT/hello.c <<'!' -#ifndef printf -#include -#endif -int main() { int new = 0; printf("hello world\n"); return new;} -! - } - test -f $INITROOT/p.c || { - cat > $INITROOT/p.c <<'!' -/* - * small test for prototyping cc - */ - -int main(int argc, char** argv) { return argc || argv; } -! - } - fi - ;; - esac - test -f $INITROOT/hello.c -a -f $INITROOT/p.c -a -w $PACKAGEROOT || { - for i - do onpath $i || { - echo "$command: $i: command not found" >&2 - return 1 - } - done - return 0 + case $cc in + '') _PACKAGE_cc=0 + ;; + *) _PACKAGE_cc=1 + test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { + note "$INITROOT: INIT package source not found" + return 1 } - case $cc in - '') _PACKAGE_cc=0 - ;; - *) _PACKAGE_cc=1 - test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { - echo "$command: $INITROOT: INIT package source not found" >&2 - return 1 - } - executable $INSTALLROOT/bin/nmake || { - # check for prototyping cc - # NOTE: proto.c must be K&R compatible - $CC -c $INITROOT/p.c >/dev/null 2>&1 - c=$? - rm -f p.* - test 0 != "$c" && { - checkaout proto || return - PROTOROOT=$PACKAGEROOT/proto - $show PROTOROOT=$PACKAGEROOT/proto - export PROTOROOT - INITPROTO=$PROTOROOT/src/cmd/INIT - note proto convert $PACKAGEROOT/src into $PROTOROOT/src - if test -d $PACKAGEROOT/src/cmd/nmake - then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" - else dirs="src" - fi - ( - if test -f $PROTOROOT/UPDATE - then newer="-newer $PROTOROOT/UPDATE" - else newer="" - fi - case $exec in - '') cd $PACKAGEROOT - find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto - ;; - *) $exec cd $PACKAGEROOT - $exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto" - ;; - esac - $exec touch $PROTOROOT/UPDATE - ) - VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH - $show VPATH=$VPATH - export VPATH - } - } - for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return - done - ;; - esac + for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return + done ;; esac case $_PACKAGE_cc in @@ -3588,17 +2573,17 @@ int main(int argc, char** argv) { return argc || argv; } *00) view - bin/$i && continue ;; esac case $k in - 000) echo "$command: $i: not found: download the INIT package $HOSTTYPE binary to continue" >&2 + 000) note "$i: not found: download the INIT package $HOSTTYPE binary to continue" return 1 ;; - 010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2 + 010) note "$i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" return 1 ;; - 100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2 + 100) note "$i: not found: download the INIT package source or $HOSTTYPE binary to continue" return 1 ;; 110) case $CROSS in - 1) echo "$command: $i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" >&2 + 1) note "$i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" return 1 ;; esac @@ -3614,33 +2599,15 @@ int main(int argc, char** argv) { return argc || argv; } esac ;; esac - case `ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null` in + case $(ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null) in "$INITROOT/$i.c"*) - note update $INSTALLROOT/bin/$i - if test proto != "$i" && executable $INSTALLROOT/bin/proto - then case $exec in - '') $INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c || return ;; - *) $exec "$INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c" ;; - esac - $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $i.c || return - $exec rm -f $i.c - else if test ! -d $INSTALLROOT/bin - then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin - do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return - done - fi - if test '' != "$PROTOROOT" -a -f $INITPROTO/$i.c - then $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITPROTO/$i.c || return - else $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return - fi - case $i:$exec in - proto:) test -d $INSTALLROOT/include || mkdir $INSTALLROOT/include - $INSTALLROOT/bin/proto -f /dev/null > $i.c - cmp -s $i.c $INSTALLROOT/include/prototyped.h 2>/dev/null || cp $i.c $INSTALLROOT/include/prototyped.h - rm $i.c - ;; - esac + note "update $INSTALLROOT/bin/$i" + if test ! -d $INSTALLROOT/bin + then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return + done fi + $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return test -f $i.o && $exec rm -f $i.o i=$PATH PATH=/bin @@ -3651,269 +2618,6 @@ int main(int argc, char** argv) { return argc || argv; } return 0 } -# check package requirements against received packages - -requirements() # source|binary [ package ] -{ - case $1 in - binary) r=$VIEW_BIN ;; - source) r=$VIEW_SRC ;; - *) r=$VIEW_ALL ;; - esac - shift - case $1 in - '') x= ;; - *) x=$* ;; - esac - set '' - for d in $r - do set "$@" $d/gen/*.ver - case $x in - '') set "$@" $d/gen/*.req - ;; - *) for p in $x - do set "$@" $d/gen/$p.req - done - ;; - esac - done - shift - e=0 - x=$* - y= - n= - set '' - for i in $x - do p=`echo $i | sed -e 's,.*/,,' -e 's,\....$,,'` - if test -f $i - then set "$@" $i - y="$y $p" - else case $p in - '*') ;; - *) n="$n $p" ;; - esac - fi - done - for i in $n - do case " $y " in - *" $i "*) - ;; - *) echo "$command: $i: must read or write package" >&2 - e=1 - ;; - esac - done - case $e in - 1) exit 1 ;; - esac - shift - test 0 != "$#" && release=`sort -r "$@" | { - q= - e=0 - o= - while read p v r s - do q="$q -$v $r" - case $p in - $o) continue ;; - esac - case $s in - 0) e=1 - case $r in - base) echo "$command: base package $p.$v or newer required" >&2 ;; - *) echo "$command: delta package $p.$v.$r or newer required" >&2 ;; - esac - ;; - esac - o=$p - done - case $e in - 0) echo "$q" | sort | { read v r; read v r; echo $v; } ;; - 1) echo ERROR ;; - esac - }` - case $release in - ERROR) case $force in - 0) exit 1 ;; - esac - ;; - ?*) eval `echo $release | sed -e 's,\(.*\)-\(.*\)-\(.*\),yy=\1 mm=\2 dd=\3,'` - # slide back 4 months - case $mm in - 01) mm=09 dd=1 ;; - 02) mm=10 dd=1 ;; - 03) mm=11 dd=1 ;; - 04) mm=12 dd=1 ;; - 05) mm=01 dd=0 ;; - 06) mm=02 dd=0 ;; - 07) mm=03 dd=0 ;; - 08) mm=04 dd=0 ;; - 09) mm=05 dd=0 ;; - 10) mm=06 dd=0 ;; - 11) mm=07 dd=0 ;; - 12) mm=08 dd=0 ;; - esac - case $dd in - 1) yy=`expr $yy - 1` ;; - esac - release=$yy-$mm-01 - count=1 - lo=$release - release="-f $release -r $count" - ;; - esac -} - -# write ordered package prerequisite list to the standard output - -order() # [ package ] -{ - _order_t_=lib/package/tgz - case $action in - binary) _order_a_=.$HOSTTYPE ;; - *) _order_a_= ;; - esac - _order_n_=$# - case $_order_n_ in - 0) _order_p_= - for _order_v_ in $VIEW_all - do for _order_f_ in $_order_v_/lib/package/*.pkg - do if test -f $_order_f_ - then _order_p_="$_order_p_ $_order_f_" - fi - done - done - set '' $_order_p_ - shift - esac - { - if test ratz != "$*" - then for _order_f_ in ratz INIT - do if view -s - src $_order_t_/$_order_f_$_order_a_.tim - then echo $_order_f_ $_order_f_ - fi - done - fi - for _order_f_ - do while : - do view - src $_order_f_ && break - case $_order_f_ in - *.pkg) ;; - *) _order_f_=$_order_f_.pkg; view - src $_order_f_ && break ;; - esac - case $_order_f_ in - */*) ;; - *) _order_f_=lib/package/$_order_f_; view - src $_order_f_ && break ;; - esac - echo "$command: $_order_f_: not a package" >&2 - continue 2 - done - _order_f_=$_view_ - _order_p_=`echo $_order_f_ | sed -e 's,.*/,,' -e 's,\.pkg$,,'` - case $_order_n_ in - 0) view -s - src $_order_t_/$_order_p_$_order_a_.tim || continue ;; - esac - echo $_order_p_ $_order_p_ - case $_order_p_ in - INIT|ratz) - ;; - *) echo INIT $_order_p_ - ;; - esac - { - req= req_sep= - op=:: - while read line - do IFS=' \\' - set '' $line - IFS=$ifs - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - :*:) op=$1 - ;; - INIT|'$('*|*')') - ;; - *) case $op in - :REQUIRES:) - req="$req$req_sep$1" - req_sep=" " - ;; - esac - ;; - esac - done - done - for _order_i_ in $req - do if view - src lib/package/$_order_i_.pkg - then case $_order_u_ in - 0) view -s - src $_order_t_/$_order_i_$_order_a_.tim || continue ;; - esac - echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_ - fi - done - } < $_order_f_ - done - } | tsort -} - -# generate the package component list in _components_ - -components() # [ package ] -{ - _components_= - for p - do case $p in - '') ;; - INIT) case " $_components_ " in - *" $p "*) ;; - *) _components_="$_components_ $p" ;; - esac - ;; - *) if view - src lib/package/$p.pkg - then p=$_view_ - op=:: - exec < $p - while read line - do IFS=' \\' - set '' $line - IFS=$ifs - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - :*:) op=$1 - ;; - INIT|'$('*|*')') - ;; - *) case $op in - :PACKAGE:) - case " $_components_ " in - *" $1 "*) ;; - *) _components_="$_components_ $1" ;; - esac - ;; - esac - ;; - esac - done - done - exec < /dev/null - elif test -d $PACKAGEROOT/src/cmd/$p -o -d $PACKAGEROOT/src/lib/$p - then _components_="$_components_ $p" - else echo "$command: $p: package or component not found" >&2 - exit 1 - fi - ;; - esac - done -} - # list main environment values showenv() @@ -3930,6 +2634,7 @@ showenv() capture() # file command ... { + tee_pid= case $make:$noexec in :) case $action in install|make|view) @@ -3944,10 +2649,7 @@ capture() # file command ... esac ;; esac - case $action in - write) d=$PACKAGESRC/gen ;; - *) d=$PACKAGEBIN/gen ;; - esac + d=$PACKAGEBIN/gen test -d $d || $exec mkdir $d o=$d/$o case $o in @@ -3961,7 +2663,7 @@ capture() # file command ... then mv $o.out $o.out.2 fi elif test -f $o.out - then for i in `ls -t $o.out.? 2>/dev/null` + then for i in $(ls -t $o.out.? 2>/dev/null) do break done case $i in @@ -3979,20 +2681,25 @@ capture() # file command ... fi o=$o.out : > $o - note $action output captured in $o - s="$command: $action start at `date` in $INSTALLROOT" + note "$action output captured in $o" + s="$command: $action start at $(date) in $INSTALLROOT" + cmd='case $error_status in 0) r=done;; *) r=failed;; esac;' + cmd=$cmd' echo "$command: $action $r at $(date) in $INSTALLROOT"' case $quiet in - 0) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT 2>&1 | \$TEE -a $o" 0 1 2 ;; - *) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT >> $o" 0 1 2 ;; + 0) cmd="$cmd 2>&1 | \$TEE -a $o" ;; + *) cmd="$cmd >> $o" ;; esac + trap "$cmd" 0 + trap "error_status=1; $cmd; trap 1 0; kill -1 $$" 1 + trap "error_status=1; $cmd; trap 2 0; kill -2 $$" 2 ;; esac case $quiet in 0) if executable ! $TEE then TEE=tee fi - # Connect 'tee' to a FIFO instead of a pipe, so that the build is invoked from - # the main shell environment and its exit status can be used for $error_status + # Connect 'tee' to a FIFO instead of a pipe, so that we can obtain + # the build's exit status and use it for $error_status rm -f $o.fifo mkfifo -m 600 $o.fifo || exit ( @@ -4001,23 +2708,17 @@ capture() # file command ... exec rm $o.fifo ) & $TEE -a $o < $o.fifo & - { - case $s in - ?*) echo "$s" ;; - esac - showenv $action - "$@" - } < /dev/null > $o.fifo 2>&1 - ;; - *) { - case $s in - ?*) echo "$s" ;; - esac - showenv $action - "$@" - } < /dev/null > $o 2>&1 + tee_pid=$! + o=$o.fifo ;; esac + { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o 2>&1 ;; *) $make "$@" ;; @@ -4026,49 +2727,11 @@ capture() # file command ... if test "$exit_status" -gt "$error_status" then error_status=$exit_status fi -} - -package_install() # dest sum -{ - dest=$1 sum=$2 - ot= - code=0 - sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum | - while read mode user group arch dir file - do case $flat:$arch in - 1:*|?:.)t=$dest/$dir ;; - *) t=$dest/$arch/$dir ;; - esac - case $t in - $ot) ;; - *) if test ! -d "$t" - then $exec mkdir -p "$t" || exit - fi - ot=$t - ;; - esac - case $file in - ?*) case $arch in - .) f=$dir/$file ;; - *) f=$arch/$dir/$file ;; - esac - if test -f "$f" - then t=$t/$file - case $quiet in - 0) echo "$t" ;; - esac - $exec cp -f "$f" "$t" || code=1 - $exec chmod $mode "$t" || code=1 - fi - ;; - esac - done - return $code -} - -package_verify() # sum -{ - $exec $SUM -cp $1 + case $tee_pid in + ?*) # allow 'tee' to catch up before returning to prompt + wait "$tee_pid" + ;; + esac } make_recurse() # dir @@ -4080,310 +2743,14 @@ make_recurse() # dir done } -get() # host path [ file size ] -{ - case $HURL in - '') HURL=. - for i in wget lynx curl - do if onpath $i - then HURL=$i - break; - fi - done - AUTHORIZE="User-Agent: package AT&T Research\\r\\n" - case $HURL:$authorize in - .:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;; - esac - ;; - esac - getfd=8 - case $3 in - '') case $HURL in - .) host=$1 - path=$2 - while : - do eval "exec $getfd<> /dev/tcp/$host/80" || exit - case $path in - /*) ;; - *) path=/$path ;; - esac - print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd - cat <&8 > get.tmp - got=`sed -e 1q get.tmp` - case $got in - *" "200" "*) - got=`sed -e '1,/^.$/d' -e '/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]/!d' get.tmp` - : > get.err - code=0 - break - ;; - *" "30[123]" "*) - got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'',' get.tmp` - case $got in - '') rm get.tmp - echo "$command: $action: $url: redirect error" >&2 - exit 1 - ;; - esac - eval $got - ;; - *) rm get.tmp - echo "$command: $action: $url: $got" >&2 - echo '' "$got" > get.err - code=1 - break - ;; - esac - done - ;; - curl) case $authorize in - '') curl -s -L -o get.tmp http://$1/$2 2> get.err; code=$? ;; - *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2 2> get.err; code=$? ;; - esac - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` - case $code in - 0) if grep '^

Authorization Required

' get.tmp > get.err - then code=1 - fi - ;; - esac - ;; - hurl) case $authorize in - '') hurl http://$1/$2 > get.tmp 2> get.err; code=$? ;; - *) hurl -a "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; - esac - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` - ;; - lynx) case $authorize in - '') lynx -source http://$1/$2 > get.tmp 2> get.err; code=$? ;; - *) lynx -source -auth "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; - esac - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` - ;; - wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2 2> get.err - code=$? - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` - ;; - *) echo $command: $action: $HURL: url get command not found >&2 - exit 1 - ;; - esac - if test 0 != "$code" - then case `cat get.err get.tmp 2>/dev/null` in - *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) - echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 - ;; - *) cat get.err - ;; - esac - rm -f get.tmp get.err - echo $command: $action: $2: download failed >&2 - exit 1 - fi - rm -f get.tmp get.err - ;; - *) case $exec in - '') echo "$3 ($4 bytes):" >&2 - case $HURL in - .) eval "exec $getfd<> /dev/tcp/$1/80" || exit - path=$2/$3 - case $path in - /*) ;; - *) path=/$path ;; - esac - print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd - read got <&$getfd - case $got in - *" 200 "*) - code=0 - : > get.err - ;; - *) echo '' "$got" > get.err - code=1 - ;; - esac - while read got <&$getfd - do case $got in - ''|?) break ;; - esac - done - cat <&$getfd > get.tmp - ;; - curl) case $authorize in - '') curl -s -L -o get.tmp http://$1/$2/$3 2> get.err; code=$? ;; - *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2/$3 2> get.err; code=$? - esac - case $code in - 0) if grep '^

Authorization Required

' get.tmp > get.err - then code=1 - fi - ;; - esac - ;; - hurl) case $authorize in - '') ksh -x hurl http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - *) ksh -x hurl -a "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - esac - ;; - lynx) case $authorize in - '') lynx -source http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - *) lynx -source -auth "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - esac - ;; - wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2/$3 2> get.err - code=$? - ;; - *) echo $command: $action: $HURL: url get command not found >&2 - exit 1 - ;; - esac - if test 0 != "$code" - then case `cat get.err get.tmp` in - *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) - echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 - ;; - *) cat get.err - ;; - esac - rm get.tmp get.err - echo $command: $action: $3: download failed >&2 - exit 1 - fi - rm get.err - case $checksum:$5 in - :*|*:-) z=`wc -c < get.tmp` - case " $z " in - *" $4 "*) - ;; - *) rm -f get.tmp - echo $command: $3: download error: expected $4 bytes, got $z >&2 - exit 1 - ;; - esac - ;; - *) z=`$checksum < get.tmp | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` - case " $z " in - *" $5 "*) - ;; - *) rm -f get.tmp - echo $command: $3: download $checksum error: expected $5, got $z >&2 - exit 1 - ;; - esac - ;; - esac - mv get.tmp $3 || exit - ;; - *) echo "$3 ($4 bytes)" >&2 - ;; - esac - esac -} - -# generate copyright notice - -copyright() -{ - if test -f $1.lic - then echo $1 package general copyright notice - echo - proto -c'#' -p -s -l $1.lic -o type=verbose,author='*' /dev/null - return 0 - fi - case $1 in - *-*) eval `echo '' $1 | sed 's/\([^-]*\)-\(.*\)/__j__="\1" __i__="\2"/'` - if copyright $__i__ || copyright $__j__ - then return 0 - fi - ;; - esac - return 1 -} - -# run remote make on host - -remote() # host no-exec-background -{ - host=$1 - background=$2 - eval name=\$${host}_name user=\$${host}_user snarf=\$${host}_snarf type=\$${host}_type rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep log=\$${host}_log - case $keep in - 1*) ;; - *) return ;; - esac - case $host in - $main) ;; - *) case $exec in - '') exec > $admin_log/$log 2>&1 ;; - *) echo "exec > $admin_log/$log 2>&1" ;; - esac - ;; - esac - if $admin_ping $name >/dev/null 2>&1 || $admin_ping $name >/dev/null 2>&1 - then cmd=". ./.profile" - case $root in - .) root= - ;; - *) cmd="$cmd && cd $root" - root=$root/ - ;; - esac - cmd="$cmd && { test -f lib/package/admin/$admin_env && . ./lib/package/admin/$admin_env || true ;} && PATH=\${PWD:-\`pwd\`}/bin:\$PATH \${SHELL:-/bin/sh} -c 'package $admin_args PACKAGEROOT=\${PWD:-\`pwd\`} HOSTTYPE=$type VPATH='" - case $admin_binary in - '') snarf= ;; - esac - case $snarf in - '') $exec $rsh $user$name "$cmd" $background - ;; - *?) rcp=`echo $rsh | sed 's/\(.\).*/\1/'`cp - case $background in - ?*) $exec "{" ;; - esac - $exec $rsh $user$name "$cmd" - eval lst=$admin_list - case $admin_pkgs in - '') filter=cat ;; - *) filter="egrep lib/package/tgz/($admin_pkgs)\\." ;; - esac - if $exec $rcp $user$name:${root}lib/package/tgz/$lst $PACKAGESRC/tgz - then $exec $rcp `$filter $PACKAGESRC/tgz/$lst | sed "s,^,$user$name:,"` $PACKAGESRC/tgz - else echo "$command: $user$name:${root}lib/package/tgz/$lst: not found" >&2 - fi - case $background in - ?*) $exec "} $background" ;; - esac - ;; - esac - else echo "$command: $name: down" >&2 - fi -} - -# update package_src - -checksrc() -{ - case $package_src in - '') package_src=$src - for _i_ in `cd $PACKAGESRC; ls *.def *.lic *.pkg 2>/dev/null | sed 's/[-.].*//'` - do case " $package_src " in - *" $_i_ "*) - ;; - *) package_src="$package_src $_i_" - ;; - esac - done - ;; - esac -} - -# check for native ascii 0:yes 1:no +# check for native ASCII 0:yes 1:no __isascii__= isascii() { case $__isascii__ in - '') case `echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//'` in + '') case $(echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//') in 005101|040412) __isascii__=0 ;; *) __isascii__=1 ;; esac @@ -4395,866 +2762,31 @@ error_status=0 case $action in -admin) while test ! -f $admin_db - do case $admin_db in - /*) echo $command: $action: $admin_db: data file not found >&2 - exit 1 - ;; - esac - view file src lib/package/admin/$admin_db || exit 1 - admin_db=$_view_ - done - admin_components= - case $admin_action in - list) cat $admin_db - exit - ;; - test) set $admin_args - while : - do case $# in - 1) break ;; - esac - shift - case $1 in - *=*) ;; - *) admin_components=-$1 - break - ;; - esac - done - ;; - esac - : all work done in $PACKAGESRC/admin - cd $PACKAGESRC/admin || exit - checksrc - packages= - admin_log=${admin_action}${admin_components}.log - exec < $admin_db || exit - test -d $admin_log || $exec mkdir $admin_log || exit - case $admin_on in - '') admin_on="*" ;; - esac - hostname= - hosts= - logs= - local_hosts= - local_types= - pids= - remote_hosts= - sync_hosts= - admin_host=_admin_host_ - admin_out= - case " $admin_args " in - *" write binary "*|*" write "*" binary "*) - admin_binary=1 - ;; - *) admin_binary= - ;; - esac - case $only in - 1) admin_args="only $admin_args" ;; - esac - trap 'kill $pids >/dev/null 2>&1' 1 2 3 15 - index=0 - while read type host root date time make test write owner attributes - do case $type in - ''|'#'*);; - *=*) eval "$type $host $root $date $time $make $test $write $owner $attributes" - ;; - *) case $admin_action in - make|test|write) - eval f='$'$admin_action - case $f in - *[!0123456789]*) continue ;; - esac - ;; - esac - rsh=rsh - case $host in - *@*) IFS=@ - set '' $host - IFS=$ifs - user=${2}@ - host=$3 - ;; - *) user= - ;; - esac - : type=$type host=$host root=$root date=$date time=$time make=$make test=$test write=$write : - name=$host - host=`echo $name | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789],__,g'` - eval x='$'${host}_index - eval ${host}_index=1 - case $x in - 1) i=0 - while : - do case $i in - $index) h='' - break - ;; - esac - i=`expr $i + 1` - eval h='$'${admin_host}${i}_name - case $h in - $host) host=${admin_host}${i} - eval user='$'${host}_user root='$'${host}_rsh:$host:'$'${host}_root - break - ;; - esac - done - ;; - esac - case $root in - *:$name:*)root=`echo '' $root | sed 's,:.*,:,'` ;; - esac - case $root in - *:*:*) index=`expr $index + 1` - host=${admin_host}$index - ;; - *:*) case " $sync_hosts " in - *" $name ${admin_host}"*) - set '' '' $sync_hosts - while : - do shift - shift - case $1 in - $name) host=$2 - break - ;; - esac - done - ;; - *) index=`expr $index + 1` - host=${admin_host}$index - sync_hosts="$sync_hosts $name $host" - ;; - esac - ;; - *) index=`expr $index + 1` - host=${admin_host}$index - ;; - esac - case $root in - -*) continue - ;; - *:*) case $admin_all in - 0) continue ;; - esac - case $root in - *:) root=${root}. ;; - esac - IFS=: - set '' $root - IFS=$ifs - sync=$host - case $hostname in - '') hostinfo name - hostname=$_hostinfo_ - ;; - esac - shift - case $# in - 0) ;; - 1) root=$1 - ;; - 2) rsh=$1 root=$2 - ;; - *) rsh=$1 sync=$2 root=$3 - case $sync in - ${admin_host}*) - ;; - ?*) case " $sync_hosts " in - *" $sync ${admin_host}"*) - set '' '' $sync_hosts - while : - do shift - shift - case $1 in - $sync) sync=$2 - break - ;; - esac - done - ;; - *) index=`expr $index + 1` - x=${admin_host}$index - sync_hosts="$sync_hosts $sync $x" - sync=$x - ;; - esac - ;; - esac - ;; - esac - ;; - *) sync= - ;; - esac - case $name in - $admin_on) - keep=1 - ;; - *) case " $admin_on " in - *" $name "*) keep=1 ;; - *) keep=0 ;; - esac - ;; - esac - case " $admin_out " in - *" $name "*) - log=$name.$type - ;; - *) admin_out="$admin_out $name" - log=$name - ;; - esac - case $sync in - '') local_types="$local_types $type" ;; - esac - case $sync in - $host) remote_hosts="$remote_hosts $host" - ;; - ?*) eval ${sync}_share=\"\$${sync}_share $host\" - ;; - '') local_hosts="$local_hosts $host" - ;; - esac - eval ${host}_name='$'name ${host}_type='$'type ${host}_user='$'user ${host}_sync='$'sync ${host}_snarf='$'sync ${host}_rsh='$'rsh ${host}_root='$'root ${host}_keep='$'keep ${host}_log='$'log - ;; - esac - done - p= - for i in $admin_args - do p="$i $p" - done - admin_pkgs= - for i in $p - do if view - src "lib/package/$i.pkg" - then case $admin_pkgs in - '') admin_pkgs="$i" ;; - *) admin_pkgs="$admin_pkgs|$i" ;; - esac - fi - done - : "admin_binary :" $admin_binary - : "admin_args :" $admin_args - : "admin_pkgs :" $admin_pkgs - : "admin_on :" "$admin_on" - : "local_hosts :" $local_hosts - : "local_types :" $local_types - : "remote_hosts :" $remote_hosts - : "sync_hosts :" $sync_hosts - : "sync_share :" $sync_share - case $admin_binary in - 1) admin_bin_types= - admin_bin_main= - for main in $local_hosts $remote_hosts - do eval share=\$${main}_share keep=\$${main}_keep - case $keep in - 0*) continue ;; - esac - for host in $main $share - do case " $admin_bin_hosts " in - *" $host "*) - continue - ;; - esac - eval type=\$${host}_type - case " $admin_bin_types " in - *" $type "*) - continue - ;; - esac - case " $types " in - " ") ;; - *" $type "*) - ;; - *) continue - ;; - esac - admin_bin_hosts="$admin_bin_hosts $host" - admin_bin_types="$admin_bin_types $type" - case " $admin_bin_hosts " in - *" $main "*) - ;; - *) case " $admin_bin_main " in - *" $main "*) - ;; - *) admin_bin_main="$admin_bin_main $main" - ;; - esac - ;; - esac - done - done - local= - remote= - for host in $admin_bin_main $admin_bin_hosts - do case " $local_hosts " in - *" $host "*) - local="$local $host" - ;; - *) case " $remote_hosts " in - *" $host "*) - remote="$remote $host" - ;; - esac - ;; - esac - done - local_hosts=$local - remote_hosts=$remote - ;; - esac - for host in $remote_hosts $local_hosts - do eval share=\$${host}_share - case $share in - ?*) while : - do oshare=$share - for s in $share - do eval r='$'${s}_share - case $r in - ?*) case " $share " in - *" $r "*) ;; - *) share="$share $r" ;; - esac - ;; - esac - done - case $share in - $oshare) eval ${host}_share="'$share'" - break - ;; - esac - done - ;; - esac - done - for host in $remote_hosts - do eval type=\$${host}_type - case " $local_types " in - *" $type "*) - eval ${host}_snarf= - ;; - esac - eval name=\$${host}_name keep=\$${host}_keep share=\$${host}_share - for share in $share - do eval type=\$${share}_type keep=\$keep\$${share}_keep - case " $local_types " in - *" $type "*) - eval ${share}_snarf= - ;; - esac - done - case $keep in - 0*1*) keep=2$keep ;; - *1*) ;; - *) keep=0 ;; - esac - eval ${host}_keep=$keep - done - for host in $remote_hosts $local_hosts - do eval name=\$${host}_name user=\$${host}_user type=\$${host}_type sync=\$${host}_sync snarf=\$${host}_snarf share=\$${host}_share rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep - case $keep in - 0*) continue ;; - esac - case $sync in - '') case $admin_action in - ditto) continue ;; - esac - case $admin_binary in - 1) case $keep in - 1*|?*1*);; - *) continue ;; - esac - ;; - esac - ;; - esac - eval main_log='$'${host}_log - main= - share_keep= - for i in $host $share - do eval n='$'${i}_name t='$'${i}_type q='$'${i}_sync s='$'${i}_snarf l='$'${i}_log k='$'${i}_keep - case $main:$k in - :*) ;; - *:0) continue ;; - esac - case $admin_binary in - 1) case $s:$q in - :?*) continue ;; - esac - case " $admin_bin_hosts " in - *" $i "*) - ;; - *) continue - ;; - esac - ;; - esac - case $main in - '') main=$i ;; - *) share_keep="$share_keep $i" ;; - esac - echo package "$admin_args" "[ $n $t ]" - case $exec in - '') : > $admin_log/$l ;; - *) $exec ": > $admin_log/$l" ;; - esac - done - host=$main - share=$share_keep - case $force in - 0) admin_ditto_update=--update ;; - *) admin_ditto_update= ;; - esac - case $exec in - '') { - case $admin_binary:$sync in - :?*) eval syncname='$'${sync}_name - test -x $PACKAGEROOT/bin/package && $admin_ditto $admin_ditto_update --remote=$rsh --expr="name=='package'" $PACKAGEROOT/bin $user$syncname:$root/bin - test -d $PACKAGESRC && $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1&&path!='LICENSES/*')status=SKIP;path=='LICENSES*|*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package - for dir in $package_src - do case $MAKESKIP in - '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; - *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; - esac - test -d $PACKAGEROOT/src/$dir && $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir - done - ;; - esac - case $admin_action in - ditto) ;; - ?*) pids= - set '' $host $share - while : - do shift - case $# in - 0) break - ;; - 1) remote $1 - ;; - *) remote $1 & - pids="$pids $!" - ;; - esac - done - case $pids in - ?*) wait $pids ;; - esac - ;; - esac - } < /dev/null > $admin_log/$main_log 2>&1 & - pids="$pids $!" - ;; - *) echo "{" - case $admin_binary:$sync in - :?*) eval syncname='$'${sync}_name - test -d $PACKAGESRC && echo $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1)status=SKIP;name=='*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package - for dir in $package_src - do case $MAKESKIP in - '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; - *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; - esac - test -d $PACKAGEROOT/src/$dir && echo $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir - done - ;; - esac - case $admin_action in - ditto) ;; - ?*) pids= - set '' $host $share - while : - do shift - case $# in - 0) break - ;; - 1) remote $1 - ;; - *) remote $1 "&" - pids=1 - ;; - esac - done - case $pids in - 1) echo wait ;; - esac - ;; - esac - echo "} < /dev/null > $admin_log/$main_log 2>&1 &" - ;; - esac - eval name='$'${main}_name - hosts="$hosts $name" - logs="$logs $main_log" - for share in $share - do eval keep=\$${share}_keep - case $keep in - 1) eval name='$'${share}_name log='$'${share}_log - hosts="$hosts $name" - logs="$logs $log" - ;; - esac - done - done - case $exec in - '') # track the progress - case $quiet in - 0) cd $admin_log - tail -t $PACKAGE_admin_tail_timeout -f $logs - cd .. - ;; - esac - # wait for the remote actions to complete - wait - trap - 1 2 3 15 - # update the db - exec < $admin_db || exit - exec 9>&1 - D=`date +%y%m%d` - while read line - do set -- $line - case $1 in - ''|'#'*|*=*) - ;; - *) case " $hosts " in - *" $2 "*) - : ast date command assumed : - E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\`` - M=$6 T=$7 W=$8 - case $admin_action in - make|view) - M=`egrep -c ']:.* (\*\*\*.* code|don'\''t know) | \*\*\* termination code ' $admin_log/$2` ;; - test) T=`grep -ci 'fail[es]' $admin_log/$2` ;; - *) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;; - esac - case $1 in - ?|??|???|????|?????|??????|???????) - t1=' ' - ;; - ????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????) - t1=' ' - ;; - *) t1='' - ;; - esac - case $2 in - ?|??|???|????|?????|??????|???????) - t2=' ' - ;; - *) t2='' - ;; - esac - case $3 in - ?|??|???|????|?????|??????|???????) - t3=' ' - ;; - *) t3='' - ;; - esac - case $E in - ?????) E=" $E" ;; - ????) E=" $E" ;; - ???) E=" $E" ;; - ??) E=" $E" ;; - ?) E=" $E" ;; - esac - case $M in - ???) M="$M" ;; - ??) M=" $M" ;; - ?) M=" $M" ;; - '') M=" 0" ;; - esac - case $T in - ???) T="$T" ;; - ??) T=" $T" ;; - ?) T=" $T" ;; - '') T=" 0" ;; - esac - case $W in - ???) W="$W" ;; - ??) W=" $W" ;; - ?) W=" $W" ;; - '') W=" 0" ;; - esac - A=$1$t1 - H=$2$t2 - R=$3$t3 - case $# in - [0-8]) O= - K= - ;; - *) shift 8 - O=$1 - K=$2 - case $O in - ''|?|??|???) K=" $K" ;; - esac - case $# in - [0-2]) ;; - *) K="$K $*" ;; - esac - ;; - esac - echo "$A $H $R $D $E $M $T $W $O $K" - echo "$A $H $R $D $E $M $T $W $O $K" >&9 - continue - ;; - esac - ;; - esac - echo "$line" - done > $admin_db.new - mv $admin_db $admin_db.old - mv $admin_db.new $admin_db - ;; - esac - ;; - clean|clobber) - cd $PACKAGEROOT - $exec rm -rf arch/$HOSTTYPE - if test "$flat" = 1 - then $exec rm -rf \ - bin/.paths \ - bin/ar \ - bin/cc \ - bin/crossexec \ - bin/ditto \ - bin/filter \ - bin/hurl \ - bin/iffe \ - bin/ksh \ - bin/mamake \ - bin/mktest \ - bin/ok/ \ - bin/proto \ - bin/pty \ - bin/ratz \ - bin/regress \ - bin/release \ - bin/rt \ - bin/shcomp \ - bin/suid_exec \ - bin/*.old \ - fun/ \ - include/ \ - lib/file/ \ - lib/lib/ \ - lib/libast.a \ - lib/libcmd.a \ - lib/libdll.a \ - lib/libshell.a \ - lib/libsum.a \ - lib/*.old \ - lib/make/ \ - lib/package/gen/ \ - lib/probe/ \ - man/ - fi - exit - ;; - -contents|list) - # all work in $PACKAGESRC - - cd $PACKAGESRC - - # generate the package list - - set '' $target $package - shift - argc=$# - case $# in - 0) set '' *.pkg - case $2 in - '*.pkg') - echo $command: $action: no packages >&2 - exit 1 - ;; - esac - set '' `echo $* | sed 's,\.pkg,,g'` - shift - ;; - esac - sep="$nl " - echo packages in $PACKAGEROOT - case $action in - list) echo - echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t - ;; - esac - { - omit=: - for pkg - do if test ! -f $pkg.pkg - then echo $command: $action: $pkg: not a package >&2 - else if test -f gen/$pkg.ver - then set '' `cat gen/$pkg.ver` - case $3 in - $2) ver=base ;; - *) ver=$3 ;; - esac - if test -s tgz/$pkg.tim - then sts=local - else sts= - fi - else ver= - sts=unwritten + cd "$PACKAGEROOT" || exit + note "cleaning up flat view" + # clean up all links with arch dir except bin/package + $exec find "arch/$HOSTTYPE" -path "arch/$HOSTTYPE/bin/package" -o -type f -exec "$SHELL" -c ' + first=y + for h # loop through the PPs + do case $first in + y) set -- # clear PPs ("for" uses a copy) + first=n ;; + esac + p=${h#"arch/$HOSTTYPE/"} # get flat view path + if test "$p" -ef "$h" # is it part of the flat view? + then set -- "$@" "$p" # add to new PPs fi - typ= - txt= - cmp= cmp_sep= - req= req_sep= - op=:: - exec < $pkg.pkg - while read line - do IFS=' \\' - set '' $line - IFS=$ifs - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - :*:) op=$1 - ;; - INIT|'$('*|*')') - ;; - *) case $op in - :DESCRIPTION:) - txt="$txt$sep$line" - break - ;; - :PACKAGE:) - cmp="$cmp$cmp_sep$1" - cmp_sep=$nl - ;; - :REQUIRES:) - req="$req$req_sep$1" - req_sep=" " - ;; - esac - ;; - esac - done - done - exec < /dev/null - case $txt in - ?*) txt="$nl$txt" ;; - esac - case :$ver: in - *::*) ;; - *) case $action in - list) case $sts in - '') case `ls -t "tgz/$pkg.$ver.base" "tgz/$pkg.tim" 2>/dev/null` in - "tgz/$pkg.tim"*) - sts=read - ;; - *) sts=unread - ;; - esac - ;; - esac - echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req" - case $typ in - '') omit=$omit$pkg.$ver.base: ;; - esac - ;; - *) case $req in - ?*) req=": $req" ;; - esac - echo - echo $pkg $ver $req "$txt" - case $cmp in - ?*) echo "${sep}Components in this package:$nl" - echo "$cmp" | pr -4 -o4 -t ;; - esac - ;; - esac - ;; - esac - fi - done - case $argc:$action in - 0:list) if test -d tgz - then cd tgz - # f:file p:package v:version r:release t:type u:update - for f in `find . -name '*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*' -print | sed 's,^\./,,' | sort -r` - do eval `echo "$f" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` - case $t in - '') case $omit in - *:$p.$v.$r:*) continue ;; - esac - u=$p.tim - ;; - *) u=$p.$t.tim - ;; - esac - if test -s "$u" - then s=local - elif test -f "$u" - then case `ls -t "$f" "$u" 2>/dev/null` in - "$u"*) s=read ;; - *) s=unread ;; - esac - else s=unread - fi - echo "$p$nl$v$nl$r$nl$t$nl$s$nl" - done - fi + done + exec rm -f "$@" # rm all at once: fast + ' "$0" {} + + case $flat in + 0) note "deleting arch/$HOSTTYPE" + $exec rm -rf arch/$HOSTTYPE ;; esac - } | - case $action in - list) pr -6 -a -o4 -t | sort -u ;; - *) cat ;; - esac - case $argc in - 0) if test -d $PACKAGEROOT/arch - then echo - echo architectures in $PACKAGEROOT - echo - for i in `ls $PACKAGEROOT/arch` - do if test -f $PACKAGEROOT/arch/$i/lib/package/gen/host - then h=`cat $PACKAGEROOT/arch/$i/lib/package/gen/host` - else h= - fi - echo $i - echo $h - echo - echo - done | pr -4 -a -o4 -t - fi - ;; - esac - ;; - -copyright) - # all work in $PACKAGESRC - - cd $PACKAGESRC - - # generate the package list - - set '' $target $package - shift - argc=$# - case $# in - 0) set '' `echo *.lic | sed 's,\.lic,,g'` - shift - case $1 in - '*') echo $command: $action: no packages >&2 - exit 1 - ;; - esac - ;; - esac - checkaout proto || exit - for i - do copyright $i - done + note "removing empty directories" + $exec find . -depth -type d -exec rmdir {} + 2>/dev/null ;; export) case $INSTALLROOT in @@ -5281,199 +2813,13 @@ export) case $INSTALLROOT in ;; install)cd $PACKAGEROOT - set '' $package - shift - case $only in - 0) set '' `order "$@"` - shift - ;; - esac - case $# in - 0) echo "$command: at least one package name expected" >&2 - exit 1 - ;; - esac - package=$* - requirements - $package - set '' $target - shift - case $1 in - flat) flat=1 # backwards compatibility -- documentation dropped - shift - ;; - esac - case $# in - 0) echo "$command: $action: target directory argument expected" >&2 - exit 1 - ;; - esac - target= - while : - do case $# in - 1) directory=$1 - break - ;; - esac - target="$target $1" - shift - done - if test ! -d $directory - then echo "$command: $action: $directory: target directory not found" >&2 - exit 1 - fi - case $target in - '') cd arch - set '' * - shift - target=$* - cd .. - ;; - esac - code=0 - makecheck=1 - for a in $target - do case $a in - -) a=$HOSTTYPE ;; - esac - case $flat:$a in - 1:*|?:.)dest=$directory - ;; - *) dest=$directory/arch/$a - if test "" = "$exec" -a ! -d $dest - then mkdir -p $dest || { - echo "$command: $dest: destination directory must exist" >&2 - exit 1 - } - fi - ;; - esac - for i in $package - do if test "ratz" = "$i" - then : skip - elif test -f arch/$a/lib/package/gen/$i.sum - then package_install $directory arch/$a/lib/package/gen/$i.sum || code=1 - elif test ! -d arch/$a/bin - then echo "$command: $a: invalid architecture" >&2 - elif test ! -d $dest - then echo "$command: $dest: destination directory must exist" >&2 - else if test "" != "$makecheck" - then if onpath $MAKE - then MAKE=$_onpath_ - else echo "$command: $MAKE: not found" >&2 - exit 1 - fi - makecheck= - fi - if test "" != "$exec" - then ( - trap - 0 1 2 15 - echo "=== $i installation manifest ===" - cd arch/$a - ( - cd lib/package - INSTALLROOT=$PACKAGEROOT/arch/$a - VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH - export INSTALLROOT VPATH - $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign - ) | sort -u - ) - else ( - set - - cd arch/$a - ( - cd lib/package - INSTALLROOT=$PACKAGEROOT/arch/$a - VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH - export INSTALLROOT VPATH - echo lib/$command - $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign - ) | sort -u | pax -drw -ps $dest - ) - fi - fi - done - done - exit $code - ;; - -license)# all work in $PACKAGESRC/LICENSES - - cd $PACKAGESRC/LICENSES || exit - - # generate the package list - - set '' $target $package - shift - argc=$# - case $# in - 0) set '' * - shift - case $1 in - '*') echo $command: $action: no licenses >&2 - exit 1 - ;; - esac - ;; - *) checkaout proto || exit - a= - for i - do while : - do if test -f ../$i.lic - then j=`proto -df -l ../$i.lic -o query=type /dev/null 2>/dev/null` - case $j in - ?*) if test -f $j - then case " $a " in - *" $j "*) ;; - *) a="$a $j" ;; - esac - fi - break - ;; - esac - fi - case $i in - *-*) i=`echo $i | sed 's/-[^-]*$//'` - ;; - *) echo "$command: $i: package license not found" >&2 - break - ;; - esac - done - done - set '' $a - shift - ;; - esac - for i - do case $exec in - '') echo - echo " --- $i source license ---" - echo - cat $i - ;; - *) echo $PACKAGESRC/LICENSES/$i - ;; - esac - done + echo "A proper installation command is coming back soon, sorry." >&2 + echo "Meanwhile, copy ksh and shcomp from: $INSTALLROOT/arch/$HOSTTYPE/bin" >&2 + exit 1 ;; make|view) cd $PACKAGEROOT - case $package in - '') lic="lib/package/*.lic" - ;; - *) for i in $package - do lic="$lic lib/package/$i.lic" - case $i in - *-*) lic="$lic lib/package/"`echo $i | sed 's,-.*,,'`".lic" ;; - esac - done - ;; - esac - checksrc - requirements source $package - components $package - package=$_components_ # check for some required commands @@ -5516,10 +2862,9 @@ make|view) ;; *) case " $must " in *" $t "*) - echo "$command: $t: not found -- must be on PATH to $action" >&2 - exit 1 + err_out "$t: not found -- must be on PATH to $action" ;; - *) echo "$command: warning: $t: not found -- some $action actions may fail" >&2 + *) note "warning: $t: not found -- some $action actions may fail" ;; esac ;; @@ -5529,10 +2874,10 @@ make|view) # verify the top view if test ! -d $PACKAGEROOT/src - then note no source packages to make + then note "no source packages to make" exit 0 elif test ! -d $INSTALLROOT/src - then note initialize the $INSTALLROOT view + then note "initialize the $INSTALLROOT view" fi for i in arch arch/$HOSTTYPE do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit @@ -5550,12 +2895,12 @@ make|view) k="$k$i" done o="( $o ) -print" - for d in $package_src + for d in $src do i=src/$d if test -d $i then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit make_recurse $i - for j in `cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u` + for j in $(cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u) do case $j in $k|$MAKESKIP) continue ;; esac @@ -5564,34 +2909,12 @@ make|view) done fi done - def= - for i in $lic - do test -f $i || continue - cmp -s $i $INSTALLROOT/$i 2>/dev/null || - $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i - for j in `grep '^. .*\.def$' $i` - do case $j in - .) ;; - *) case " $def " in - *" $i "*) ;; - *) def="$def $i" ;; - esac - ;; - esac - done - done - for i in $def - do i=lib/package/$i - test -f $i || continue - cmp -s $i $INSTALLROOT/$i 2>/dev/null || - $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i - done # check $CC and { ar cc ld ldd } intercepts h="${HOSTTYPE} ${HOSTTYPE}.*" case $HOSTTYPE in - *.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'` + *.*) t=$(echo $HOSTTYPE | sed 's/[.][^.]*//') h="$h $t" ;; *) t=$HOSTTYPE @@ -5599,7 +2922,7 @@ make|view) esac case $t in *[0123456789]) - t=`echo $t | sed 's/[0123456789]*$//'` + t=$(echo $t | sed 's/[0123456789]*$//') h="$h $t" ;; esac @@ -5615,13 +2938,13 @@ make|view) then intercept=1 break 2 fi - case `ls -t "$t" "$b" "$s" 2>/dev/null` in + case $(ls -t "$t" "$b" "$s" 2>/dev/null) in $t*) ;; $b*) cc=$b ;; - $s*) cd $INSTALLROOT/lib/package/gen + $s*) $exec cd $INSTALLROOT/lib/package/gen tmp=pkg$$ - eval '$'exec echo "'int main(){return 0;}' > $tmp.c" + $exec eval "echo 'int main(){return 0;}' > $tmp.c" if $exec $s -o $tmp.exe $tmp.c >/dev/null 2>&1 && test -x $tmp.exe then case $HOSTTYPE in @@ -5632,7 +2955,7 @@ make|view) $exec chmod +x "$b" || exit cc=$b intercept=1 - note update $b + note "update $b" ;; esac fi @@ -5650,10 +2973,10 @@ make|view) for k in $h do for s in $INITROOT/$c.$k do test -x "$s" || continue - case `ls -t "$b" "$s" 2>/dev/null` in + case $(ls -t "$b" "$s" 2>/dev/null) in $b*) ;; $s*) $exec cp "$s" "$b" - note update $b + note "update $b" ;; esac done @@ -5668,10 +2991,10 @@ make|view) do s=$INITROOT/$c.$t test -x "$s" || continue onpath $c || - case `ls -t "$b" "$s" 2>/dev/null` in + case $(ls -t "$b" "$s" 2>/dev/null) in $b*) ;; $s*) $exec cp "$s" "$b" - note update $b + note "update $b" ;; esac done @@ -5680,35 +3003,16 @@ make|view) for t in $h do s=$INITROOT/$c.$t test -x "$s" || continue - case `ls -t "$b" "$s" 2>/dev/null` in + case $(ls -t "$b" "$s" 2>/dev/null) in $b*) ;; $s*) $exec cp "$s" "$b" - note update $b + note "update $b" ;; esac done -# following code stubbed out just in case ar.ibm.risc is needed -# c=ar -# b=$INSTALLROOT/bin/$c -# for t in $h -# do s=$INITROOT/$c.$t -# test -x "$s" || continue -# onpath $c || -# case `ls -t "$b" "$s" 2>/dev/null` in -# $b*) ;; -# $s*) x=`$s -tv /foo/bar.a 2>&1 | egrep -i 'option|usage'` -# case $x in -# '') $exec cp "$s" "$b" -# note update $b -# ;; -# esac -# ;; -# esac -# done case $cc in /*) ;; - *) echo "$command: $CC: not found -- set CC=C-compiler" >&2 - exit 1 + *) err_out "$CC: not found -- set CC=C-compiler" ;; esac case $exec in @@ -5718,11 +3022,11 @@ make|view) if $CC -o $tmp.exe $tmp.c > /dev/null 2> $tmp.err && test -x $tmp.exe then : ok - else echo "$command: $CC: failed to compile this program:" >&2 + else note "$CC: failed to compile this program:" cat $tmp.c >&2 if test -s $tmp.err then cat $tmp.err >&2 - else echo "$command: $CC: not a C compiler" >&2 + else note "$CC: not a C compiler" fi rm -f $tmp.* exit 1 @@ -5737,7 +3041,7 @@ make|view) case $CC in cc) ;; *) if test -x $INSTALLROOT/bin/cc - then case `sed 1q $INSTALLROOT/bin/cc` in + then case $(sed 1q $INSTALLROOT/bin/cc) in ": $CC :") CC=cc export CC @@ -5755,7 +3059,7 @@ make|view) } > $INSTALLROOT/bin/cc chmod +x $INSTALLROOT/bin/cc ;; - *) note generate a $INSTALLROOT/bin/cc wrapper for $CC + *) note "generate a $INSTALLROOT/bin/cc wrapper for $CC" ;; esac CC=cc @@ -5778,10 +3082,10 @@ make|view) i=$INSTALLROOT/lib/probe/C/make/probe j=$INITROOT/C+probe k=$INITROOT/make.probe - case `ls -t $i $j $k 2>/dev/null` in + case $(ls -t $i $j $k 2>/dev/null) in $i*) ;; *) if test -f $j -a -f $k - then note update $i + then note "update $i" shellmagic case $exec in '') { @@ -5803,9 +3107,9 @@ cat $j $k esac fi - # initialize a few mamake related commands + # initialize mamake - checkaout mamake proto ratz release || exit + checkaout mamake || exit # execrate if necessary @@ -5833,43 +3137,59 @@ cat $j $k view) exit 0 ;; esac + # check against previous compiler and flags + + err= + for var in CC CCFLAGS CCLDFLAGS LDFLAGS KSH_RELFLAGS + do store=$INSTALLROOT/lib/package/gen/$var + eval "new=\$$var" + if test -f $store + then old=$(cat $store) + case $old in + "$new") ;; + *) case $old in + '') old="(none)" ;; + *) old="'$old'" ;; + esac + case $new in + '') new="(none)" ;; + *) new="'$new'" ;; + esac + note "$var changed from $old to $new" + err=y ;; + esac + else test -d $INSTALLROOT/lib/package/gen && case $new in + '') ;; + *) echo "$new" ;; + esac > $store + fi + done + case $err,${FORCE_FLAGS+f} in + y,) err_out "This would likely break the build. Restore the flag(s)," \ + "or delete the build directory and rebuild from scratch." + ;; + esac + unset err var store old new + # all work under $INSTALLROOT/src $make cd $INSTALLROOT/src # record the build host name - case $noexec in + case $exec in '') hostinfo name echo "$_hostinfo_" | sed 's,\..*,,' > $PACKAGEBIN/gen/host ;; esac - # make in parallel if possible - - case $NPROC in - '') hostinfo cpu - case $_hostinfo_ in - 0|1) ;; - *) NPROC=$_hostinfo_ - $show NPROC=$NPROC - $show export NPROC - export NPROC - ;; - esac - ;; - esac - # separate flags from target list case $target in *-*) a= for t in $target do case $t in - -[eiknFKNV]*|--*-symbols) - makeflags="$makeflags $t" - ;; - -*) nmakeflags="$nmakeflags $t" + -*) makeflags="$makeflags $t" ;; *) a="$a $t" ;; @@ -5879,76 +3199,6 @@ cat $j $k ;; esac - # generate nmake first if possible - - if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake - then if nonmake $MAKE - then note make $NMAKE with mamake - c=$CC - a=$assign - case $HOSTTYPE in - win32*|cygwin*) - CC="$CC -D_BLD_STATIC" - accept="libast" - case $assign in - *' CC='*) ;; - *) assign="$assign CC=\"\$CC\"" ;; - esac - ;; - *) accept=nmake - ;; - esac - eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign - assign=$a - CC=$c - case $make$noexec in - '') if executable ! $NMAKE - then echo "$command: $action: errors making $NMAKE" >&2 - exit 1 - fi - ;; - *) make=echo - ;; - esac - if test '' != "$PROTOROOT" - then VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH - $show VPATH=$VPATH - export VPATH - fi - note believe generated files for $accept - eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign - $exec touch $INSTALLROOT/bin/.paths - note make the remaining targets with $NMAKE - else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign - case $make$noexec in - '') if executable ! $NMAKE - then echo "$command: $action: errors making $NMAKE" >&2 - exit 1 - fi - ;; - *) make=echo - ;; - esac - fi - fi - - # generate ksh next if possible - - if nonmake $MAKE - then : no need to generate ksh next -- it could be the only package - elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH - then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign - case $make$noexec in - '') if executable ! $KSH - then echo "$command: $action: errors making $KSH" >&2 - exit 1 - fi - ;; - *) make=echo - ;; - esac - fi - # mamprobe data should have been generated by this point case $exec in @@ -6023,7 +3273,7 @@ cat $j $k ;; esac - # run from separate copies since nmake and ksh may be rebuilt + # run from separate copies since ksh may be rebuilt case $EXECROOT in $INSTALLROOT) @@ -6041,7 +3291,7 @@ cat $j $k else rm=rm fi for i in \ - ksh nmake tee cp ln mv rm \ + ksh tee cp ln mv rm \ *ast*.dll *cmd*.dll *dll*.dll *shell*.dll do executable $i && { cmp -s $i $OK/$i 2>/dev/null || { @@ -6051,23 +3301,14 @@ cat $j $k $exec $execrate $mv $OK/$i $OK/$i.old &2 - exit 1 + :ksh) + err_out "$OK/$i: cannot update [may be in use by a running process] remove manually and try again" ;; esac $exec $execrate $cp $i $OK/$i } } done - if test -f ../lib/make/makerules.mo - then cmp -s ../lib/make/makerules.mo $OK/lib/makerules.mo || - $exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo || - $exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo - fi - if executable $OK/nmake - then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib" - fi if executable $OK/tee then TEE=$INSTALLROOT/bin/$OK/tee fi @@ -6086,524 +3327,49 @@ cat $j $k ;; esac - # fall back to mamake if nmake not found or too old + # build with mamake - if nonmake $MAKE - then note make with mamake - case $target in - '') target="install" ;; - esac - eval capture mamake \$makeflags \$noexec \$target $assign - else case $target in - '') target="install cc-" ;; - esac - eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign - fi - ;; + note "make with mamake" + case $target in + '') target="install" ;; + esac + eval capture mamake \$makeflags \$noexec \$target $assign -read) case ${PWD:-`pwd`} in - $PACKAGEROOT) - ;; - *) echo "$command: must be in package root directory" >&2 - exit 1 - ;; - esac - PAX= - if onpath pax - then case `$_onpath_ -rw --?meter 2>&1` in - *--meter*) PAX=pax ;; - esac - fi - code=0 - i= - x= - remove= - touch= - set '' $target - case $2 in - lcl|tgz)tgz=$2 - shift 2 - target=$* - ;; - *) tgz=tgz - ;; - esac - set '' $package $target - case $# in - 1) verbose=: - set '' `ls lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` - ;; - *) verbose= - ;; - esac - shift - files= - for f - do if test -f "$f" - then : ok - elif test -f "lib/package/$tgz/$f" - then f=lib/package/$tgz/$f - else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` - if test '' != "$2" -a -f "$2" - then f=$2 - else set '' `ls -r lib/package/$tgz/${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` - if test '' != "$2" -a -f "$2" - then f=$2 - else echo "$command: $f: package archive not found" >&2 - continue + case $HOSTTYPE in + darwin.*) + # clean up macOS .dSYM bundles belonging to deleted temps + cd "$PACKAGEROOT" || exit + $exec find "arch/$HOSTTYPE" -type d -name '*.dSYM' -exec "$SHELL" -c ' + first=y + for d # loop through the PPs + do case $first in + y) set -- # clear PPs ("for" uses a copy) + first=n ;; + esac + e=${d%.dSYM} # get exe name + if ! test -f "$e" # nonexistent? + then set -- "$@" "$d" # add to new PPs fi - fi - fi - files="$files $f" - done - case $files in - '') echo "$command: lib/package/$tgz: no package archives" >&2 - exit 1 + done + exec rm -rf "$@" # rm all at once: fast + ' "$0" {} + ;; esac - set '' `ls -r $files 2>/dev/null` - shift - f1= f2= f3= f4= - for f - do case $f in - ratz.*|*/ratz.*) - f1="$f1 $f" - ;; - INIT.*|*/INIT.*) - f2="$f2 $f" - ;; - INIT*|*/INIT*) - f3="$f3 $f" - ;; - *) f4="$f4 $f" - ;; - esac - done - gen= - set '' $f1 $f2 $f3 $f4 - while : - do shift - case $# in - 0) break ;; - esac - f=$1 - case $f in - *.gz) : standalone packages unbundled manually - continue - ;; - *.md5) : tarball checksum - continue - ;; - *?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*) - ;; - *) echo "$command: $f: not a package archive" >&2 - code=1 - continue - ;; - esac - case $f in - */*) eval `echo "$f" | sed -e 's,\(.*/\)\(.*\),d=\1 a=\2,'` ;; - *) d= a=$f ;; - esac - # f:file d:dir a:base p:package v:version r:release t:type - eval `echo "$a" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` - case $r in - base) y=$p.base ;; - *) y=$p.delta ;; - esac - case " $x " in - *" $y "*) - continue - ;; - esac - case $t in - '') w=$PACKAGESRC - q= - Q= - m= - ;; - *) w=$PACKAGEROOT/arch/$t/lib/package - q=".$t" - Q="_$t" - m="[_.]$t" - ;; - esac - u=$d$p$q.tim - if test -s "$u" - then continue - else case $force in - 0) case `ls -t "$f" "$u" 2>/dev/null` in - "$u"*) case $verbose in - 1) note $p already read ;; - esac - continue - ;; - esac - ;; - esac - fi - case $p in - INIT) if test -f $PACKAGEROOT/bin/package - then $exec mv $PACKAGEROOT/bin/package $PACKAGEROOT/bin/package.old - fi - ;; - esac - z= - case $r in - base) # base archive - if test ratz = "$p" - then # ratz packages are not archives - case $t in - '') for i in src src/cmd src/cmd/INIT - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - $exec cp $f $PACKAGEROOT/src/cmd/INIT/$p.c - ;; - *) for i in arch arch/$t arch/$t/bin - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - $exec cp $f $PACKAGEROOT/arch/$t/bin/$p && - $exec chmod +x $PACKAGEROOT/arch/$t/bin/$p - ;; - esac - elif test "" != "$PAX" - then $exec pax -L --from=ascii --local -m -ps -rvf "$f" || { - code=1 - continue - } - else if onpath gunzip && onpath $TAR && isascii - then case $TARPROBE in - ?*) for i in $TARPROBE - do if $TAR ${i}f - /dev/null > /dev/null 2>&1 - then TARFLAGS=$TARFLAGS$i - fi - done - TARPROBE= - ;; - esac - if gunzip -l < "$f" > /dev/null 2>&1 - then case $exec in - '') $exec gunzip < "$f" | $TAR ${TARFLAGS}f - ;; - *) $exec "gunzip < $f | $TAR ${TARFLAGS}f -" ;; - esac || { - code=1 - continue - } - else $exec $TAR ${TARFLAGS}f "$f" || { - code=1 - continue - } - fi - else checkaout ratz && onpath ratz || { - code=1 - continue - } - RATZ=$_onpath_ - case $exec in - '') echo $f: - $exec $RATZ -lm < "$f" - ;; - *) $exec "$RATZ -lm < $f" - ;; - esac || { - code=1 - continue - } - fi - if test -f $PACKAGEBIN/gen/$p.sum - then while read md5 mode usr grp file - do case $file in - -*) file=./$file ;; - esac - case $mode in - [01234567][01234567][01234567][01234567]) - case $grp in - -) ;; - *) $exec chgrp $grp "$file" ;; - esac - case $usr in - -) ;; - *) $exec chown $usr "$file" ;; - esac - $exec chmod $mode "$file" - ;; - esac - done < $PACKAGEBIN/gen/$p.sum - fi - fi - ;; - *) # delta archive - test "" != "$PAX" || { - echo "$command: $f: pax required to read delta archive" >&2 - code=1 - continue - } - case `echo "$v: -$r:" | sort` in - $r:*) y=$p.base - b=${d}${p}_${r}${Q}.tgz - test -f "$b" || b=${d}${p}.${r}${q}.tgz - test -f "$b" || { - case " $gen " in - *" $b "*) - ;; - *) case $# in - 1) echo "$command: $f: base archive $b required to read delta" >&2 - code=1 - ;; - *) shift - y=$1 - shift - set '' $y $f "$@" - esac - continue - ;; - esac - } - # -m with delta bug fixed 2005-02-08 - $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { - code=1 - continue - } - note $f: generate new base $d$p.$v$q.tgz - $exec pax -rf "$f" -z "$b" -wf $d$p.$v$q.tgz -x tgz || { - code=1 - continue - } - case $exec in - '') echo $p $v $v 1 > $w/gen/$p.ver - ;; - *) z=$d${p}[_.]$v$q.tgz - $exec "echo $p $v $v 1 > $w/gen/$p.ver" - gen="$gen $d$p.$v$q.tgz" - ;; - esac - case " $remove " in - *" $f "*) ;; - *) remove="$remove $f" ;; - esac - ;; - *) b=${d}${p}_${v}${Q}.tgz - test -f "$b" || b=${d}${p}.${v}${q}.tgz - test -f "$b" || { - case " $gen " in - *" $b "*) - ;; - *) case $# in - 1) echo "$command: $f: base archive $b required to read delta" >&2 - code=1 - ;; - *) shift - y=$1 - shift - set '' $y $f "$@" - esac - continue - ;; - esac - } - # -m with delta bug fixed 2005-02-08 - $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { - code=1 - continue - } - ;; - esac - ;; - *) echo "$command: $f: unknown archive type" >&2 - code=1 - continue - ;; - esac - # check for ini files - - if executable $w/$p.ini - then $exec $w/$p.ini read || { - code=1 - continue - } - fi - - # add to the obsolete list - - k= - for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>/dev/null` - do case $i in - *.md5) continue - ;; - $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) - ;; - $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) - continue - ;; - esac - case $k in - ?*) case " $remove " in - *" $k "*) ;; - *) remove="$remove $k" ;; - esac - ;; - esac - k=$i - done - x="$x $y" - case " $touch " in - *" $u "*) ;; - *) touch="$touch $u" ;; - esac - done - if test ! -f $PACKAGEROOT/bin/package -a -f $PACKAGEROOT/bin/package.old - then $exec cp $PACKAGEROOT/bin/package.old $PACKAGEROOT/bin/package - fi - - # drop obsolete archives - - case $remove in - ?*) $exec rm -f $remove ;; - esac - - # mark the updated archives - - case $touch in - ?*) sleep 1; $exec touch $touch ;; - esac - - # check the requirements - - case $code$exec in - 0) requirements - $x ;; - esac - exit $code - ;; - -regress)if test ! -d $PACKAGEBIN/gen - then echo "$command: 'package make' and 'package test' required for regression" >&2 - exit 1 - fi - dir=$PACKAGEBIN/gen - cd $dir - for s in out old - do case `ls -t regress.$s test.$s 2>/dev/null` in - regress*) - ;; - test*) if test -f regress.$s - then $exec mv regress.$s regress.old - fi - case $exec in - '') egrep -i '\*\*\*|FAIL|^TEST.* [123456789][0123456789]* error|core.*dump' test.$s | - sed -e '/\*\*\* [0123456789]/d' \ - -e '/^TEST.\//s,/[^ ]*/,,' \ - -e 's,[ ][ ]*$,,' \ - -e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \ - -e 's/\.sh failed at .* with /.sh failed /' \ - > regress.$s - ;; - *) $exec filter test failures from $dir/test.$s to $dir/regress.$s - ;; - esac - ;; - esac - done - if test -f regress.out -a -f regress.old - then $exec diff -b regress.out regress.old - else echo "$command: at least 2 test runs required for regression" >&2 - exit 1 - fi - ;; - -release)count= lo= hi= - checksrc - checkaout release || exit - requirements source $package - components $package - package=$_components_ - set '' $target - shift - case $# in - 0) ;; - *) case $1 in - -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) - case $1 in - -) lo= release= ;; - *) lo=$1 release="-f $1" ;; - esac - shift - case $1 in - -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) - case $1 in - -) hi= ;; - *) hi=$1 release="$release -t $1" ;; - esac - shift - ;; - esac - ;; - [0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*) - count=$1 - release="-r $count" - shift - ;; - esac + case $flat in + 1) note "updating flat view" + cd "$PACKAGEROOT" || exit + $exec find "arch/$HOSTTYPE" -type f ! -name '*.old' -exec "$SHELL" -c ' + for h + do p=${h#"arch/$HOSTTYPE/"} + test "$h" -ef "$p" && continue # already created + d=${p%/*} + test -d "$d" || mkdir -p "$d" || exit + ln -f "$h" "$p" 2>/dev/null || ln -sf "$h" "$p" || exit + done + ' "$0" {} + ;; esac - case $# in - 0) case $package in - '') package=* ;; - esac - ;; - *) case $package in - '') package=$* - ;; - *) echo $command: $*: lo-date hi-date arguments expected >&2 - exit 1 - ;; - esac - ;; - esac - echo - case $count:$lo:$hi in - ::) echo "All recorded changes follow." ;; - 1::) echo "Changes since the last release follow." ;; - ?*::) echo "Changes since the last $count releases follow." ;; - 1:?*:) echo "Changes since $lo or the last release follow." ;; - *:?*:*) echo "Changes since $lo follow." ;; - *::?*) echo "Changes before $hi follow." ;; - *) echo "Changes between $lo and $hi follow." ;; - esac - x= - for r in $INSTALLROOT $PACKAGEROOT - do for s in $package_src - do d=$r/src/$s - if test -d $d - then cd $d - for i in $package - do if test -h $i 2>/dev/null - then continue - fi - case " $x " in - *" $i "*) continue ;; - esac - for f in RELEASE CHANGES ChangeLog - do if test -f $i/$f - then $exec release $release $i/$f - x="$x $i" - for f in $i/*/$f - do if test -f $f - then $exec release $release $f - fi - done - break - fi - done - done - fi - done - done - ;; - -remove) echo "$command: $action: not implemented yet" >&2 - exit 1 ;; results)set '' $target @@ -6625,12 +3391,10 @@ results)set '' $target --) shift break ;; - admin) dir=$PACKAGESRC/admin - ;; error*|fail*) filter=errors ;; - make|test|view|write) + make|test|view) def=$1 case $filter:$1:$SHELL in errors:*:*) ;; @@ -6640,8 +3404,7 @@ results)set '' $target old) suf=old ;; on) case $# in - 1) echo $command: $action: $1: host pattern argument expected >&2 - exit 1 + 1) err_out "$action: $1: host pattern argument expected" ;; esac shift @@ -6693,8 +3456,7 @@ results)set '' $target ;; esac done - echo "$command: $i action output not found" >&2 - exit 1 + err_out "$i action output not found" done sep= case $t in @@ -6725,7 +3487,7 @@ results)set '' $target cat) cat $m ;; *) if test -f $HOME/.pkgresults - then i="`cat $HOME/.pkgresults`" + then i=$(cat $HOME/.pkgresults) case $i in '|'*) ;; *) i="|$i" ;; @@ -6738,7 +3500,7 @@ results)set '' $target case $filter in errors) $exeg egrep '^pax:|\*\*\*' $j ;; - *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|pragma.*prototyped|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | + *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | $exec grep : ;; esac @@ -6752,508 +3514,14 @@ results)set '' $target esac ;; -test) requirements source $package - components $package - package=$_components_ - case $only in - 0) only= ;; - 1) only=--recurse=only ;; - esac - - # must have nmake - - if nonmake $MAKE - then echo $command: $action: must have $MAKE to test >&2 - exit 1 - fi - - # all work under $INSTALLROOT/src - - $make cd $INSTALLROOT/src - - # disable core dumps (could be disastrous over nfs) - - (ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0 - - # do the tests - - eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign - ;; - -update) # download the latest release.version for selected packages - - # all work in $PACKAGEROOT/lib/package/tgz - - if test ! -d $PACKAGEROOT/lib/package/tgz - then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit - $exec cd $PACKAGEROOT/lib/package/tgz - else cd $PACKAGEROOT/lib/package/tgz - fi - - # get the architectures, update query url, and packages - - set '' $args - op=update - tgz=tgz - source= - binary= - setup= - types= - url= - urlfile=$default_url - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - --) shift - break - ;; - beta) op=beta - tgz=beta - ;; - binary) binary=1 - ;; - setup) setup=1 - ;; - source) source=1 - ;; - *://*) url=$1 - shift - break - ;; - *.url) urlfile=$1 - if test ! -s $urlfile - then echo $command: $urlfile: not found >&2; exit 1 - fi - break - ;; - $all_types) - binary=1 - types="$types $1" - ;; - *) break - ;; - esac - done - case $source:$binary in - :) source=1 binary=1 - ;; - :1) case $types in - '') types=$HOSTTYPE ;; - esac - ;; - esac - case $url in - '') case $urlfile in - $default_url) - if test ! -s $urlfile - then echo $command: url argument expected >&2; exit 1 - fi - ;; - *) default_url= - ;; - esac - url= - if grep '^url=' $urlfile >/dev/null - then a=$authorize - p=$password - case $urlfile in - */*) ;; - *) urlfile=./$urlfile ;; - esac - . $urlfile - case $a:$p in - $authorize:$password) - default_url= - ;; - *) case $a in - ?*) authorize=$a ;; - esac - case $p in - ?*) password=$p ;; - esac - ;; - esac - else url=`cat $urlfile` - fi - ;; - esac - case $exec in - ?*) default_url= ;; - esac - - # get the update list - - eval `echo $url | sed 's,\(.*\)://\([^/]*\)/\(.*\),prot=\"\1\" host=\"\2\" dir=\"\3\",'` - get $host $dir/$op.html - - # get/check the package names - - case " $* " in - *" - "*)case $source in - 1) source_packages=$* ;; - *) source_packages= ;; - esac - case $binary in - 1) binary_packages=$* ;; - *) binary_packages= ;; - esac - package_hit=$* - ;; - " ") nl=" -" - case $source in - 1) p= - for f in `ls *.????-??-??.* 2>/dev/null` - do case $f in - *.????-??-??.????-??-??.*.*) - ;; - *.????-??-??.????-??-??.*) - p=$p$nl$f - ;; - *.????-??-??.*.*) - ;; - *.????-??-??.*) - p=$p$nl$f - ;; - esac - done - set '' `echo "$p" | sed 's,\..*,,' | sort -u` - shift - source_packages=$* - ;; - *) source_packages= - ;; - esac - case $binary in - 1) p= - for f in `ls *.????-??-??.* 2>/dev/null` - do case $f in - *.????-??-??.????-??-??.*.*) - p=$p$nl$f - ;; - *.????-??-??.????-??-??.*) - ;; - *.????-??-??.*.*) - p=$p$nl$f - ;; - *.????-??-??.*) - ;; - esac - done - set '' `echo "$p" | sed 's,\..*,,' | sort -u` - shift - binary_packages=$* - ;; - *) binary_packages= - ;; - esac - package_hit="$source_packages $binary_packages" - ;; - *) case $source in - 1) source_packages=$* ;; - *) source_packages= ;; - esac - case $binary in - 1) binary_packages=$* ;; - *) binary_packages= ;; - esac - package_hit= - ;; - esac - - # get the latest updates - - types_test= - types_local= - dir=$dir/$tgz - case $default_url in - ?*) echo "url='$url' authorize='$authorize' password='$password'" > $default_url - case $authorize in - ?*) chmod go-rwx $default_url ;; - esac - ;; - esac - echo "$got" > got.tmp - case $only in - 0) exec < got.tmp - covered= - while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment - do case $requires in - ''|-*) continue ;; - esac - IFS=: - set '' $requires - IFS=$ifs - case $type in - -) case " $source_packages " in - *" $name "*|*" - "*) - for name - do case " $source_packages " in - *" $name "*) - ;; - *) source_packages="$source_packages $name" - covered=$covered:$covers - ;; - esac - done - ;; - esac - ;; - *) case " $binary_packages " in - *" $name "*|*" - "*) - for name - do case " $binary_packages " in - *" $name "*) - ;; - *) binary_packages="$binary_packages $name" - covered=$covered:$covers - ;; - esac - done - ;; - esac - ;; - esac - done - case $covered in - ?*) x=$source_packages - source_packages= - for name in $x - do case :$covered: in - *:$name:*) ;; - *) source_packages="$source_packages $name" ;; - esac - done - x=$binary_packages - binary_packages= - for name in $x - do case :$covered: in - *:$name:*) ;; - *) binary_packages="$binary_packages $name" ;; - esac - done - ;; - esac - ;; - esac - checksum= - for i in $checksum_commands - do case `( $i ) < /dev/null 2> /dev/null` in - ${checksum_empty}|${checksum_empty}[\ \ ]*) - checksum=$i - break - ;; - esac - done - case $checksum in - '') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;; - esac - exec < got.tmp - while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment - do case $verbose in - 1) case $type in - -) i= ;; - *) i=.$type ;; - esac - j="$name.$base$i.$suffix" - case $delta in - -) j="$j -" ;; - *) j="$j $name.$base.$delta$i.$suffix" ;; - esac - case $sync in - -) j="$j -" ;; - *) j="$j $name.$base.$sync$i.$suffix" ;; - esac - echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2 - esac - case " $package_hit " in - *" $name "*|*" - "*) - ;; - *) package_hit="$package_hit $name" - ;; - esac - case $type in - -) case " $source_packages " in - *" $name "*|*" - "*) - if test -s $name.tim - then continue - fi - lcl=$name.$base.$suffix - if test -f $lcl - then case $checksum:$base_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" - then rmt= - case $sync:$sync_size in - -*|*[-:]) - ;; - *) lcl=$name.$base.$sync.$suffix - if test -f $lcl - then rmt=1 - get $host $dir $lcl $sync_size $sync_sum - fi - ;; - esac - case $base:$base_size in - -*|*[-:]) - ;; - *) case $rmt in - '') lcl=$name.$base.$suffix - get $host $dir $lcl $base_size $base_sum - ;; - esac - ;; - esac - fi - case $delta:$delta_size in - -*|*[-:]) - ;; - *) lcl=$name.$delta.$base.$suffix - if test -f $lcl - then case $checksum:$delta_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" - then get $host $dir $lcl $delta_size $delta_sum - fi - ;; - esac - ;; - esac - ;; - *) case " $binary_packages " in - *" $name "*|*" - "*) - if test -s $name.$type.tim - then continue - fi - case " $types " in - *" - "*);; - " ") case " $types_test " in - *" $type "*) - ;; - *) types_test="$types_test $type" - for i in *.????-??-??.$type.* *.????-??-??.????-??-??.$type.* - do if test -f $i - then types_local="$types_local $type" - fi - break - done - ;; - esac - case " $types_local " in - *" $type "*) - ;; - *) continue - ;; - esac - ;; - *) case " $types " in - *" $type "*) - ;; - *) continue - ;; - esac - ;; - esac - lcl=$name.$base.$type.$suffix - if test -f $lcl - then case $checksum:$base_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" - then rmt= - case $sync:$sync_size in - -*|*[-:]) - ;; - *) lcl=$name.$base.$sync.$type.$suffix - if test -f $lcl - then rmt=1 - get $host $dir $lcl $sync_size $sync_sum - fi - ;; - esac - case $base:$base_size in - -*|*[-:]) - ;; - *) case $rmt in - '') lcl=$name.$base.$type.$suffix - get $host $dir $lcl $base_size $base_sum - ;; - esac - ;; - esac - fi - case $delta:$delta_size in - -*|*[-:]) - ;; - *) lcl=$name.$delta.$base.$type.$suffix - if test -f $lcl - then sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` - else sum=X - fi - if test -f $lcl - then case $checksum:$delta_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" - then get $host $dir $lcl $delta_size $delta_sum - fi - ;; - esac - ;; - esac - ;; - esac - done - closure= - for name in $source_packages $binary_packages - do case $name in - -) ;; - *) case " $package_hit " in - *" $name "*) - case $setup in - 1) case " $closure " in - *" $name "*) - ;; - *) closure="$closure $name" - ;; - esac - ;; - esac - ;; - *) echo $command: $name: unknown package >&2 - ;; - esac - ;; - esac - done - exec <&- - rm -f got.tmp - case $closure in - ?*) echo $closure ;; - esac +test) # pass control to ksh 93u+m test script + capture "$PACKAGEROOT/bin/shtests" $args ;; use) # finalize the environment x=:.. - for d in `( cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u )` + for d in $( cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u ) do x=$x:$INSTALLROOT/$d done x=$x:$INSTALLROOT @@ -7265,33 +3533,19 @@ use) # finalize the environment export CDPATH ;; esac - P=$PACKAGEROOT - $show P=$P - $show export P - export P - A=$INSTALLROOT - $show A=$A - $show export A - export A - case $NPROC in - '') hostinfo cpu - case $_hostinfo_ in - 0|1) ;; - *) NPROC=$_hostinfo_ - $show NPROC=$NPROC - $show export NPROC - export NPROC - ;; - esac - ;; - esac eval PACKAGE_USE=$package_use export PACKAGE_USE + unset LC_ALL # respect the user's locale again; avoids multibyte corruption # run the command case $run in - '') case $show in + '') note "You are now entering a new environment set up to use the package in:" \ + " $INSTALLROOT" \ + "You're using the shell:" \ + " $SHELL" \ + "Type 'exit' to leave and go back to normal." + case $show in ':') $exec exec $SHELL ;; esac ;; @@ -7300,128 +3554,7 @@ use) # finalize the environment esac ;; -verify) cd $PACKAGEROOT - requirements binary $package - if executable ! $SUM - then echo "$command: $action: $SUM command required" >&2 - exit 1 - fi - case $target in - '') cd arch - set '' * - shift - target=$* - cd .. - ;; - esac - code=0 - for a in $target - do case $package in - '') set '' arch/$a/lib/package/gen/*.sum - shift - if test -f $1 - then for i - do package_verify $i || code=1 - done - else echo "$command: warning: $a: no binary packages" >&2 - fi - ;; - *) for i in $package - do if test -f arch/$a/lib/package/gen/$i.sum - then package_verify arch/$a/lib/package/gen/$i.sum || code=1 - else echo "$command: warning: $a: no binary package for $i" >&2 - fi - done - ;; - esac - done - exit $code - ;; - -write) set '' $target - shift - action= - list= - qualifier= - while : - do case $1 in - base|closure|delta|exp|lcl|pkg|rpm|tgz) - qualifier="$qualifier $1" - ;; - binary) action=$1 - type=$HOSTTYPE - eval list=$PACKAGESRC/tgz/$admin_list - ;; - cyg) qualifier="$qualifier $1" - assign="$assign closure=1" - only=1 - ;; - runtime|source) - action=$1 - ;; - tst) qualifier="$qualifier tgz" - assign="$assign copyright=0 'PACKAGEDIR=\$(PACKAGESRC)/tst'" - ;; - nocopyright) - assign="$assign copyright=0" - ;; - *) break - ;; - esac - shift - done - case $action in - '') echo "$command: binary or source operand expected" >&2 - exit 1 - ;; - esac - set '' "$@" $package - shift - case $only in - 0) set '' `order "$@"` - shift - ;; - esac - case $# in - 0) echo "$command: at least one package name expected" >&2 - exit 1 - ;; - esac - if nonmake $MAKE - then echo "$command: must have $MAKE to generate archives" >&2 - exit 1 - fi - - # all work under $PACKAGEBIN - - $make cd $PACKAGEBIN - case $list in - ?*) $exec rm -f $list ;; - esac - - # go for it - - for package - do if view - all $package.pkg || view - all lib/package/$package.pkg - then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$package.pkg \$qualifier \$action $assign - else echo "$command: $package: not a package" >&2 - fi - done - ;; - -TEST) set '' $target $package - shift - case $1 in - binary|source) - action=$1 - shift - ;; - esac - order "$@" - ;; - -*) echo "$command: $action: internal error" >&2 - exit 1 +*) err_out "$action: internal error" ;; esac diff --git a/cde/programs/dtksh/ksh93/bin/silent b/cde/programs/dtksh/ksh93/bin/silent index 77e85333b..4ae93a22b 100755 --- a/cde/programs/dtksh/ksh93/bin/silent +++ b/cde/programs/dtksh/ksh93/bin/silent @@ -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 diff --git a/cde/programs/dtksh/ksh93/docs/ksh/builtins.html b/cde/programs/dtksh/ksh93/docs/ksh/builtins.html index 2465fb54b..30aa3cf40 100644 --- a/cde/programs/dtksh/ksh93/docs/ksh/builtins.html +++ b/cde/programs/dtksh/ksh93/docs/ksh/builtins.html @@ -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.

This memo describes how to write and compile programs -that can be loaded into ksh at run time as built-in +that can be loaded into ksh at run time as built-in commands.


INTRODUCTION

@@ -93,7 +93,7 @@ The development kit has three directories, It is best to set the value of the environment variable PACKAGE_ast to the pathname of the directory containing the development kit. -The include directory contains a sub-directory +The include directory contains a subdirectory named ast that contains interface prototypes for functions that you can call from built-ins. The lib directory contains the ast library @@ -128,7 +128,7 @@ to terminate your command. The return value will become the exit status of the command. The open built-in, installed in lib/ksh in the AST Toolkit, uses this method. The Shbltin_t structure contains a field named shp which is -a pointer the the shell data that is needed for shell library callbacks. +a pointer to the shell data that is needed for shell library callbacks. It also contains the fields, shrun, shtrap, shexit, and shbltin that are function pointers to the shell library functions sh_run, sh_trap @@ -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&R C[3], -ANSI-C[4], +ANSI C[4], and C++[5].

The best thing to do is to include the header file <shell.h>. @@ -285,7 +285,7 @@ services for your builtins. The header file <ast.h> provides prototypes for many libast functions and all the symbol and function definitions from the -ANSI-C headers, <stddef.h>, +ANSI C headers, <stddef.h>, <stdlib.h>, <stdarg.h>, <limits.h>, and <string.h>. It also provides all the symbols and definitions for the @@ -311,7 +311,7 @@ the Safe/Fast I/O library[7], to perform all I/O operations. The sfio library, which is part of libast, 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 sfio and you do not want to spend the time learning it, @@ -412,7 +412,7 @@ The variable opt_info.num will contain this value after the given argument is encountered.

?
Used after a : or # (and after the optional ?) -to indicate the the +to indicate the preceding option argument is not required.
[...]

After a : or #, the characters contained @@ -458,7 +458,7 @@ while(1) switch(n=optget(argv,"xf:[file]")) break; case '?': error(ERROR_usage(2), opt_info.arg); - break; + UNREACHABLE(); } @@ -521,7 +521,7 @@ The shell library is used to access other shell services.

The nval library

A great deal of power is derived from the ability to use -portions of the hierarchal variable namespace provided by ksh-93 +portions of the hierarchical variable namespace provided by ksh-93 and turn these names into active objects.

The nval 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 nv_getval() returns a pointer the the +The nv_getval() 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 nv_getval() call @@ -593,7 +593,7 @@ The getval() function is called by nv_getval() value and must return a string. The getnum() -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 nv_getval() and convert the result to a number. diff --git a/cde/programs/dtksh/ksh93/docs/ksh/faq.html b/cde/programs/dtksh/ksh93/docs/ksh/faq.html index 43319e28f..7ae85bf6d 100644 --- a/cde/programs/dtksh/ksh93/docs/ksh/faq.html +++ b/cde/programs/dtksh/ksh93/docs/ksh/faq.html @@ -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.

  • version-- -a lower-case letter signifying major release points. +a lowercase letter signifying major release points. An optional - following features signifies an alpha release. The first stable release has no -. An optional + 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
    What new features are planned for ksh?
    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) software, @@ -389,7 +389,7 @@ If you run kill -l $? -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.
    When I type builtin, I notice that some of these are full pathnames. What does this mean?
    @@ -464,7 +464,7 @@ is to make the command a builtin. On systems in which the cmd library is installed, you can invoke 'builtin -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.
    What is the -n option used for?
    @@ -600,7 +600,7 @@ hand side, which removes the special meaning of pattern match characters, then this becomes a string comparison so that [[ "$foo" == "bar" ]] and [[ "$bar" == "$foo" ]] are equivalent. -
    Why does ksh93 have print since echo already exists is is widely used?
    +
    Why does ksh93 have print since echo already exists and is widely used?
    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).
    How can I access a substring of a variable?
    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[@]}.
    How do I do global substitutions on the contents of shell variables?
    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". -
    How can I convert %XX values to ascii?
    +
    How can I convert %XX values to ASCII?
    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"'\$'"}'" -will print out the string in ascii. +will print out the string in ASCII.
    I want to use exec to open a file. How do I prevent the script from exiting if the exec fails?
    @@ -894,19 +894,19 @@ Alternatively, <# and ># can be followed by a shell pattern. In this case, the file will be positioned to beginning of the next line containing this pattern. -
    What is the the <<< redirection operator?
    +
    What is the <<< redirection operator?
    It denotes a here-document in which the document is contained the argument that follows <<< and therefore there is no delimiter. -
    What is the the >; redirection operator?
    +
    What is the >; redirection operator?
    This operator writes the output into a temporary file in the same directory as the file specified after >;. 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. -
    What is the the <>; redirection operator?
    +
    What is the <>; redirection operator?
    The file is opened for reading and writing as with <>. However, when the file is closed it is truncated to the its current location. diff --git a/cde/programs/dtksh/ksh93/docs/ksh/features.html b/cde/programs/dtksh/ksh93/docs/ksh/features.html index 8c3abe0dd..978f01df4 100644 --- a/cde/programs/dtksh/ksh93/docs/ksh/features.html +++ b/cde/programs/dtksh/ksh93/docs/ksh/features.html @@ -21,7 +21,7 @@ dd { margin-left:3em; }

    ksh features

    KSH-93 is the most recent version of the KornShell Language described in The KornShell Command and Programming Language, -by Morris Bolsky and David Korn of AT&T Research (nee Bell Laboratories). +by Morris Bolsky and David Korn of AT&T Research. The KornShell is a shell programming language, which is upward compatible with sh @@ -39,7 +39,7 @@ In addition, scripts can be run on KSH-93 without modification.

    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.

    diff --git a/cde/programs/dtksh/ksh93/lib/package/CONVERT.mk b/cde/programs/dtksh/ksh93/lib/package/CONVERT.mk deleted file mode 100644 index 63a60ef5f..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/CONVERT.mk +++ /dev/null @@ -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 <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 diff --git a/cde/programs/dtksh/ksh93/lib/package/INIT.README b/cde/programs/dtksh/ksh93/lib/package/INIT.README deleted file mode 100644 index 6ee06f829..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/INIT.README +++ /dev/null @@ -1,1029 +0,0 @@ -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. - -Source Package Installation Instructions: - - (1) Do not install packages as root/super-user. Although some components may - have setuid executables, few must be owned by root. These are best - changed manually when the security implications are understood. - (2) Choose a package root directory and cd to it. This will be a local work - area for all packages. - (3) These instructions bypass the click to download package links on the - download site. If you already clicked, or if your system does not have - curl(1), hurl(1), lynx(1) or wget(1) then use the alternate instructions - for (3),(4),(5) in plan B below. Plan B installs the hurl(1) - script which works with ksh and modern bash. The top level URL is: - URL=http://www.research.att.com/sw/download - (4) If the bin/package script does not exist then run: - test -d bin || mkdir bin - url=$URL/package - (wget -O - $url||curl -L $url||hurl $url) > bin/package - chmod +x bin/package - (5) Determine the list of package names you want from the download site, then - use the package(1) command to do the actual download: - bin/package authorize "NAME" password "PASSWORD" \ - setup source $URL PACKAGE ... - (Refer to the AUTHORIZATION paragraph on the main download page for - NAME/PASSWORD details.) This downloads the closure of the latest - source package(s); covered and up-to-date packages are not downloaded again unless - package force ... is specified. Package content is verified using md5sum. - If the package root will contain only one architecture then you can install in bin and - lib instead of arch/HOSTTYPE/bin and arch/HOSTTYPE/lib by running this - instead: - bin/package authorize "NAME" password "PASSWORD" \ - flat setup source $URL PACKAGE ... - To update the same packages from the same URL run: - bin/package setup source - (6) Build and install; all generated files are placed under arch/HOSTTYPE - ($INSTALLROOT), where HOSTTYPE is the output of bin/package (with no - arguments.) name=value arguments are supported; CC and debug=1 (compile - with -g instead of -O) are likely candidates. The output is written to - the terminal and captured in $INSTALLROOT/lib/package/gen/make.out: - bin/package make - (7) List make results and interesting errors: - bin/package results - Run the regression tests: - bin/package test - List test results and errors: - bin/package results test - (8) The generated binaries are position independent, i.e., they do not - contain hard-coded paths. However, commands with related files, like - file(1) and nmake(1), require the path of the bin directory to be - exported in PATH. - (9) You can run the binaries directly from the package root, or you can - install them in a public root after you are satisfied with the make and - test actions (requires the AT&T nmake(1) command): - bin/package flat install DIRECTORY PACKAGE - This will install in DIRECTORY/bin and DIRECTORY/lib. If you want to - preserve the arch/HOSTTYPE hierarchy under DIRECTORY then omit the - flat argument. If you don't have nmake(1) then the following will do a - flat install: - cd $INSTALLROOT - cp -p -r bin lib include DIRECTORY - (10) To summarize, after the first time the download, build, and test cycle - for the latest source release is: - bin/package setup source - bin/package make - bin/package test - -Source Package Installation Instructions -- Plan B: - - (3) Create the subdirectory lib/package/tgz and download all package archives - into that directory. - (4) If the bin/package script does not exist then manually read the INIT - source package: - gunzip < lib/package/tgz/INIT.YYYY-MM-DD.tgz | tar xvf - - Note that some browsers automatically unzip downloaded without warning. - If the gunzip fails try: - tar xvf - lib/package/tgz/INIT.YYYY-MM-DD.tgz - If your system does not have tar(1) or gunzip(1) then download the ratz - source package, compile it, and manually read the INIT - source package: - mkdir bin - cp lib/package/tgz/ratz.YYYY-MM-DD.c lib/package/tgz/ratz.c - cc -o bin/ratz lib/package/tgz/ratz.c - bin/ratz -lm < lib/package/tgz/INIT.YYYY-MM-DD.tgz - (5) Read all unread package archive(s): - bin/package read - Both source and binary packages will be read by this step. - -All recorded changes follow. - -:::::::: INIT :::::::: - -12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output -12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo() -12-06-20 package.sh: use $KSH for rt in "results test" -12-06-15 Makefile: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB -12-06-15 package.sh: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB -12-06-13 package.sh: handle admin.db column output -12-06-08 iffe.sh: fix 12-06-06 typo -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-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'' -12-04-17 cc.ibm.risc*: _LARGEFILE64_SOURCE => _LARGE_FILE_API moved to libast/features -12-04-09 cc.ibm.risc*: speak aixese for _LARGEFILE64_SOURCE -12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness -12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list -12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH -12-02-29 package.sh: fix ksh vs -lcmd compatibility checks -12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics -12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static -12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE -12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts -12-02-07 package.sh: add { clean clobber } actions -12-02-02 regress.sh: fix ulimit -c defaults for --nokeep -12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison -12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib -12-01-21 Makefile: :PACKAGE: license=ast -- oops -12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err -12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs -11-12-13 iffe.sh: add /**/ test code comment to disable default #include -11-11-11 C+probe: test for .so before .sl -11-10-26 package.sh: don't forget about *.pkg for admin update -11-10-18 cc.*-icc: update and add more -11-10-11 package.sh: handle package make|view when no source installed -11-09-11 package.sh: count admin '*** termination code' errors -11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps -11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...'' -11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh -11-08-11 iffe.sh: handle ancient sort that doesn't have -k -11-06-01 make.probe: add more /lib64 logic -11-05-01 package.sh: fix admin ditto to sync LICENSES too -11-03-25 package.sh: initialize { $SED $TR } before first use! -11-03-21 package.sh: fix vpath probes -11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.* -11-02-24 package.sh: change curl usage to "curl -L ..." -11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archaic.*### -11-02-02 Makefile: add :MAPLIB: check for ancient -lw -11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64 -11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ] -11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks -11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream -11-01-07 iffe.sh: check debug==3 for is_hdr() failure -10-11-22 ditto.sh: fix timing problem between |& and exec &p -10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path -10-10-10 package.sh: list main env vars at start of make action -10-10-10 ratz.c: tweak windows delays -10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC -10-09-01 package.sh: fix ratz from source logic -10-08-25 package.mk: consolidate license file search in .package.licenses. -10-08-22 ratz.c: run sear bootstrap command detached -10-08-20 C+probe: version_stamp only if version_flags works -10-08-17 package.sh: unset makerules *DIR variables in env -10-08-15 package.sh: "make" action now lists some env values -10-08-11 mktest.sh: add "DO command ..." -10-07-27 rt.sh: handle "rt X=Y ..." -10-06-29 ratz.c: non-option sear args passed to sear_exec() -10-06-25 iffe.sh: "api" op changed to not do "map-libc" type mappings -10-06-25 package.sh: "force admin ditto" => no ditto --update option -10-06-22 C+probe: handle cc that require .[ci] input for version info -10-06-21 ditto.sh: change default remote access to ssh (about time) -10-06-12 regress.sh: DIAGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all -10-06-09 package.sh: add AT&T to usable nmake check -10-06-06 iffe.sh,iffe.tst: add { api ver } ops -10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info -10-04-15 iffe.sh: don't forget candidate headers for hdr|sys! -10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1) -10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH -10-02-11 package.sh: fix package admin make report error count -10-02-02 package.sh: fix write binary bug that did scp on local fs -10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst -10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check -10-01-01 make.probe: handle ['"] in CC.VERSION.STRING -09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS -09-11-30 mktest.sh: change RESET to STATE.RESET to make it global -09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs } -09-11-11 package.sh: re-order and combine cc checks -09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG -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-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 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 -09-05-05 package.sh: handle non-identifier hostnames -09-05-05 mamake.c: pass undefined ${...} identifiers to the shell -09-05-05 mamake.rt: add macro expansion regression tests -09-05-01 iffe.sh: fix output initialization *again* -09-04-28 package.sh: handle admin.db contact field $9 -09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops -09-03-31 regress.sh: EXPORT before test => global ENVIRON[] -09-03-26 package.sh: test fail pattern is 'fail[es]' -09-03-26 UNIT - ... appends (options) to command line -09-03-19 TEST.mk: x.tst => x only if x is command target -09-03-15 regress.sh: add ${MAIN} for base name of main unit -09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir -09-03-03 regress.sh: allow command line unit to override UNIT -09-03-03 mktest.sh: handle IO == $'\n' -09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs -09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."! -09-01-27 package.sh: add isascii() to use ratz instead of tar -09-01-20 hurl.sh: add --size=bytes option -09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding -09-01-03 regress.sh: fix UNIT to allow command line override -09-01-03 mktest.sh: handle TWD -08-12-24 package.sh: fix cross-compile HOSTTYPE logic -08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 } -08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!! -08-09-30 rt.sh: fix ksh93 regression test signal count -08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input -08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo -08-09-20 make.probe: handle another /usr/bin/file shared lib description -08-09-20 regress.sh: add --pipefail for SET pipe-input ... -08-09-17 Makefile: add gdbm1.c for -08-09-10 make.probe: add CC.NOPROTECT -08-08-08 mktest.sh: add --width=width -08-08-05 dbm.req: favor sleepycat ndbm compatibility -08-08-04 C+probe: fix stdlib initialization logic -08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo -08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh -08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2 -08-06-11 regress.sh: fix bug that skipped the last test -08-05-20 regress.sh: add --local to put *.tmp dir in local fs -08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI -08-05-01 package.sh: package test => ulimit -c 0 -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-01 package.sh: handle multiple admin HOSTTYPEs per HOST -08-03-28 C+probe: add C++ #include (no extension) dir probes -08-03-17 regress.sh: fix trap on EXIT, add terminated note to final tally -08-02-28 make.probe: fix probe_warn to include ld! -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-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 -07-12-03 package.sh: add LC_ALL=C -07-11-27 package.sh: fix overaggressive *.md5 cleanup -07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal -07-11-05 package.sh: fix write op error count pattern -07-11-05 package.mk: fix $(~req) .ver binding -07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING] -07-08-01 package.sh: handle 'package read lcl|tgz' -07-05-08 regress.sh: execute basename instead of absolute path for short $0 -07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer -07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh -07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...} -07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG -07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe -07-03-28 package.sh: fix binary tgz architecture type duplication -07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst -07-03-28 iffe.sh: add -F header to mac test -07-03-23 make.probe: handle file(1) that returns 'archive' for .so -07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF -07-03-11 package.sh: add nocopyright and tst => nocopyright -07-03-11 package.mk: add copyright=0 -07-03-08 C+probe: restore IFS after probe.ini -07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR} -07-01-05 package.sh: fix "admin write binary" logic -07-01-01 iffe.sh: add "cmd" --verbose trace -07-01-01 iffe.sh: sort => LC_ALL=C sort -07-01-01 C+probe: LC_ALL=C -06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local! -06-11-23 package.sh: *.md5 are not tarballs -- doh -06-11-23 iffe.sh: add -F, --features=feature-test-header -06-11-11 make.probe: favor lib64 over lib for hosttype==*64 -06-10-31 make.probe: add "-ignore-source-dir -iquote" test -06-10-31 iffe.sh: add status{...} code block -06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?) -06-10-11 package.sh: handle already gunzip'd *.tgz -06-10-06 iffe.sh: add reference for header content tests -06-09-27 regress.sh: fix UMASK to do DO too (duh) -06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics) -06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together -06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too -06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io -06-09-05 C+probe: add { probe_version version_stamp version_string } -06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING] -06-08-27 regress.sh,mktest.sh: add UMASK -06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE -06-08-25 mktest.sh: add IGNORESPACE -06-08-24 mktest.sh: handle \000 in data -06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR -06-08-16 package.sh: fix 'install flat' logic -06-08-11 rt.sh: handle style=shell %K date format -06-07-17 ratz.c: fix __MVS__ FAR definition -06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe -06-07-17 package.sh: differentiate urls vs. assignments -06-06-27 rt.sh: add --failed, --heading -06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0' -06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance -06-06-25 mktest.sh: implement PROG -06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk -06-05-06 package.sh: add PACKAGE_admin_tail_timeout -06-05-22 ratz.c: upgrade to zlib-1.2.3 -06-05-09 package.sh: fix admin.db docs -06-03-11 package.sh: fix `package use - command ...' -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 -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 - package.sh: add more pdksh => /bin/sh checks -06-01-26 package.sh: wget --http-pass => --http-password - package.sh: fix wget error logic - 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 -05-12-07 iffe.sh: don't emit if | (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 ] -05-09-21 mktest.sh: fix --style=shell compare to ignore \r -05-09-12 TEST.mk: all --force to force %.rt regeneration -05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst -05-08-25 mktest.sh: add - TEST.mk: add %.rt=>%.tst for mktest -05-08-18 package.sh: 'package host cpu' now checks $NPROC first -05-07-17 iffe.sh: add { define extern include print } ops - iffe.sh: accept output{...}end output on success only -- doh -05-07-01 package.sh: add TARPROBE for tar B flag probe -05-06-24 package.sh: fix binary read chmod via *.sum -05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types -05-06-01 make.probe: verify that cc_pic works for hosted cc - cc.lynxos.ppc: make -mshared the default - package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation -05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT -05-05-24 iffe.sh: really fix grouping logic -- with tests this time - package.sh: pipe/socket configuration mismatches => use /bin/sh -05-04-28 TEST.mk: add $(TESTS) -05-04-19 package.sh: package results test uses rt if possible - 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 - 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 -05-04-01 rt.sh: add pretty make test + regress.sh wrapper -05-03-29 package.sh: test -e path => test -f path -o -d path -05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh -05-03-19 mamake.c: command line name=var also defines name.FORCE=var -05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd - package.sh: old make.out saved in circular make.out.[1-9] - mamake.c: sync with nmake :W=O: -05-03-01 package.sh: fix flat hierarchy initialization - 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 -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 -05-02-20 probe.win32: handle /platformsdk mount -05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir -05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 - -05-02-14 package.sh: handle multiple architectures per host in admin.db - Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides - package.sh: normalize trailing [-_]bits in host type - iffe.sh: some ksh-compatible shells don't do *(pattern) -05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack - cc.lynxos.i386: -dynamic instead of -static default -05-02-10 package.sh: cyg usr/doc => usr/share/doc -05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08 - iffe.sh: work around old bash 0<... redirection bug -05-02-06 package.mk: source.tgz: update generated files only when they change -05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow -05-01-11 package.sh: update setup docs to include authorize+password - package.mk: fix .source.cyg final directory edit - package.mk: notice=1 for conspicuous empty NOTICE file - WWW.mk: fix *-index.html installation - filter.sh: retain input file suffix in tmp copy - mamexec.c: fix non-contiguous "exec" bug that skipped lines - iffe.sh: fix candidate lib test to try grouping subsequent libs - iffe.sh: fix child process stdin hijack that skipped input lines - iffe.sh: --shell=osh to force read -r compatibility command - iffe.sh: chop iffe input leading space before # for KnR compatibility -05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes - mamake.c: fix makefile scan to ignore lib*.[hH] - iffe.sh: immunize function/symbol tests from aggressive -O -04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator -04-12-21 ratz.c: make sure tmp dir is writable -- doh -04-12-08 iffe.sh: fix dat test for aggressive -O -04-12-01 iffe.sh: add `include file' to pull in #define's for `exp' -04-11-11 package.sh: default MAKESKIP is "*[-.]*" -04-10-22 ratz.c: change docs to note zlib license - mamake.c: handle --debug-symbols and --strip-symbols - package.sh: make (debug|strip)=1 => --(debug|strip)-symbols - package.mk: add :LICENSE: => package.license.class - mamake.c: fix recursive order logic -04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs -04-10-11 package.sh: add 'authorize name' and 'password password' -04-10-01 iffe.sh: double check $static link with ! $static - Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths - make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL} - package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths -04-09-21 package.mk: $(init)$(name) is now an implicit prereq -04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok -04-09-01 package.mk,package.sh: rename *.txt => *.README - 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 - package.sh: add `checkaout proto' for { make view } - package.sh: check for { md5sum md5 } - iffe.sh: add {if|elif|else|endif} test ... - iffe.sh: add 'exp - expression' and '( expression )' - iffe.sh: add 'name = test ...' user defined macros - iffe.sh: add '! test ...' negation - TEST.mk: add implied { .c .sh } generated prereq - cc.darwin.ppc: handle 10.3 -dylib mess -04-08-01 package.mk: let include handle nested requirements -- duh -04-07-31 package.sh: attempt a second ping before admin assumes host down -04-07-26 package.sh: fix hp.ia64 HOSTTYPE -04-07-23 probe.win32: generalize #include dir order search -04-07-17 regress.sh: add INPUT -x for chmod +x -04-07-01 regress.sh: TMP => TWD -04-06-29 regress.sh: put COMMAND in $TWD too -04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs - TEST.mk: add :TEST: -- to disable .c .sh search -04-06-18 TEST.mk: add .SCAN.tst -04-06-17 regress.sh: TEST returns true if active, false otherwise - regress.sh: add CD to change test pwd from $TWD -04-06-16 regress.sh: add TWD for ./unit.tmp override - regress.sh: DO now flushes previous test - 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-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 -04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH -04-04-15 make.probe: check probe_libdir false positives - package.sh: add lib/package/*.lic src package subdirs - package.mk: add mamfile=0 to inhibit Mamfile generation - iffe.sh: config name_DECLARED => HAVE_name_DECL - iffe.sh: fix mac to handle default value -04-04-11 iffe.sh: normalize sed [\\\\/] quoting -04-04-04 package.mk: only checksum generated tarballs - mamprobe.sh: add STDCHMOD -04-04-01 C+probe: set export LANG=C for uniform error messages - make.probe: another CC.STDLIB tweak - package.sh: fix regress core dump pattern, expand [a-z] match ranges -04-03-31 Makefile: add intl :MAPLIB: test - make.probe: fix CC.STDLIB search; drop CC.* path duplicates -04-03-28 iffe.sh: drop unused exec $stdin<&0 dup -04-03-25 Makefile: add iconv :MAPLIB: - package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override -04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz) - package.sh: update base change on md5 sum instead of size - iffe.sh: adjust case label \ and keyword quoting for ancient /bin/sh -04-03-22 probe.win32: ncc => nld -04-03-19 CONVERT.mk: change the instructions and old source dir default - package.mk: fix recurse=list check - package.mk: add *.md5 checksum for each *.(c|exe|tgz) - package.sh: fix update base/delta/sync existence check -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: 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 - package.sh: fix admin write binary local vs. shared clash - cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable - cc.hp.pa64: sync with cc.hp.pa - cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib - probe.win32: sync with make.probe - make.probe: fix last chance dynamic test - make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E - make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall - make.probe: move probe_dll_def to the end of probe_dll - package.mk: capture subcomponent mamfile recursion -04-02-24 make.probe: strip "..." from cc/ld traces - iffe.sh: add ``set [no]define'' to disable macro #define/#undef -04-02-23 make.probe: rework CC.LD search -04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export - make.probe: resurrect CC.PIC with separate semantics from CC.DLL - make.probe: add CC.SHARED.LD for CC.SHARED linker - C+probe: clear DISPLAY to stifle interactive windows -04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end - make.probe: add { CC.AR CC.SIZE }, fix cross command search - cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug -04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++ -04-02-04 package.sh: fix cross compilation bug that mixed binary formats -04-02-02 package.sh: package admin now ditto's bin/package too -04-01-30 cc.sgi.mips3: drop warning 3421 -04-01-11 regress.sh: output label#count for tests in loops -04-01-05 regress.sh: fix bug that ignored the first SAME -04-01-04 crossexec.sh: fix typo that did not recognize rcp -03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse() -03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency -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: 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 -03-06-21 package.sh: fix INITROOT initialization bug - package.sh: make sure admin logs exists before tail'ing -03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make - cc.mvs.390: return code 4 yields exit code 3 but it's *really* ok - package.sh: fix onpath function global var conflict - make.probe: add CC.DIALECT { GNU -dD } - package.mk: add Mamfile to lcl manifest -03-06-10 package.sh: fix setup action typo that only checked the INIT package - package.sh: *.s390x => *.s390-64 -03-06-09 package.mk: add cyg :POSTINSTALL: -03-06-08 make.probe: fix CC.STDLIB logic - hurl.sh: add User-Agent identification - package.sh: tweak source and binary installation instructions - cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths - ldd.hp.pa: add -03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check - make.probe: add CC.STDLIB verification -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-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile -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.* -03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh -03-04-23 package.mk: fix dup "covered by" licenses -03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's - package.sh: fix admin write binary tarball snarf -03-04-21 package.mk: package covered *.@(pkg|lic) too -03-04-15 package.mk: don't generate incremental archives for lcl - package.mk: add incremental=[source:1 binary:0] archive control - package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc - package.sh: admin must ditto lib/package/*.@(pkg|lic) too - mamake.c: ignore time of ignore prereqs - mamake.c: -D2 lists propagated times -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: use `make believe' to accept mamake generated files - package.sh: handle `make [make-flags] [target ...]' - mamake.c: ignore -e -03-03-21 package.mk: fix cyg old make typo - 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 - 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 - 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 - package.sh: fix packageroot() typo that showed up in non ~user shells - 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 - 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 -03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb" -03-02-12 Makefile: handle getconf LIBPATH with host pattern -03-01-31 package.mk: fix .lic search -03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere - package.sh: admin handles command outside of $PACKAGEROOT/bin - Makefile: install $(INSTALLROOT)/lib/make/package.mk -03-01-28 package.sh: admin remote commands on one line to please syslog -03-01-23 probe.win32: borland and mingw32 tweaks -03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh -03-01-16 ditto.sh: tw --chop on by default -03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/ - package.sh: admin now initiates remote exec and copy from local host -03-01-12 package.sh: handle admin "xxx:" default root -03-01-03 probe.win32: add /usr/include/borland path truncation workaround -02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc -02-12-06 probe.win32: fix inlcude => include typo, add lcc lib - probe.win32: CC.MAKE.OPTIONS = nativepp=0 -02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined -02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks -02-11-26 package.sh: package release now checks for second level files -02-11-22 package.sh: update action now uses HTTP/1.0 -02-11-21 probe.win32: update the vc include dir test -02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var -02-11-13 packahe.mk: fix list.install => list.installed typo -02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search - 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() - 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 -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 - package.sh: $CC must at least compile and executable hello world -02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz - package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS) - iffe.sh: add identifier checks for tests that (implicitly) require them - iffe.sh: disambiguate a few --config macros -02-10-02 iffe.sh: fix shell=bsh `hdr a/b' -02-09-30 package.sh: handle chmod of -* files - package.sh: verify that $SHELL is Bourne compatible - package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation - 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" - 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 - mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end - mamake.c: pass cc absolute path to mamprobe - package.sh: generate mamprobe -- yuk (at least it's confined to INIT) - iffe.sh: lcl,nxt: drop default sys/ check - ditto.sh: tw --logical by default; add --physical -02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey -02-09-09 ditto.sh: test that remote .profile exists before sourcing -02-09-06 package.sh: don't ditto nfs junk - ditto.sh: --show now lists directory ops instead of enumerating all -02-09-05 ditto.sh: add --remote={rsh|ssh} - package.sh: add admin [[{rsh|ssh|-}]:]directory -02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility -02-09-01 cc.unix.mc68k: add for ancient 3b1 -02-08-22 package.sh: fix component() to test for components -- duh - 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 - 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 -02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc -02-06-14 package.sh: fix admin_action to not include qualifiers - package.sh: fix help/html doc typo -02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*' -02-06-07 WWW.mk: change substitute $("\n") to \n -02-06-06 package.sh: clarify output streams for help/html -02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH) -02-04-04 package.sh: fix update to differentiate *.sun4 and sun4 -02-03-27 package.sh: yacc/bison warning only if both missing -02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems -02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package - package.sh: precheck $CC, not `cc' - package.sh: fix install to use pax -ps to preserve set-uid/gid - package.sh: fix install to use list.installed for existing files only -02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read - package.sh: fix update delta sync fetch -02-02-14 iffe.sh: fix macro{ }end docs to include " - iffe.sh: add dfn to extract #define from headers - iffe.sh: handle nxt #include ok but no line sync - iffe.sh: drop local header clash logic - iffe.sh: add -X, --exclude=dir to exclude -I dirs - iffe.sh: lcl,nxt now generate <...> headers instead of "..." - package.sh: admin.db root dir matching -* disables host - package.mk: fix package.src.pat typo -- too many ) - 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 - 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 - package.sh: fix `host type' bug that incorrectly assumed sun4 for sol - package.sh: add execrate(1) hooks for challenged systems - 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 -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 - package.sh: uts.370 => uts.390 -02-01-18 package.sh: fix uts hosttype -02-01-17 package.sh: add 'results failed ...' to list failures only - package.sh: change ARCH internal var to all_types to avoid env conflict - iffe.sh: fix hdr/lib precheck that missed some -- ouch - iffe.sh: fix noexecute test that forgot to check compile first! -02-01-15 ratz.c: fix path[] type typo -02-01-01 package.mk: tighten license search -02-01-08 package.sh: `pwd` => ${PWD:-`pwd`} - package.mk: expand license file pattern match -02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value" - iffe.sh: fix initial check to honor --config -01-12-25 iffe.sh: fix bug where -o file restored old file -01-12-23 package.mk: uniq the closure lists -01-12-07 ratz.c: fix --meter to retain paths containing " -- " -01-11-30 ratz.c: use sear_system() to execute; should work on all windows -01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status -01-11-26 ditto.sh: drop n+=v for ksh compatibility -01-11-21 ditto.sh: add rsync script replacement [hey, it works!] - package.sh: add [ditto]:directory notation to admin.db -01-10-31 package.sh: handle *.sum paths with embedded space - package.sh: change executable() to onpath() - package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack) - package.sh: add os2 fix to `host type' - mamake.c: add .exe hack - iffe.sh: fix intrinsic function lib test - mamprobe.sh: update pic probe to match make.probe for linux.ia64 -01-10-30 package.sh: make action skeleton view now checks subdirs -01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP - package.mk: tarball package.notice replaces `license accepted' prompt - package.sh: eliminate `license accepted' prompt - package.sh: add update to download latest from a url - package.sh: use builtin arithmetic when we know it's ksh - iffe.sh: unkown -> unknown -01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN - package.mk: convert to YYYY-MM-DD delta releases instead of NNNN - ratz.c: fix -m for paths containing \f\n\r\v -01-10-16 ratz.c: _SEA_* => SEAR_* - ratz.c: preserve stdin for sear_exec() - ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup -01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC - package.sh: add nfs wakeup call to admin to avoid stale file handles -01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh) -01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH - package read: save cpy of bin/package when reading the INIT package - mamprobe.sh: allow cc path with optional arguments -01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization -01-09-19 package.mk: add recurse to list.package.* - package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32 -01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives -01-09-07 package.mk: fix output capture to not generate files names with spaces -01-09-07 package.mk: fix delta release number search -01-08-11 package.mk: handle single gz executable packages (e.g., for ksh) - package.sh: fix package install to require nmake only if no *.sum - iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash -01-07-17 package: fix use cross compile test to generate files in /tmp -01-06-27 ratz: handle hard and soft links if possible -01-06-07 Makefile: fix :MAPLIB: for sco -01-05-31 crossexec.sh: add - iffe.sh: add -x crosstype to run crossexec - iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end - package.sh: add package host canon external-host-type-name - package.sh: fix `use USER' lookup for shells that support ~USER - cc.*: add -dumpmachine to dump target HOSTTYPE -01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops -01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command -01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes - iffe.sh: fix run *.sh for shells that don't $* across . command - cc.mvs.390: recode for /bin/sh -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-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 - 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 and -01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op -01-02-22 cc.ibm.risc: handle SF_CLOSE clash in -01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc - C+probe: quote "$cc" when it's an argument! - mamake: execute actions with $SHELL, ignored signals back to default - package.sh: nmake check error output to /dev/null - 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! - mamake: handle `bind -lx [dontcare]' -01-02-12 ratz.c: fix _PACKAGE_ast includes - package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/ - package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE - iffe.sh: fix dat code that used previous $tmp.exe - iffe.sh: fix dat code for _DLL imports -01-02-09 iffe.sh: add copy() for shells with the disappearing here doc bug -01-02-08 Makefile: guard against null $(CC.HOSTTYPE) -01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged) -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 - 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 - 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 -00-12-25 package.sh: `no package archives' is a hard error, duh - package.sh: reorder host type logic for lame shells - mamake.c: getcwd => getwd for NeXT -- how about posix==default guys - iffe.sh: really gross workaround for NeXT -lposix stdout null's - iffe.sh: handle cc -E that insists on compiling -00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0 - *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh - package.sh: fix LD_LIBRARY*_PATH initialization - cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms -00-12-12 ratz: add --meter - package.sh: a few VPATH fixes - Makefile: don't override *.mips* cc if -version not accepted -00-12-11 package.mk: *.inx now contains name=value -00-12-07 package.sh: handle PC netscape . => _ pathname mangle - WWW.mk: .tar.gz => .tgz -00-11-27 package.sh: add checklicense() to do license checks at read time - package.mk: change component list from preformat to table -00-10-31 package.mk: *.pkg must assert closure - package.mk: add cc- variants to list.package.binary - package.sh: omit dups from package list - package.sh: invalid arg gives one line Usage - package.sh: relax checkaout checks for non-owners - package.sh: package use sets NPROC if not already set or [01] - proto.c: add $(INSTALLROOT)/include/ast hack -00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE: -00-10-25 package: fix install - package.mk: add list.install -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 - package: add DYLD_LIBRARY_PATH initialization - add ldd.$(CC.HOSTTYPE) -00-10-01 iffe: handle -I* -L* options -00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs -00-09-19 C+probe: add probe_longlong -00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake -00-09-08 iffe: verify that $cc is a C compiler -00-06-14 mamprobe: fix win32.* probe - mamake: fix bug that used lower view path for generation - package: don't clobber $PACKAGEROOT/bin/nmake -00-06-01 C+probe: fix stdinclude *again* - package: fix write delta source to use default pax format - package: add disambiguating bias for sgi.mips3 over sgi.mips4 - package.mk: fix for directory content packages lib ast-locale -00-05-01 iffe: fix invalid _LIB_ macro identifier -00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude -00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected -00-03-17 package: all archives are .tgz for binary download - package: $(PACKAGEROOT)/LICENSES/* in source and binary archives - package: implement install and verify actions - iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb - iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk - package.mk: add *.pkg :INDEX: -00-03-07 package: add admin action -00-03-06 makefile: install optional make probe override script C+make+probe.lcl -00-02-14 --- release 1.0 --- - ratz: treat "foo/" as a dir, not a regular file - package: clarify source and binary installation instructions - package: fix so binary packages can install without cc - package: "ratz" now a non-archive package (the only one) for bootstrap - package: handle VPATH=a:b arg - package.mk: "ratz" package adjustments - Makefile: use :PACKAGE_INIT: to support binary INIT packages - WWW.mk: add :WWWALL: - C.probe: fix .so check that let .dll slip through - iffe: fix config sh var assignment for HAVE_member_IN_struct - iffe: fix config sh var assignment for symbol_DECLARED - package: delay PATH export until dll hack exports complete - package: don't forget binary package $(INSTALLROOT)/lib(32|64) - package: add delta change log for source packages -00-02-10 mamprobe: add mam_cc_DLLBIG - package: fix spelling typos - package: add html help output - 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: copy *.lic to $PACKAGEBIN for "make" and "write binary" - package: fix 'release change log' case match -00-01-24 package: add copyright action - mamprobe: add -D_BLD_DLL to mam_cc_DLL -00-01-11 package: tsort for package write - package: early verification that $CC works - package: add non-interactive command arg for use action - proto: fix -C intermediate mkdir() - mamprobe: unixware.i386 ksh workaround - C.probe: move hosttype to C.probe (with unixware.i386 workaround) - WWW.mk: fix mm2html option quoting - WWW.mk: add .SCAN.mm - WWW.mk: don't force static=1; grab dll's instead - *.sh: fix getopts test to handle botched implementations like osf.alpha - iffe.sh: fix read -r test -99-12-25 iffe: tweak verbose messages - iffe: hand code non-optget getopts parse - iffe: fix bash quoting bug again - iffe: do test -w . after option parse - package: fix PACKAGEROOT search -99-11-19 --- release 0.2 --- -99-11-19 first working package & friends -99-10-31 change from lib0ast to INIT; add MAM and package bootstrap - hostinfo: gobbled by package -99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround -99-09-27 iffe: add --all --verbose, --* set options -99-09-22 regress: -v disables long line truncation -99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME) -99-08-11 hostinfo: fix type sgi.mips4 -99-06-24 WWW.mk: add -99-06-08 hostinfo.sh: ${TMPDIR:-/tmp} -99-06-07 TEST.mk: add -99-06-01 iffe: add `siz type' for _siz_type == sizeof(type) -99-05-11 hostinfo,iffe,regress,use: long options -99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine -99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks - iffe: check that . is writable -99-03-17 hostinfo: fix for cc not found - dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE - C.probe: extra check for include dirs pulled in by -99-03-03 regress: add `UNIT - ...' for extra args - Makefile: add (_hosttype_) prereq for cc -99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there -99-01-11 C.probe: shlib before lib, /usr before / -98-12-25 iffe: work around win32.alpha intrinsic clash with -O -98-11-11 regress: fix UNIT PATH lookup -98-11-01 regress: add PROG -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 -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 -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 - iffe: `mem x' to test if x is a non-opaque struct -98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3 - $(INSTALLROOT)/lib64 for sgi.mips4 - add cc.hp.pa -98-01-01 cc.sgi.mips*: turn off ld library multiply defined -97-10-11 regress: add VIEW function for locating data -97-10-01 Makefile: -ldl test moved to libdll Makefile -97-08-11 regress: add MOVE - regress: add SAME - regress: use getopts - regress: `EXEC' repeats previous test -97-07-17 use: tweak PATH and LIBPATH bootstrap order - iffe: fix lcl bug that botched pathnames with embedded spaces -97-06-12 iffe: add npt `needs prototype' test -97-05-09 hostinfo: mvs.* => mvs.390 - Makefile: cc.$(_hosttype_) workaround installed here - iffe: fix nolink{ ... }end - iffe: add [no]static{ ... }end for static link test - C.probe: _probe_PATH => _probe_export which must be eval'd -97-04-01 use: _RLD_ROOT set too -97-03-17 mm2html: changed inner loop - mm2html: handle .if|.ie|.el, .so - mm2html: handle different man styles - 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 - 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 - use: add sgi.mips LD_LIBRARY_PATH variants - use: add -e to list exports - 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 - C.probe: check gcc style -v -E for stdinclude usrinclude -96-11-28 iffe: check BASH_VERSION for IFS botch - iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx) - hostinfo: fix sgi.mips[234] tests - 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 -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-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 - mm2html: add - C.probe: probe_members += -whole-archive for gcc - iffe: add + fix the blasted `...'...\\...'...` -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-10-11 hostinfo: no args prints type -95-08-11 use: add -95-05-09 save original PATH in _probe_PATH - beef up library dir probe -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 - fix C.probe to properly handle C/C++ combined compiler drivers - add NeXT to hostinfo - bummer: mach has /usr/bin/hostinfo -95-03-19 fix dialect executable test -95-03-19 --- release 0.0 --- diff --git a/cde/programs/dtksh/ksh93/lib/package/INIT.html b/cde/programs/dtksh/ksh93/lib/package/INIT.html deleted file mode 100644 index 5a15f3b58..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/INIT.html +++ /dev/null @@ -1,1007 +0,0 @@ - - - - - - - INIT package - - - - - -
    - -

    -

    INIT package

    -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. -Components in this package: -

    -

    - - - -
    -INIT
    -

    -The software is covered by this license: -

    -Individual components may be covered by separate licenses; -refer to the component source and/or binaries for more information. -

    -A recent -release change log -is also included. -

    -


    release change log

    -
    -
    -All recorded changes follow.
    -
    -
    -

    -


    INIT changes

    -
    -
    -12-07-17 iffe.sh: add C code NOTE("...") to amend --verbose output
    -12-06-26 iffe.sh: fix "npt foo" to handle function-like macro foo()
    -12-06-20 package.sh: use $KSH for rt in "results test"
    -12-06-15 Makefile: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
    -12-06-15 package.sh: add PLUGIN_LIB to $INSTALLROOT/bin/.paths and BUILTIN_LIB => PLUGIN_LIB
    -12-06-13 package.sh: handle admin.db column output
    -12-06-08 iffe.sh: fix 12-06-06 typo
    -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-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''
    -12-04-17 cc.ibm.risc*: _LARGEFILE64_SOURCE => _LARGE_FILE_API moved to libast/features
    -12-04-09 cc.ibm.risc*: speak aixese for _LARGEFILE64_SOURCE
    -12-02-29 cc.darwin.i386*: handle default cc vs kernel bittedness
    -12-02-29 C+probe: add __TIMESTAMP__ to the nopredefined list
    -12-02-29 package.sh: don't assume grep -q or /usr/local/lib in LD_LIBRARY_PATH
    -12-02-29 package.sh: fix ksh vs -lcmd compatibility checks
    -12-02-23 iffe.sh: checkcc() before checkread() for sensible diagnostics
    -12-02-14 package.mk: { --clobber --compare --link=lib*.a* } for --mam=static
    -12-02-14 package.mk: export LICENSEFILEDEFAULT instead of LICENSEFILE
    -12-02-14 package.sh: handle @(cc|ld).${HOSTTYPE}* intercepts
    -12-02-07 package.sh: add { clean clobber } actions
    -12-02-02 regress.sh: fix ulimit -c defaults for --nokeep
    -12-01-18 regress.sh: add INPUT|OUTPUT|ERROR -e 'filter' to filter before comparison
    -12-01-21 package.sh: fix `admin make' bug that created unused $INSTALLROOT/lib
    -12-01-21 Makefile: :PACKAGE: license=ast -- oops
    -12-01-20 cc.darwin,cc.mvs.390: tmp=/tmp/cc.${USER:-$LOGNAME}.$$.err
    -12-01-12 package.sh: add admin make share closure to handle alternate HOSTTYPEs
    -11-12-13 iffe.sh: add /*<NOSTDIO>*/ test code comment to disable default #include <stdio.h>
    -11-11-11 C+probe: test for .so before .sl
    -11-10-26 package.sh: don't forget about *.pkg for admin update
    -11-10-18 cc.*-icc: update and add more
    -11-10-11 package.sh: handle package make|view when no source installed
    -11-09-11 package.sh: count admin '*** termination code' errors
    -11-08-31 mamake.c: add -e, ignore use recursive prereq timestamps
    -11-08-29 iffe.sh: add ``set stdio try1.h - try2.h ...''
    -11-08-29 iffe.sh: trap EXIT => trap 0 for ancient sh
    -11-08-11 iffe.sh: handle ancient sort that doesn't have -k
    -11-06-01 make.probe: add more /lib64 logic
    -11-05-01 package.sh: fix admin ditto to sync LICENSES too
    -11-03-25 package.sh: initialize { $SED $TR } before first use!
    -11-03-21 package.sh: fix vpath probes
    -11-03-17 iffe.sh: fix cleanup to rm $tmp* instead of $tmp*.*
    -11-02-24 package.sh: change curl usage to "curl -L ..."
    -11-02-11 package.sh,C+probe,make.probe,mamprobe.sh: add ###.*archaic.*###
    -11-02-02 Makefile: add :MAPLIB: check for ancient -lw
    -11-02-02 make.probe: handle -print-multi-directory => 64 => /usr/lib64 /lib64
    -11-02-02 package.sh: HOSTTYPE=*,*cc*[,-*,...] sets CC [ and CCFLAGS ]
    -11-02-02 make.probe: handle gcc $ORIGIN link but exec failure -- gee thanks
    -11-01-25 cc.hp.ia64: bundled cc is a pile of shaving cream
    -11-01-07 iffe.sh: check debug==3 for is_hdr() failure
    -10-11-22 ditto.sh: fix timing problem between |& and exec &p
    -10-11-10 package.sh: fix cc cross compile check to use checkcc absolute path
    -10-10-10 package.sh: list main env vars at start of make action
    -10-10-10 ratz.c: tweak windows delays
    -10-09-10 ratz.c: add _SEAR_ARGS for _SEAR_EXEC
    -10-09-01 package.sh: fix ratz from source logic
    -10-08-25 package.mk: consolidate license file search in .package.licenses.
    -10-08-22 ratz.c: run sear bootstrap command detached
    -10-08-20 C+probe: version_stamp only if version_flags works
    -10-08-17 package.sh: unset makerules *DIR variables in env
    -10-08-15 package.sh: "make" action now lists some env values
    -10-08-11 mktest.sh: add "DO command ..."
    -10-07-27 rt.sh: handle "rt X=Y ..."
    -10-06-29 ratz.c: non-option sear args passed to sear_exec()
    -10-06-25 iffe.sh: "api" op changed to not do "map-libc" type mappings
    -10-06-25 package.sh: "force admin ditto" => no ditto --update option
    -10-06-22 C+probe: handle cc that require .[ci] input for version info
    -10-06-21 ditto.sh: change default remote access to ssh (about time)
    -10-06-12 regress.sh: DIAGNOSTICS [ 1 | 0 | pattern ] and fix EXIT for all
    -10-06-09 package.sh: add AT&T to usable nmake check
    -10-06-06 iffe.sh,iffe.tst: add { api ver } ops
    -10-04-22 package.sh: update "html binary|source" NAME/PASSWORD info
    -10-04-15 iffe.sh: don't forget candidate headers for hdr|sys!
    -10-04-11 WWW.mk: disable man page metarule -- now done by admin-man(1)
    -10-02-14 package.sh: $CC verification needs $INSTALLROOT/bin in PATH
    -10-02-11 package.sh: fix package admin make report error count
    -10-02-02 package.sh: fix write binary bug that did scp on local fs
    -10-02-02 package.mk: up to date binary targets must still be in PACKAGE.*.lst
    -10-01-01 package.sh: fix premature $INSTALLROOT/bin during cross compile check
    -10-01-01 make.probe: handle ['"] in CC.VERSION.STRING
    -09-12-04 iffe.sh: add "opt name" to check for name in $PACKAGE_OPTIONS
    -09-11-30 mktest.sh: change RESET to STATE.RESET to make it global
    -09-11-14 make.probe: use gcc { -print-multi-directory -print-search-dirs }
    -09-11-11 package.sh: re-order and combine cc checks
    -09-10-27 C+probe,make.probe,probe.win32: add CC.SUFFIX.DEBUG
    -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-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 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
    -09-05-05 package.sh: handle non-identifier hostnames
    -09-05-05 mamake.c: pass undefined ${...} identifiers to the shell
    -09-05-05 mamake.rt: add macro expansion regression tests
    -09-05-01 iffe.sh: fix output initialization *again*
    -09-04-28 package.sh: handle admin.db contact field $9
    -09-04-15 iffe.sh: add implicit "ini" op to initialize io for subsequent ops
    -09-03-31 regress.sh: EXPORT before test => global ENVIRON[]
    -09-03-26 package.sh: test fail pattern is 'fail[es]'
    -09-03-26 UNIT - ... appends (options) to command line
    -09-03-19 TEST.mk: x.tst => x only if x is command target
    -09-03-15 regress.sh: add ${MAIN} for base name of main unit
    -09-03-10 TEST.mk: add .SOURCE:tests if tests is a dir
    -09-03-03 regress.sh: allow command line unit to override UNIT
    -09-03-03 mktest.sh: handle IO == $'
    -09-02-02 package.sh: delay $INSTALLROOT/bin/.paths generation until mamprobe runs
    -09-01-30 cc.mvs.390: c89 balks at [ ()] in -Dname="..."!
    -09-01-27 package.sh: add isascii() to use ratz instead of tar
    -09-01-20 hurl.sh: add --size=bytes option
    -09-01-08 TEST.mk: add test.* prereqs, multiple arg lists with :T=*: binding
    -09-01-03 regress.sh: fix UNIT to allow command line override
    -09-01-03 mktest.sh: handle TWD
    -08-12-24 package.sh: fix cross-compile HOSTTYPE logic
    -08-12-15 package.sh,hurl.sh: handle http codes { 301 302 303 }
    -08-10-16 make.probe '-fno-stack-protector -fno-stack-protector-all' to cop out!!
    -08-09-30 rt.sh: fix ksh93 regression test signal count
    -08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input
    -08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo
    -08-09-20 make.probe: handle another /usr/bin/file shared lib description
    -08-09-20 regress.sh: add --pipefail for SET pipe-input ...
    -08-09-17 Makefile: add gdbm1.c for <gdbm-ndbm.h>
    -08-09-10 make.probe: add CC.NOPROTECT
    -08-08-08 mktest.sh: add --width=width
    -08-08-05 dbm.req: favor sleepycat ndbm compatibility
    -08-08-04 C+probe: fix stdlib initialization logic
    -08-06-24 package.sh: fix $INSTALLROOT/bin/cc intercept time stamp file typo
    -08-06-20 TEST.mk: make the localyunit before *.rt => *.tst -- doh
    -08-06-20 mktest.sh: prepend $PWD onto PATH for local units -- doh^2
    -08-06-11 regress.sh: fix bug that skipped the last test
    -08-05-20 regress.sh: add --local to put *.tmp dir in local fs
    -08-05-05 regress.sh: add IF command ... ELIF command ... ELSE ... FI
    -08-05-01 package.sh: package test => ulimit -c 0
    -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-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
    -08-02-28 make.probe: fix probe_warn to include ld!
    -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-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
    -07-12-03 package.sh: add LC_ALL=C
    -07-11-27 package.sh: fix overaggressive *.md5 cleanup
    -07-11-20 iffe.sh: treat exit status >= 250 as normal error with no signal
    -07-11-05 package.sh: fix write op error count pattern
    -07-11-05 package.mk: fix $(~req) .ver binding
    -07-08-11 probe.win32: add cl.exe setuid workaround, CC.VERSION[.STRING]
    -07-08-01 package.sh: handle 'package read lcl|tgz'
    -07-05-08 regress.sh: execute basename instead of absolute path for short $0
    -07-04-27 cc.sgi.mips[34]: for #error to exit non-zero -- a no brainer
    -07-04-20 mktest.sh: defer to systems without 'grep -q' -- sigh
    -07-04-11 mamprobe.sh: handle $(CC.*) => ${mam_cc_*}, $(...) => ${...}
    -07-04-11 make.probe: fix CC.PICBIG probe, default { CC.PIC CC.DLL } to BIG
    -07-04-04 iffe.sh: prepend ${tst}${ext} to each .c probe
    -07-03-28 package.sh: fix binary tgz architecture type duplication
    -07-03-28 package.mk: add binary write PACKAGE.$HOSTTYPE.lst
    -07-03-28 iffe.sh: add -F header to mac test
    -07-03-23 make.probe: handle file(1) that returns 'archive' for .so
    -07-03-22 mamprobe.sh: fix STDED probe for implementations that ignore EOF
    -07-03-11 package.sh: add nocopyright and tst => nocopyright
    -07-03-11 package.mk: add copyright=0
    -07-03-08 C+probe: restore IFS after probe.ini
    -07-02-26 mamake.c: expand first of ${mam_lib*} for ${AR}
    -07-01-05 package.sh: fix "admin write binary" logic
    -07-01-01 iffe.sh: add "cmd" --verbose trace
    -07-01-01 iffe.sh: sort => LC_ALL=C sort
    -07-01-01 C+probe: LC_ALL=C
    -06-12-22 make.probe: lean on gcc -v for stdlib, but preserve /usr/local!
    -06-11-23 package.sh: *.md5 are not tarballs -- doh
    -06-11-23 iffe.sh: add -F, --features=feature-test-header
    -06-11-11 make.probe: favor lib64 over lib for hosttype==*64
    -06-10-31 make.probe: add "-ignore-source-dir -iquote" test
    -06-10-31 iffe.sh: add status{...} code block
    -06-10-11 regress.sh: fix DO to handle {...} (time for regress.tst?)
    -06-10-11 package.sh: handle already gunzip'd *.tgz
    -06-10-06 iffe.sh: add reference for header content tests
    -06-09-27 regress.sh: fix UMASK to do DO too (duh)
    -06-09-22 iffe.sh: drop -O for npt tests (for msvc intrinsics)
    -06-09-14 cc.darwin: drop -O until gcc 4.* gets its act together
    -06-09-11 package.sh: { cc ld ldd } intercepts check ${HOSTTYPE%.*} too
    -06-09-08 regress.sh: add PIPE INPUT|OUTPUT for pipe io
    -06-09-05 C+probe: add { probe_version version_stamp version_string }
    -06-09-05 make.probe: add version stamp comment, CC.VERSION[.STRING]
    -06-08-27 regress.sh,mktest.sh: add UMASK
    -06-08-25 regress.sh: add -b,--ignore-space,IGNORESPACE
    -06-08-25 mktest.sh: add IGNORESPACE
    -06-08-24 mktest.sh: handle  00 in data
    -06-08-24 regress.sh: handle -f* for INPUT|OUTPUT|ERROR
    -06-08-16 package.sh: fix 'install flat' logic
    -06-08-11 rt.sh: handle style=shell %K date format
    -06-07-17 ratz.c: fix __MVS__ FAR definition
    -06-07-17 iffe.sh: "header x.h" -- deprecate "include x.h" for .SCAN.iffe
    -06-07-17 package.sh: differentiate urls vs. assignments
    -06-06-27 rt.sh: add --failed, --heading
    -06-06-27 C+probe,TEST.mk,make.probe,mktest.sh,regress.sh: 'ulimit -c 0'
    -06-06-26 cc.darwin.ppc: handle -lcc_dynamic disappearance
    -06-06-25 mktest.sh: implement PROG
    -06-06-11 Makefile: add -ldbm :MAPLIB:, provide public MAPLIB.mk
    -06-05-06 package.sh: add PACKAGE_admin_tail_timeout
    -06-05-22 ratz.c: upgrade to zlib-1.2.3
    -06-05-09 package.sh: fix admin.db docs
    -06-03-11 package.sh: fix `package use - command ...'
    -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
    -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
    -	 package.sh: add more pdksh => /bin/sh checks
    -06-01-26 package.sh: wget --http-pass => --http-password
    -	 package.sh: fix wget error logic
    -	 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
    -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 ]
    -05-09-21 mktest.sh: fix --style=shell compare to ignore \r
    -05-09-12 TEST.mk: all --force to force %.rt regeneration
    -05-09-05 TEST.mk: regenerate from %.rt only if newer, :SAVE: %.tst
    -05-08-25 mktest.sh: add
    -	 TEST.mk: add %.rt=>%.tst for mktest
    -05-08-18 package.sh: 'package host cpu' now checks $NPROC first
    -05-07-17 iffe.sh: add { define extern include print } ops
    -	 iffe.sh: accept output{...}end output on success only -- doh
    -05-07-01 package.sh: add TARPROBE for tar B flag probe
    -05-06-24 package.sh: fix binary read chmod via *.sum
    -05-06-06 package.sh: fix KEEP_HOSTTYPE logic to handle synthesized types
    -05-06-01 make.probe: verify that cc_pic works for hosted cc
    -	 cc.lynxos.ppc: make -mshared the default
    -	 package.sh: note $INSTALLROOT/bin/@(cc|ld|ldd) installation
    -05-05-25 make.probe: add CC.INCLUDE.LOCAL instead of -I- in CC.DIALECT
    -05-05-24 iffe.sh: really fix grouping logic -- with tests this time
    -	 package.sh: pipe/socket configuration mismatches => use /bin/sh
    -05-04-28 TEST.mk: add $(TESTS)
    -05-04-19 package.sh: package results test uses rt if possible
    -	 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
    -	 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
    -05-04-01 rt.sh: add pretty make test + regress.sh wrapper
    -05-03-29 package.sh: test -e path => test -f path -o -d path
    -05-03-24 make.probe: fix CC.PICBIG probe to prefer -fPIC over -fpic -- doh
    -05-03-19 mamake.c: command line name=var also defines name.FORCE=var
    -05-03-11 regress.sh: unset LC_ALL when LC_* EXPORT'd
    -	 package.sh: old make.out saved in circular make.out.[1-9]
    -	 mamake.c: sync with nmake :W=O:
    -05-03-01 package.sh: fix flat hierarchy initialization
    -	 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
    -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
    -05-02-20 probe.win32: handle /platformsdk mount
    -05-02-19 package.sh,package.mk: add write tst for tgz in tst subdir
    -05-02-18 package.sh: accept cc -dumpmachine with 0 or 1 -
    -05-02-14 package.sh: handle multiple architectures per host in admin.db
    -	 Makefile,package.sh: honor $INSTALLROOT/bin/.paths overrides
    -	 package.sh: normalize trailing [-_]bits in host type
    -	 iffe.sh: some ksh-compatible shells don't do *(pattern)
    -05-02-11 iffe.sh: back out 05-01-11 child process stdin hijack
    -	 cc.lynxos.i386: -dynamic instead of -static default
    -05-02-10 package.sh: cyg usr/doc => usr/share/doc
    -05-02-08 package.sh: drop -m with pax -- delta bug fixed 2005-02-08
    -	 iffe.sh: work around old bash 0<... redirection bug
    -05-02-06 package.mk: source.tgz: update generated files only when they change
    -05-02-02 *.sh,*probe: IFS may be unset and { ash bsh } don't on startup -- wow
    -05-01-11 package.sh: update setup docs to include authorize+password
    -	 package.mk: fix .source.cyg final directory edit
    -	 package.mk: notice=1 for conspicuous empty NOTICE file
    -	 WWW.mk: fix *-index.html installation
    -	 filter.sh: retain input file suffix in tmp copy
    -	 mamexec.c: fix non-contiguous "exec" bug that skipped lines
    -	 iffe.sh: fix candidate lib test to try grouping subsequent libs
    -	 iffe.sh: fix child process stdin hijack that skipped input lines
    -	 iffe.sh: --shell=osh to force read -r compatibility command
    -	 iffe.sh: chop iffe input leading space before # for KnR compatibility
    -05-01-05 package.sh: add ${TAR} ${TARFLAGS} and tar B flag for pipes
    -	 mamake.c: fix makefile scan to ignore lib*.[hH]
    -	 iffe.sh: immunize function/symbol tests from aggressive -O
    -04-12-28 WWW.mk: add :WWWPAGE: faq.*.mm index generator
    -04-12-21 ratz.c: make sure tmp dir is writable -- doh
    -04-12-08 iffe.sh: fix dat test for aggressive -O
    -04-12-01 iffe.sh: add `include file' to pull in #define's for `exp'
    -04-11-11 package.sh: default MAKESKIP is "*[-.]*"
    -04-10-22 ratz.c: change docs to note zlib license
    -	 mamake.c: handle --debug-symbols and --strip-symbols
    -	 package.sh: make (debug|strip)=1 => --(debug|strip)-symbols
    -	 package.mk: add :LICENSE: => package.license.class
    -	 mamake.c: fix recursive order logic
    -04-10-18 package.mk: add :LICENSE:, :OMIT: to omit package subdirs
    -04-10-11 package.sh: add 'authorize name' and 'password password'
    -04-10-01 iffe.sh: double check $static link with ! $static
    -	 Makefile: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
    -	 make.probe: add CC.DIALECT EXPORT={ALL,REF,EXT,DLL}
    -	 package.sh: add BUILTIN_LIB to $INSTALLROOT/bin/.paths
    -04-09-21 package.mk: $(init)$(name) is now an implicit prereq
    -04-09-09 package.sh: copy makerules.mo to $INSTALLROOT/bin/ok
    -04-09-01 package.mk,package.sh: rename *.txt => *.README
    -	 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
    -	 package.sh: add `checkaout proto' for { make view }
    -	 package.sh: check for { md5sum md5 }
    -	 iffe.sh: add {if|elif|else|endif} test ...
    -	 iffe.sh: add 'exp - expression' and '( expression )'
    -	 iffe.sh: add 'name = test ...' user defined macros
    -	 iffe.sh: add '! test ...' negation
    -	 TEST.mk: add implied { .c .sh } generated prereq
    -	 cc.darwin.ppc: handle 10.3 -dylib mess
    -04-08-01 package.mk: let include handle nested requirements -- duh
    -04-07-31 package.sh: attempt a second ping before admin assumes host down
    -04-07-26 package.sh: fix hp.ia64 HOSTTYPE
    -04-07-23 probe.win32: generalize #include dir order search
    -04-07-17 regress.sh: add INPUT -x for chmod +x
    -04-07-01 regress.sh: TMP => TWD
    -04-06-29 regress.sh: put COMMAND in $TWD too
    -04-06-21 regress.sh: mkdir -p INPUT and OUTPUT intermediate dirs
    -	 TEST.mk: add :TEST: -- to disable .c .sh search
    -04-06-18 TEST.mk: add .SCAN.tst
    -04-06-17 regress.sh: TEST returns true if active, false otherwise
    -	 regress.sh: add CD to change test pwd from $TWD
    -04-06-16 regress.sh: add TWD for ./unit.tmp override
    -	 regress.sh: DO now flushes previous test
    -	 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-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
    -04-05-01 package.sh: $CC must be C, not C++; allow release command on $PATH
    -04-04-15 make.probe: check probe_libdir false positives
    -	 package.sh: add lib/package/*.lic src package subdirs
    -	 package.mk: add mamfile=0 to inhibit Mamfile generation
    -	 iffe.sh: config name_DECLARED => HAVE_name_DECL
    -	 iffe.sh: fix mac to handle default value
    -04-04-11 iffe.sh: normalize sed [\\\\/] quoting
    -04-04-04 package.mk: only checksum generated tarballs
    -	 mamprobe.sh: add STDCHMOD
    -04-04-01 C+probe: set export LANG=C for uniform error messages
    -	 make.probe: another CC.STDLIB tweak
    -	 package.sh: fix regress core dump pattern, expand [a-z] match ranges
    -04-03-31 Makefile: add intl :MAPLIB: test
    -	 make.probe: fix CC.STDLIB search; drop CC.* path duplicates
    -04-03-28 iffe.sh: drop unused exec $stdin<&0 dup
    -04-03-25 Makefile: add iconv :MAPLIB:
    -	 package.sh: use ${PING:-ping -c 1 -w 4}, allowing admin.db override
    -04-03-24 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
    -	 package.sh: update base change on md5 sum instead of size
    -	 iffe.sh: adjust case label  and keyword quoting for ancient /bin/sh
    -04-03-22 probe.win32: ncc => nld
    -04-03-19 CONVERT.mk: change the instructions and old source dir default
    -	 package.mk: fix recurse=list check
    -	 package.mk: add *.md5 checksum for each *.(c|exe|tgz)
    -	 package.sh: fix update base/delta/sync existence check
    -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: 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
    -	 package.sh: fix admin write binary local vs. shared clash
    -	 cc.hp.pa: add _AST_CC_hp_pa_DEFAULT=+DAportable
    -	 cc.hp.pa64: sync with cc.hp.pa
    -	 cc.ibm.risc: -bnolibpath => -blibpath:/usr/lib:/lib
    -	 probe.win32: sync with make.probe
    -	 make.probe: fix last chance dynamic test
    -	 make.probe: add hp.pa CC.EXPORT.DYNAMIC -Wl,-E
    -	 make.probe: add ibm.risc CC.EXPORT.DYNAMIC -bexpall
    -	 make.probe: move probe_dll_def to the end of probe_dll
    -	 package.mk: capture subcomponent mamfile recursion
    -04-02-24 make.probe: strip "..." from cc/ld traces
    -	 iffe.sh: add ``set [no]define'' to disable macro #define/#undef
    -04-02-23 make.probe: rework CC.LD search
    -04-02-14 make.probe: add CC.EXPORT.DYNAMIC for main dynamic sym export
    -	 make.probe: resurrect CC.PIC with separate semantics from CC.DLL
    -	 make.probe: add CC.SHARED.LD for CC.SHARED linker
    -	 C+probe: clear DISPLAY to stifle interactive windows
    -04-02-11 iffe.sh: handle ``siz void*'', add cross{ ... }end
    -	 make.probe: add { CC.AR CC.SIZE }, fix cross command search
    -	 cc.darwin.ppc: change $cc => $CC for old ksh + libast conf bug
    -04-02-09 make.probe: drop -nostartfiles from CC.SHARED for C++
    -04-02-04 package.sh: fix cross compilation bug that mixed binary formats
    -04-02-02 package.sh: package admin now ditto's bin/package too
    -04-01-30 cc.sgi.mips3: drop warning 3421
    -04-01-11 regress.sh: output label#count for tests in loops
    -04-01-05 regress.sh: fix bug that ignored the first SAME
    -04-01-04 crossexec.sh: fix typo that did not recognize rcp
    -03-12-19 mamake.c: add `foolib:foo:libfoo' to recurse()
    -03-10-11 regress.sh: add EXPORT, export COLUMNS=80 for message consistency
    -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: 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
    -03-06-21 package.sh: fix INITROOT initialization bug
    -	 package.sh: make sure admin logs exists before tail'ing
    -03-06-11 probe.win32: fix $(BINDIR) typo that expanded in sh instead of make
    -	 cc.mvs.390: return code 4 yields exit code 3 but it's *really* ok
    -	 package.sh: fix onpath function global var conflict
    -	 make.probe: add CC.DIALECT { GNU -dD }
    -	 package.mk: add Mamfile to lcl manifest
    -03-06-10 package.sh: fix setup action typo that only checked the INIT package
    -	 package.sh: *.s390x => *.s390-64
    -03-06-09 package.mk: add cyg :POSTINSTALL:
    -03-06-08 make.probe: fix CC.STDLIB logic
    -	 hurl.sh: add User-Agent identification
    -	 package.sh: tweak source and binary installation instructions
    -	 cc.hp.pa,ld.hp.pa: +-Wl,+cdp,${INSTALLROOT}/lib/: drops abs lib paths
    -	 ldd.hp.pa: add
    -03-06-06 package.sh: fix $INSTALLROOT/bin/ldd check
    -	 make.probe: add CC.STDLIB verification
    -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-04-30 package.sh: move (cc|ld|ldd).$HOSTTYPE updates from Makefile
    -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.*
    -03-04-25 mamprobe.sh: add args to `. $makeprobe' for ancient sh
    -03-04-23 package.mk: fix dup "covered by" licenses
    -03-04-22 probe.win32: CC.DIALECT += "LIBPP -I-" for all cc's
    -	 package.sh: fix admin write binary tarball snarf
    -03-04-21 package.mk: package covered *.@(pkg|lic) too
    -03-04-15 package.mk: don't generate incremental archives for lcl
    -	 package.mk: add incremental=[source:1 binary:0] archive control
    -	 package.sh: generate $INSTALLROOT/bin/cc wrapper for CC != cc
    -	 package.sh: admin must ditto lib/package/*.@(pkg|lic) too
    -	 mamake.c: ignore time of ignore prereqs
    -	 mamake.c: -D2 lists propagated times
    -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: use `make believe' to accept mamake generated files
    -	 package.sh: handle `make [make-flags] [target ...]'
    -	 mamake.c: ignore -e
    -03-03-21 package.mk: fix cyg old make typo
    -	 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
    -	 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
    -	 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
    -	 package.sh: fix packageroot() typo that showed up in non ~user shells
    -	 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
    -	 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
    -03-02-14 ratz.c: add _WIN32 setmode([01],O_BINARY) and fopen "rb"/"wb"
    -03-02-12 Makefile: handle getconf LIBPATH with host pattern
    -03-01-31 package.mk: fix .lic search
    -03-01-30 package.sh: handle { INIT ksh nmake } already installed elsewhere
    -	 package.sh: admin handles command outside of $PACKAGEROOT/bin
    -	 Makefile: install $(INSTALLROOT)/lib/make/package.mk
    -03-01-28 package.sh: admin remote commands on one line to please syslog
    -03-01-23 probe.win32: borland and mingw32 tweaks
    -03-01-22 package.sh: fix $CC test to ignore set -x trace -- duh
    -03-01-16 ditto.sh: tw --chop on by default
    -03-01-14 package.sh: use /bin/cp to copy previous binaries to bin/ok/
    -	 package.sh: admin now initiates remote exec and copy from local host
    -03-01-12 package.sh: handle admin "xxx:" default root
    -03-01-03 probe.win32: add /usr/include/borland path truncation workaround
    -02-12-10 iffe.sh: add <&$nullin >&$nullout to checkread() $cc
    -02-12-06 probe.win32: fix inlcude => include typo, add lcc lib
    -	 probe.win32: CC.MAKE.OPTIONS = nativepp=0
    -02-12-04 mamake.c: fix ${foo-bar} to expand foo if defined
    -02-11-28 probe.win32: add C++ and -I- CC.DIALECT checks
    -02-11-26 package.sh: package release now checks for second level files
    -02-11-22 package.sh: update action now uses HTTP/1.0
    -02-11-21 probe.win32: update the vc include dir test
    -02-11-20 make.probe: fix CC.LD.ORIGIN typo that expanded make var
    -02-11-13 packahe.mk: fix list.install => list.installed typo
    -02-11-12 make.probe: add CC.LD.ORIGIN for a.out origin dir relative dll search
    -	 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()
    -	 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
    -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
    -	 package.sh: $CC must at least compile and executable hello world
    -02-10-04 package.sh: $INSTALLROOT/lib/package/tgz=>$PACKAGEROOT/lib/package/tgz
    -	 package.mk: $(ED) => $(STDED), $(EDFLAGS) => $(STDEDFLAGS)
    -	 iffe.sh: add identifier checks for tests that (implicitly) require them
    -	 iffe.sh: disambiguate a few --config macros
    -02-10-02 iffe.sh: fix shell=bsh `hdr a/b'
    -02-09-30 package.sh: handle chmod of -* files
    -	 package.sh: verify that $SHELL is Bourne compatible
    -	 package.sh: tighten PACKAGE_USE logic PATH,LIBPATH,etc. validation
    -	 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"
    -	 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
    -	 mamprobe: generate from mamprobe.beg C.probe make.probe mamprobe.end
    -	 mamake.c: pass cc absolute path to mamprobe
    -	 package.sh: generate mamprobe -- yuk (at least it's confined to INIT)
    -	 iffe.sh: lcl,nxt: drop default sys/ check
    -	 ditto.sh: tw --logical by default; add --physical
    -02-09-10 package.sh: SHELLMAGIC creeps into package too -- duh and fooey
    -02-09-09 ditto.sh: test that remote .profile exists before sourcing
    -02-09-06 package.sh: don't ditto nfs junk
    -	 ditto.sh: --show now lists directory ops instead of enumerating all
    -02-09-05 ditto.sh: add --remote={rsh|ssh}
    -	 package.sh: add admin [[{rsh|ssh|-}]:]directory
    -02-09-02 iffe.sh: change 'print -r --' to 'print -r -' for ksh86 compatibility
    -02-09-01 cc.unix.mc68k: add for ancient 3b1
    -02-08-22 package.sh: fix component() to test for components -- duh
    -	 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
    -	 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
    -02-06-27 package.sh: catch sol*.sparc=>sol*.sun4 when CC=gcc
    -02-06-14 package.sh: fix admin_action to not include qualifiers
    -	 package.sh: fix help/html doc typo
    -02-06-11 package.sh: fix ditto update doc to `PACKAGEROOT field matching *:*'
    -02-06-07 WWW.mk: change substitute $(") to
    -02-06-06 package.sh: clarify output streams for help/html
    -02-05-22 mamake.c: fix executable file check to use (S_IXUSR|S_IXGRP|S_IXOTH)
    -02-04-04 package.sh: fix update to differentiate *.sun4 and sun4
    -02-03-27 package.sh: yacc/bison warning only if both missing
    -02-03-24 mamake.c: all shell actions wrapped with -c to avoid #! problems
    -02-03-23 package.sh: recover $PACKAGEROOT/bin/package if not in INIT package
    -	 package.sh: precheck $CC, not `cc'
    -	 package.sh: fix install to use pax -ps to preserve set-uid/gid
    -	 package.sh: fix install to use list.installed for existing files only
    -02-03-17 package.sh: fix PAX initialization that was sometimes omitted for read
    -	 package.sh: fix update delta sync fetch
    -02-02-14 iffe.sh: fix macro{ }end docs to include "
    -	 iffe.sh: add dfn to extract #define from headers
    -	 iffe.sh: handle nxt #include ok but no line sync
    -	 iffe.sh: drop local header clash logic
    -	 iffe.sh: add -X, --exclude=dir to exclude -I dirs
    -	 iffe.sh: lcl,nxt now generate <...> headers instead of "..."
    -	 package.sh: admin.db root dir matching -* disables host
    -	 package.mk: fix package.src.pat typo -- too many )
    -	 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
    -	 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
    -	 package.sh: fix `host type' bug that incorrectly assumed sun4 for sol
    -	 package.sh: add execrate(1) hooks for challenged systems
    -	 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
    -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
    -	 package.sh: uts.370 => uts.390
    -02-01-18 package.sh: fix uts hosttype
    -02-01-17 package.sh: add 'results failed ...' to list failures only
    -	 package.sh: change ARCH internal var to all_types to avoid env conflict
    -	 iffe.sh: fix hdr/lib precheck that missed some -- ouch
    -	 iffe.sh: fix noexecute test that forgot to check compile first!
    -02-01-15 ratz.c: fix path[] type typo
    -02-01-01 package.mk: tighten license search
    -02-01-08 package.sh: `pwd` => ${PWD:-`pwd`}
    -	 package.mk: expand license file pattern match
    -02-01-04 iffe.sh: fix `exp name "value"' bug that duped "value"
    -	 iffe.sh: fix initial <sys/types.h> check to honor --config
    -01-12-25 iffe.sh: fix bug where -o file restored old file
    -01-12-23 package.mk: uniq the closure lists
    -01-12-07 ratz.c: fix --meter to retain paths containing " -- "
    -01-11-30 ratz.c: use sear_system() to execute; should work on all windows
    -01-11-28 ratz.c: fix sear_rm_r() to check SetCurrentDirectory() status
    -01-11-26 ditto.sh: drop n+=v for ksh compatibility
    -01-11-21 ditto.sh: add rsync script replacement [hey, it works!]
    -	 package.sh: add [ditto]:directory notation to admin.db
    -01-10-31 package.sh: handle *.sum paths with embedded space
    -	 package.sh: change executable() to onpath()
    -	 package.sh: executable([!] foo) replaces test [!] -x foo (.exe hack)
    -	 package.sh: add os2 fix to `host type'
    -	 mamake.c: add .exe hack
    -	 iffe.sh: fix intrinsic function lib test
    -	 mamprobe.sh: update pic probe to match make.probe for linux.ia64
    -01-10-30 package.sh: make action skeleton view now checks subdirs
    -01-10-20 package.sh: don't recurse into leaf dirs matching $MAKESKIP
    -	 package.mk: tarball package.notice replaces `license accepted' prompt
    -	 package.sh: eliminate `license accepted' prompt
    -	 package.sh: add update to download latest from a url
    -	 package.sh: use builtin arithmetic when we know it's ksh
    -	 iffe.sh: unkown -> unknown
    -01-10-18 package.sh: convert to YYYY-MM-DD delta releases instead of NNNN
    -	 package.mk: convert to YYYY-MM-DD delta releases instead of NNNN
    -	 ratz.c: fix -m for paths containing <\>n\r\v
    -01-10-16 ratz.c: _SEA_* => SEAR_*
    -	 ratz.c: preserve stdin for sear_exec()
    -	 ratz.c: add recursive sear_rm_r() to sear_exec() tmp dir cleanup
    -01-10-10 mamprobe.sh: add mam_cc_SHELLMAGIC
    -	 package.sh: add nfs wakeup call to admin to avoid stale file handles
    -01-10-04 cc.darwin.ppc: -flat_namespace is not longer the default (huh)
    -01-10-01 package make: prepend $INSTALLROOT/bin/ok to PATH
    -	 package read: save cpy of bin/package when reading the INIT package
    -	 mamprobe.sh: allow cc path with optional arguments
    -01-09-24 Makefile,package.sh: add $INSTALLROOT/bin/.paths initialization
    -01-09-19 package.mk: add recurse to list.package.*
    -	 package.sh: bootstrap build nmake with _BLD_STATIC for _WIN32
    -01-09-11 ratz.c: add _SEA_SKIP & _SEA_COMMAND for self extracting archives
    -01-09-07 package.mk: fix output capture to not generate files names with spaces
    -01-09-07 package.mk: fix delta release number search
    -01-08-11 package.mk: handle single gz executable packages (e.g., for ksh)
    -	 package.sh: fix package install to require nmake only if no *.sum
    -	 iffe.sh: drop ancient menu and prompt actions; check ./hdr.h clash
    -01-07-17 package: fix use cross compile test to generate files in /tmp
    -01-06-27 ratz: handle hard and soft links if possible
    -01-06-07 Makefile: fix :MAPLIB: for sco
    -01-05-31 crossexec.sh: add
    -	 iffe.sh: add -x crosstype to run crossexec
    -	 iffe.sh: exp test now handles pass{}end fail{}end yes{}end no{}end
    -	 package.sh: add package host canon external-host-type-name
    -	 package.sh: fix `use USER' lookup for shells that support ~USER
    -	 cc.*: add -dumpmachine to dump target HOSTTYPE
    -01-05-18 iffe.sh: drop $HOME/tmp/t.sh debug trace -- oops
    -01-05-01 mamake.c: scan() now handles :PACKAGE: foo:command
    -01-04-26 *.sh: expand [a-z][A-Z][0-9] for non-contiguous character codes
    -	 iffe.sh: fix run *.sh for shells that don't $* across . command
    -	 cc.mvs.390: recode for /bin/sh
    -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-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
    -	 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>
    -01-02-26 iffe.sh: fix bug that omitted runtime #define for `mac' op
    -01-02-22 cc.ibm.risc: handle SF_CLOSE clash in <sfio.h>
    -01-02-14 cc.sgi.mips3,cc.sgi.mips4: handle -mips2 -mips3 -mips4 for cross cc
    -	 C+probe: quote "$cc" when it's an argument!
    -	 mamake: execute actions with $SHELL, ignored signals back to default
    -	 package.sh: nmake check error output to /dev/null
    -	 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!
    -	 mamake: handle `bind -lx [dontcare]'
    -01-02-12 ratz.c: fix _PACKAGE_ast includes
    -	 package.sh: $HOSTTYPE env overrides if $PACKAGEROOT/arch/$HOSTTYPE/
    -	 package.sh: $CC ^HOSTTYPE=[A-Za-z_0-9.]*$ overrides HOSTTYPE
    -	 iffe.sh: fix dat code that used previous $tmp.exe
    -	 iffe.sh: fix dat code for _DLL imports
    -01-02-09 iffe.sh: add copy() for shells with the disappearing here doc bug
    -01-02-08 Makefile: guard against null $(CC.HOSTTYPE)
    -01-02-06 Makefile: separate out cc,ld,ldd workarounds (so they will be packaged)
    -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
    -	 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
    -	 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
    -00-12-25 package.sh: `no package archives' is a hard error, duh
    -	 package.sh: reorder host type logic for lame shells
    -	 mamake.c: getcwd => getwd for NeXT -- how about posix==default guys
    -	 iffe.sh: really gross workaround for NeXT -lposix stdout null's
    -	 iffe.sh: handle cc -E that insists on compiling
    -00-12-15 iffe.sh: ancient sh function call blows $*; call only when $# == 0
    -	 *.sh: `getopts 2>/dev/null` => `(getopts)2>/dev/null` for ancient sh
    -	 package.sh: fix LD_LIBRARY*_PATH initialization
    -	 cc.next.m68k: add for _POSIX_SOURCE and linker multiply defined syms
    -00-12-12 ratz: add --meter
    -	 package.sh: a few VPATH fixes
    -	 Makefile: don't override *.mips* cc if -version not accepted
    -00-12-11 package.mk: *.inx now contains name=value
    -00-12-07 package.sh: handle PC netscape . => _ pathname mangle
    -	 WWW.mk: .tar.gz => .tgz
    -00-11-27 package.sh: add checklicense() to do license checks at read time
    -	 package.mk: change component list from preformat to table
    -00-10-31 package.mk: *.pkg must assert closure
    -	 package.mk: add cc- variants to list.package.binary
    -	 package.sh: omit dups from package list
    -	 package.sh: invalid arg gives one line Usage
    -	 package.sh: relax checkaout checks for non-owners
    -	 package.sh: package use sets NPROC if not already set or [01]
    -	 proto.c: add $(INSTALLROOT)/include/ast hack
    -00-10-26 WWW.mk: add .SOURCE rhs to :WWWPAGE:
    -00-10-25 package: fix install
    -	 package.mk: add list.install
    -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
    -	 package: add DYLD_LIBRARY_PATH initialization
    -	 add ldd.$(CC.HOSTTYPE)
    -00-10-01 iffe: handle -I* -L* options
    -00-09-21 mamake: add libxxx and xxx to makefile ordered prereqs
    -00-09-19 C+probe: add probe_longlong
    -00-09-11 package: drop manmake and $PACKAGEROOT/bin/nmake
    -00-09-08 iffe: verify that $cc is a C compiler
    -00-06-14 mamprobe: fix win32.* probe
    -	 mamake: fix bug that used lower view path for generation
    -	 package: don't clobber $PACKAGEROOT/bin/nmake
    -00-06-01 C+probe: fix stdinclude *again*
    -	 package: fix write delta source to use default pax format
    -	 package: add disambiguating bias for sgi.mips3 over sgi.mips4
    -	 package.mk: fix for directory content packages lib ast-locale
    -00-05-01 iffe: fix invalid _LIB_ macro identifier
    -00-04-11 C+probe: uniq stdinclude and stdlib, fix usrinclude
    -00-04-01 regress: fix explicit OUTPUT bug that didn't compare with expected
    -00-03-17 package: all archives are .tgz for binary download
    -	 package: $(PACKAGEROOT)/LICENSES/* in source and binary archives
    -	 package: implement install and verify actions
    -	 iffe: add exp, pth file dir ..., fix lib - -lfoo, fix lib - - -la -lb
    -	 iffe: -L* must affect LD_LIBRARY* hacks for .exe tests -- yuk
    -	 package.mk: add *.pkg :INDEX:
    -00-03-07 package: add admin action
    -00-03-06 makefile: install optional make probe override script C+make+probe.lcl
    -00-02-14 --- release 1.0 ---
    -	 ratz: treat "foo/" as a dir, not a regular file
    -	 package: clarify source and binary installation instructions
    -	 package: fix so binary packages can install without cc
    -	 package: "ratz" now a non-archive package (the only one) for bootstrap
    -	 package: handle VPATH=a:b arg
    -	 package.mk: "ratz" package adjustments
    -	 Makefile: use :PACKAGE_INIT: to support binary INIT packages
    -	 WWW.mk: add :WWWALL:
    -	 C.probe: fix .so check that let .dll slip through
    -	 iffe: fix config sh var assignment for HAVE_member_IN_struct
    -	 iffe: fix config sh var assignment for symbol_DECLARED
    -	 package: delay PATH export until dll hack exports complete
    -	 package: don't forget binary package $(INSTALLROOT)/lib(32|64)
    -	 package: add delta change log for source packages
    -00-02-10 mamprobe: add mam_cc_DLLBIG
    -	 package: fix spelling typos
    -	 package: add html help output
    -	 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: copy *.lic to $PACKAGEBIN for "make" and "write binary"
    -	 package: fix 'release change log' case match
    -00-01-24 package: add copyright action
    -	 mamprobe: add -D_BLD_DLL to mam_cc_DLL
    -00-01-11 package: tsort for package write
    -	 package: early verification that $CC works
    -	 package: add non-interactive command arg for use action
    -	 proto: fix -C intermediate mkdir()
    -	 mamprobe: unixware.i386 ksh workaround
    -	 C.probe: move hosttype to C.probe (with unixware.i386 workaround)
    -	 WWW.mk: fix mm2html option quoting
    -	 WWW.mk: add .SCAN.mm
    -	 WWW.mk: don't force static=1; grab dll's instead
    -	 *.sh: fix getopts test to handle botched implementations like osf.alpha
    -	 iffe.sh: fix read -r test
    -99-12-25 iffe: tweak verbose messages
    -	 iffe: hand code non-optget getopts parse
    -	 iffe: fix bash quoting bug again
    -	 iffe: do test -w . after option parse
    -	 package: fix PACKAGEROOT search
    -99-11-19 --- release 0.2 ---
    -99-11-19 first working package & friends
    -99-10-31 change from lib0ast to INIT; add MAM and package bootstrap
    -	 hostinfo: gobbled by package
    -99-10-01 iffe: add --config, yes{...}end no{...}end, fix read -r workaround
    -99-09-27 iffe: add --all --verbose, --* set options
    -99-09-22 regress: -v disables long line truncation
    -99-09-11 WWW.mk: WWWDIR and MM2HTMLINFO are now lists searched in $(HOME)
    -99-08-11 hostinfo: fix type sgi.mips4
    -99-06-24 WWW.mk: add
    -99-06-08 hostinfo.sh: ${TMPDIR:-/tmp}
    -99-06-07 TEST.mk: add
    -99-06-01 iffe: add `siz type' for _siz_type == sizeof(type)
    -99-05-11 hostinfo,iffe,regress,use: long options
    -99-05-01 C.probe: fix over aggressive stdinclude, e.g., /usr/include/machine
    -99-04-01 hostinfo: sgi.mips? -o32 and -n32 checks
    -	 iffe: check that . is writable
    -99-03-17 hostinfo: fix for cc not found
    -	 dl.c,hello.c,m.c: headers in conditionals to force .DONTCARE
    -	 C.probe: extra check for include dirs pulled in by <sys/types.h>
    -99-03-03 regress: add `UNIT - ...' for extra args
    -	 Makefile: add (_hosttype_) prereq for cc
    -99-01-23 hostinfo: tweak rating, use /proc/cpuinfo if there
    -99-01-11 C.probe: shlib before lib, /usr before /
    -98-12-25 iffe: work around win32.alpha intrinsic clash with -O
    -98-11-11 regress: fix UNIT PATH lookup
    -98-11-01 regress: add PROG
    -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
    -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
    -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
    -	 iffe: `mem x' to test if x is a non-opaque struct
    -98-01-11 $(INSTALLROOT)/lib32 for sgi.mips3
    -	 $(INSTALLROOT)/lib64 for sgi.mips4
    -	 add cc.hp.pa
    -98-01-01 cc.sgi.mips*: turn off ld library multiply defined
    -97-10-11 regress: add VIEW function for locating data
    -97-10-01 Makefile: -ldl test moved to libdll Makefile
    -97-08-11 regress: add MOVE
    -	 regress: add SAME
    -	 regress: use getopts
    -	 regress: `EXEC' repeats previous test
    -97-07-17 use: tweak PATH and LIBPATH bootstrap order
    -	 iffe: fix lcl bug that botched pathnames with embedded spaces
    -97-06-12 iffe: add npt `needs prototype' test
    -97-05-09 hostinfo: mvs.* => mvs.390
    -	 Makefile: cc.$(_hosttype_) workaround installed here
    -	 iffe: fix nolink{ ... }end
    -	 iffe: add [no]static{ ... }end for static link test
    -	 C.probe: _probe_PATH => _probe_export which must be eval'd
    -97-04-01 use: _RLD_ROOT set too
    -97-03-17 mm2html: changed inner loop
    -	 mm2html: handle .if|.ie|.el, .so
    -	 mm2html: handle different man styles
    -	 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
    -	 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
    -	 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: 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
    -	 C.probe: check gcc style -v -E for stdinclude usrinclude
    -96-11-28 iffe: check BASH_VERSION for IFS botch
    -	 iffe: typ long.xxx only if sizeof(long xxx) != sizeof(xxx)
    -	 hostinfo: fix sgi.mips[234] tests
    -	 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
    -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-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
    -	 mm2html: add
    -	 C.probe: probe_members += -whole-archive for gcc
    -	 iffe: add + fix the blasted `...'...\...'...`
    -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-10-11 hostinfo: no args prints type
    -95-08-11 use: add
    -95-05-09 save original PATH in _probe_PATH
    -	 beef up library dir probe
    -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
    -	 fix C.probe to properly handle C/C++ combined compiler drivers
    -	 add NeXT to hostinfo
    -	 bummer: mach has /usr/bin/hostinfo
    -95-03-19 fix dialect executable test
    -95-03-19 --- release 0.0 ---
    -
    -

    -


    - - - - - - -
    August 07, 2012
    -

    - -

    - - - diff --git a/cde/programs/dtksh/ksh93/lib/package/INIT.pkg b/cde/programs/dtksh/ksh93/lib/package/INIT.pkg deleted file mode 100644 index 32f1456de..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/INIT.pkg +++ /dev/null @@ -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. diff --git a/cde/programs/dtksh/ksh93/lib/package/INIT.req b/cde/programs/dtksh/ksh93/lib/package/INIT.req deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/lib/package/INIT.ver b/cde/programs/dtksh/ksh93/lib/package/INIT.ver deleted file mode 100644 index 8dc5177fc..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/INIT.ver +++ /dev/null @@ -1 +0,0 @@ -INIT 2012-08-01 2012-08-01 1 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-ast.pkg b/cde/programs/dtksh/ksh93/lib/package/ast-ast.pkg deleted file mode 100644 index 4d49fb4d6..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-ast.pkg +++ /dev/null @@ -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. diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-base.pkg b/cde/programs/dtksh/ksh93/lib/package/ast-base.pkg deleted file mode 100644 index 505b1dfc4..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-base.pkg +++ /dev/null @@ -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. diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-base.req b/cde/programs/dtksh/ksh93/lib/package/ast-base.req deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-base.ver b/cde/programs/dtksh/ksh93/lib/package/ast-base.ver deleted file mode 100644 index 0b7d4a1f8..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-base.ver +++ /dev/null @@ -1 +0,0 @@ -ast-base 2012-08-01 2012-08-01 1 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-dss.pkg b/cde/programs/dtksh/ksh93/lib/package/ast-dss.pkg deleted file mode 100644 index e090ae4a9..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-dss.pkg +++ /dev/null @@ -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. diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-ksh.pkg b/cde/programs/dtksh/ksh93/lib/package/ast-ksh.pkg deleted file mode 100644 index 6f2fec866..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-ksh.pkg +++ /dev/null @@ -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 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-ksh.req b/cde/programs/dtksh/ksh93/lib/package/ast-ksh.req deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-ksh.ver b/cde/programs/dtksh/ksh93/lib/package/ast-ksh.ver deleted file mode 100644 index 45271967b..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-ksh.ver +++ /dev/null @@ -1 +0,0 @@ -ast-ksh 2012-08-01 2012-08-01 1 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-make.pkg b/cde/programs/dtksh/ksh93/lib/package/ast-make.pkg deleted file mode 100644 index ec2c1bf8b..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-make.pkg +++ /dev/null @@ -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. diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-open.pkg b/cde/programs/dtksh/ksh93/lib/package/ast-open.pkg deleted file mode 100644 index ada0d1474..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-open.pkg +++ /dev/null @@ -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. diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-open.req b/cde/programs/dtksh/ksh93/lib/package/ast-open.req deleted file mode 100644 index e69de29bb..000000000 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast-open.ver b/cde/programs/dtksh/ksh93/lib/package/ast-open.ver deleted file mode 100644 index de483d215..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast-open.ver +++ /dev/null @@ -1 +0,0 @@ -ast-open 2012-08-01 2012-08-01 1 diff --git a/cde/programs/dtksh/ksh93/lib/package/ast.def b/cde/programs/dtksh/ksh93/lib/package/ast.def deleted file mode 100644 index c5b77229e..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast.def +++ /dev/null @@ -1,49 +0,0 @@ -# -# ast default license info -# - -message_set=3 - -contributor+=( - [gsf]="Glenn Fowler " - [dgk]="David Korn " - [kpv]="Phong Vo " - - [aedgar]="Adam Edgar " - [alb]="Adam Buchsbaum " - [ashaikh]="Aman Shaikh " - [bala]="Bala Krishnamurthy " - [brussell]="Brian Russell " - [chen]="Robin Chen " - [dfwc]="Don Caldwell " - [ek]="Lefty Koutsofios " - [gruber]="Bob Gruber " - [jiawang]="Jia Wang " - [jkf]="Jeff Fellin " - [jlk]="Jeff Korn <@google.com>" - [kfisher]="Kathleen Fisher " - [kwc]="Ken Church <@microsoft.com>" - - [bwk]="Brian Kernigham " - [dmr]="Dennis Ritchie " - [doug]="Doug McIlroy " - [ekrell]="Eduardo Krell " - [jjs]="John Snyder " - [rao]="Herman Rao " - - [ast-users]="AST users mailgroup " - [ast-developers]="AST developers mailgroup " -) - -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 -) diff --git a/cde/programs/dtksh/ksh93/lib/package/ast.lic b/cde/programs/dtksh/ksh93/lib/package/ast.lic deleted file mode 100644 index 225faa6ff..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ast.lic +++ /dev/null @@ -1,5 +0,0 @@ -. ast.def -. epl.def -license+=( - start=2011 -) diff --git a/cde/programs/dtksh/ksh93/lib/package/bsd.def b/cde/programs/dtksh/ksh93/lib/package/bsd.def deleted file mode 100644 index 21a6e33a1..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/bsd.def +++ /dev/null @@ -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. -' -) diff --git a/cde/programs/dtksh/ksh93/lib/package/bsd.lic b/cde/programs/dtksh/ksh93/lib/package/bsd.lic deleted file mode 100644 index 874a89d82..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/bsd.lic +++ /dev/null @@ -1 +0,0 @@ -. bsd.def diff --git a/cde/programs/dtksh/ksh93/lib/package/epl.def b/cde/programs/dtksh/ksh93/lib/package/epl.def deleted file mode 100644 index 60eea6b85..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/epl.def +++ /dev/null @@ -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 -) diff --git a/cde/programs/dtksh/ksh93/lib/package/ksh.pkg b/cde/programs/dtksh/ksh93/lib/package/ksh.pkg deleted file mode 100644 index 4783527e4..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/ksh.pkg +++ /dev/null @@ -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. diff --git a/cde/programs/dtksh/ksh93/lib/package/package.mk b/cde/programs/dtksh/ksh93/lib/package/package.mk deleted file mode 100644 index 1a945d9fe..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/package.mk +++ /dev/null @@ -1,1537 +0,0 @@ -/* - * source and binary package support - * - * @(#)package.mk (AT&T Research) 2012-02-14 - * - * usage: - * - * cd $INSTALLROOT/lib/package - * nmake -f name [closure] [cyg|exp|lcl|pkg|rpm|tgz] [base|delta] type - * - * where: - * - * name package description file or component - * - * type source build source archive, generates - * $(PACKAGEDIR)/name.version.release.suffix - * binary build binary archive, generates - * $(PACKAGEDIR)/name.version.hosttype.release.suffix - * runtime build binary archive, generates - * $(PACKAGEDIR)/name-run.version.hosttype.release.suffix - * - * NOTE: $(PACKAGEDIR) is in the lowest view and is shared among all views - * - * generated archive member files are $(PACKAGEROOT) relative - * - * main assertions: - * - * NAME [ name=value ] :PACKAGE: component ... - * :OMIT: component ... - * :LICENSE: license-class-pattern - * :CATEGORY: category-id ... - * :COVERS: package ... - * :REQUIRES: package ... - * :INDEX: index description line - * :DESCRIPTION: - * [ verbose description ] - * :DETAILS: style - * :README: - * readme lines - * :EXPORT: - * name=value - * target :INSTALL: [ source ] - * - * option variables, shown with default values - * - * format=tgz - * archive format - * - * version=YYYY-MM-DD - * package base version (overrides current date) - * - * release=YYYY-MM-DD - * package delta release (overrides current date) - * - * license=type.class - * :LICENSE: type.class pattern override - * - * notice=1 - * include the conspicuous empty notice file - * - * copyright=0 - * do not prepend source file copyright notice - * - * strip=0 - * don't strip non-lcl binary package members - * - * variants=pattern - * include variants matching pattern in binary packages - * - * incremental=[source:1 binary:0] - * if a base archive is generated then also generate an - * incremental delta archive from the previous base - * - * NOTE: the Makerules.mk :PACKAGE: operator defers to :package: when - * a target is specified - */ - -/* these are ast centric -- we'll parameterize another day */ - -org = ast -url = http://www.research.att.com/sw/download - -/* generic defaults */ - -base = -category = utils -checksum = md5 -closure = -copyright = 1 -delta = -format = tgz -incremental = -index = -init = INIT -license = -licenses = $(org) -mamfile = 1 -opt = -name = -notice = -release = -strip = 0 -style = tgz -suffix = tgz -type = -variants = !(cc-g) -vendor = -version = $("":T=R%Y-%m-%d) - -SUM = sum - -package.notice = ------------ NOTICE -- LICENSED SOFTWARE -- SEE README FOR DETAILS ------------ - -package.readme = $(@.package.readme.) - -.package.readme. : - This is a package root directory $PACKAGEROOT. Source and binary - packages in this directory tree are controlled by the command - $() - bin/package - $() - Binary files may be in this directory or in the install root directory - $() - INSTALLROOT=$PACKAGEROOT/arch/`bin/package` - $() - For more information run - $() - bin/package help - $() - Many of the packaged commands self-document via the --man and --html - options; those that do have no separate man page. - $() - Each package is covered by one of the license files - $() - $(PACKAGELIB)/LICENSES/ - $() - where is the license type for the package. At the top - of each license file is a URL; the license covers all software that - refers to this URL. For details run - $() - bin/package license [] - $() - Any archives, distributions or packages made from source or - binaries covered by license(s) must contain the corresponding - license file(s)$(notice:?, this README file, and the empty file$$("\n")$$(package.notice)?.?) - -.package.licenses. : .FUNCTION - local I F L R T all save text - L := $(%) - while L == "--*" - I := $(L:O=1) - if I == "--all" - all = 1 - elif I == "--save" - save = 1 - elif I == "--text" - text = 1 - end - L := $(L:O>1) - end - if "$(L)" == "*-*" - L += $(L:/[^-]*-//) $(L:/-.*//) - end - L += $(licenses) - for I $(L:U) - if I == "gpl" - I = gnu - all = - end - if F = "$(I:D=$(PACKAGESRC):B:S=.lic:T=F)" - R += $(F) - if save || text - T := $(.FIND. lib/package .lic $(F):P=W,query=type) - R += $(T:D=$(PACKAGESRC)/LICENSES:B) - end - if save - R += $(F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F) - elif ! all - break - end - end - end - return $(R) - -/* - * glob(3) doesn't handle / in alternation -- should it? - */ - -.package.glob. : .FUNCTION - local A D I P S - for I $(%) - if I == "*/*" - D := $(I:C,/.*,,) - if ! "$(A:N=$(D))" - local S.$(D) - A += $(D) - end - S.$(D) += $(I:C,[^/]*/,,) - else - P := $(P)$(S)$(I) - end - S = | - end - if P == "*\|*" - P := ($(P)) - end - for I $(A) - P += $(I)/$(.package.glob. $(S.$(I))) - end - return $(P) - - -.MAKEINIT : .package.init - -.package.init : .MAKE .VIRTUAL .FORCE - local V - V := $(VROOT:T=F:P=L*) - if ! PACKAGEROOT - PACKAGEROOT := $(V:N!=*/arch/+([!/]):O=1) - end - if V == "$(PACKAGEROOT)" - V := - end - V += $(INSTALLROOT) $(PACKAGEROOT) - PACKAGEVIEW := $(V:H=RU) - INSTALLOFFSET := $(INSTALLROOT:C%$(PACKAGEROOT)/%%) - if license - license := $(license)|none.none - end - -PACKAGELIB = lib/package -PACKAGESRC = $(PACKAGEROOT)/$(PACKAGELIB) -PACKAGEBIN = $(INSTALLROOT)/$(PACKAGELIB) -PACKAGEDIR = $(PACKAGESRC)/$(style) -INSTALLOFFSET = $(INSTALLROOT:C%$(PACKAGEROOT)/%%) - -package.omit = -|*/$(init) -package.glob.all = $(INSTALLROOT)/src/*/*/($(MAKEFILES:/:/|/G)) -package.all = $(package.glob.all:P=G:W=O=$(?$(name):A=.VIRTUAL):N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) -package.glob.pkg = $(.package.glob. $(~$(name):P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%) $(~$(name):P=U:N=$(name):?$$(INSTALLROOT)/src/$$(name)/($$(MAKEFILES:/:/|/G))??) -package.pkg = $(package.glob.pkg:P=G:D:N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) -package.closure = $(closure:?$$(package.all)?$$(package.pkg)?) - -package.init = $(.package.glob. $("$(init)$(name)":P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%:P=G:T=F:D::B) -package.ini = ignore mamprobe manmake package silent -package.src.pat = $(PACKAGESRC)/($(name).(ini|pkg)) -package.src = $(package.src.pat:P=G) $(.package.licenses. --save $(name)) -package.bin = $(PACKAGEBIN)/$(name).ini - -package.mam = --never --force --mam=static --corrupt=accept --clobber --compare --link='lib*.a*' CC=$(CC.DIALECT:N=C++:?CC?cc?) package.license.class=$(license:Q) $(=) 'dontcare test' install test - -op = current -stamp = [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] -source = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(suffix) -binary = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) -runtime = $(PACKAGEDIR)/$(name)-run.$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) -old.new.source = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(suffix) -old.new.binary = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) -old.new.runtime = $(PACKAGEDIR)/$(name)-run.$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) - -source.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(suffix)":P=G:H=R) -binary.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H=R) -runtime.list = $("$(PACKAGEDIR)/$(name)-run.*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H>) - -source.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz.c":T=F) -binary.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz":T=F) - -$(init) : .VIRTUAL $(init) - -package.requires = 0 - -":package:" : .MAKE .OPERATOR - local P I R V - P := $(<:O=1) - $(P) : $(>:V) - if ! package.requires - if ! name - name := $(P) - .PACKAGE. := $(P) - if name == "$(init)" - package.omit = - - package.src += $(package.ini:C,^,$(PACKAGEROOT)/bin/,) $(PACKAGESRC)/package.mk - else - $(P) : $(package.init) - end - for I $(<:O>1) - if I == "*=*" - eval - $(I) - end - else - version := $(I) - end - end - LICENSEFILEDEFAULT := $(.package.licenses. $(name):@/ /:/G) - export LICENSEFILEDEFAULT - end - if "$(>)" - for I $(>:V) - $(I) : .VIRTUAL - if I == "/*" - package.dir += $(I:V) - end - end - end - if "$(@)" - $(P).README := $(@) - else - $(P).README := This is the $(P) package. - end - end - -":AUXILIARY:" : .MAKE .OPERATOR - package.auxiliary.$(style) += $(>:N=/*:T=F) $(>:N!=/*:C%^%$(INSTALLROOT)/%:T=F) - -":CATEGORY:" : .MAKE .OPERATOR - if ! package.requires - category := $(>) - end - -.covers. : .FUNCTION - local I C D F K=0 L - for I $(%) - if ! "$(~covers:N=$(I:B))" - if F = "$(I:D:B:S=.pkg:T=F)" - if D = "$(F:T=I)" - covers : $(I:B) - for L $(D) - if L == ":COVERS:" - K = 1 - elif L == ":*:" - if K - break - end - elif K - : $(.covers. $(L)) - end - end - end - else - error $(--exec:?3?1?) $(I): unknown package $(I) - end - end - end - -":COVERS:" : .MAKE .OPERATOR - if ! package.requires - : $(.covers. $(>)) - end - -":DESCRIPTION:" : .MAKE .OPERATOR - if ! package.requires - $(name).README := $(@:V) - end - -":DETAILS:" : .MAKE .OPERATOR - if ! package.requires - details.$(>:O=1) := $(@:V) - end - -":EXPORT:" : .MAKE .OPERATOR - if ! package.requires - export.$(style) := $(@:/$$("\n")/ /G) - end - -":INDEX:" : .MAKE .OPERATOR - if ! package.requires - index := $(>) - end - -":INSTALL:" : .MAKE .OPERATOR - if ! package.requires - local T S F X - S := $(>) - T := $(<) - if "$(exe.$(style))" && "$(T)" == "bin/*([!./])" - T := $(T).exe - end - if ! "$(S)" - S := $(T) - elif "$(exe.$(style))" && "$(S)" == "bin/*([!./])" - S := $(S).exe - end - install.$(style) := $(install.$(style):V)$("\n")install : $$(ROOT)/$(T)$("\n")$$(ROOT)/$(T) : $$(ARCH)/$(S)$("\n\t")cp $< $@ - if strip && "$(T:N=*.exe)" - install.$(style) := $(install.$(style):V)$("\n\t")strip $@ 2>/dev/null - end - X := $(PACKAGEROOT)/arch/$(CC.HOSTTYPE)/$(S) - if strip && "$(X:T=Y)" == "*/?(x-)(dll|exe)" - F := filter $(STRIP) $(STRIPFLAGS) $(X) - end - if "$(filter.$(style):V)" - filter.$(style) := $(filter.$(style):V)$$("\n") - end - filter.$(style) := $(filter.$(style):V);;$(F);$(X);usr/$(T) - end - -":LICENSE:" : .MAKE .OPERATOR - if ! package.requires && ! license - license := $(>) - end - -":OMIT:" : .MAKE .OPERATOR - if ! package.requires - package.omit := $(package.omit)|$(>:C,^,*/,:/ /|/G) - end - -":POSTINSTALL:" : .MAKE .OPERATOR - if ! package.requires - postinstall.$(style) := $(@:V) - end - -":README:" : .MAKE .OPERATOR - if ! package.requires - readme.$(style) := $(@:V) - end - -.requires. : .FUNCTION - local I C D F K=0 L V T M=0 - for I $(%) - if ! "$(~requires:N=$(I:B))" - if F = "$(I:D:B:S=.pkg:T=F)" - if I == "$(init)" - package.omit = - - else - requires : $(I:B) - end - if V = "$(I:D:B=gen/$(I:B):S=.ver:T=F)" - req : $(I:B) - else - error 1 $(I): package should be written before $(P) - end - let package.requires = package.requires + 1 - include "$(F)" - let package.requires = package.requires - 1 - else - error 1 $(I): package not found - end - end - end - -":REQUIRES:" : .MAKE .OPERATOR - : $(.requires. $(>)) - -":TEST:" : .MAKE .OPERATOR - if ! package.requires - local T - T := $(>) - if "$(T)" == "bin/*([!./])" - if "$(exe.$(style))" - T := $(T).exe - end - T := $$(PWD)/$$(ARCH)/$(T) - end - test.$(style) := $(test.$(style):V)$("\n")test : $(T:V)$("\n\t")$(@) - end - -base delta : .MAKE .VIRTUAL .FORCE - op := $(<) - -closure : .MAKE .VIRTUAL .FORCE - $(<) := 1 - -cyg exp lcl pkg rpm tgz : .MAKE .VIRTUAL .FORCE - style := $(<) - -source : .source.init .source.gen .source.$$(style) - -.source.init : .MAKE - local A B D P V I - type := source - if ! "$(incremental)" - incremental = 1 - end - if "$(source.$(name))" - suffix = c - end - : $(.init.$(style)) - : $(details.$(style):V:R) : - A := $(source.list) - B := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) - P := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) - D := $(A:N=*.$(stamp).$(stamp).$(suffix):O=1:T=F) - if op == "delta" - if ! B - error 3 delta requires a base archive - end - base := -z $(B) - deltaversion := $(B:B:/$(name).//) - let deltasince = $(deltaversion:/.*-//) + 1 - deltasince := $(deltaversion:/[^-]*$/$(deltasince:F=%02d)/) - if "$(release)" != "$(stamp)" - release := $("":T=R%Y-%m-%d) - end - source := $(B:D:B:S=.$(release).$(suffix)) - version := $(source:B:B:/$(name).//) - elif B || op == "base" - if op == "base" - for I $(B) $(P) - V := $(I:B:/$(name)\.\([^.]*\).*/\1/) - if V == "$(stamp)" && V != "$(version)" - old.version := $(V) - old.source := $(I) - if "$(old.version)" >= "$(version)" - error 3 $(name): previous base $(old.version) is newer than $(version) - end - break - end - end - else - source := $(B) - end - if B == "$(source)" - if "$(B:D:B:B)" == "$(D:D:B:B)" && "$(B:B::S)" != "$(D:B::S)" - error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) - end - error 1 $(B:B:S): replacing current base - end - version := $(source:B:S:/^$(name).\(.*\).$(suffix)$/\1/) - end - PACKAGEGEN := $(PACKAGESRC)/gen - -.source.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) $$(PACKAGEGEN)/SOURCE.html $$(PACKAGEGEN)/BINARY.html $$(PACKAGEGEN)/DETAILS.html - -BINPACKAGE := $(PATH:/:/ /G:X=package:T=F:O=1) - -$$(PACKAGEDIR) $$(PACKAGEGEN) : .IGNORE - [[ -d $(<) ]] || mkdir $(<) - -$$(PACKAGEGEN)/SOURCE.html : $(BINPACKAGE) - $(*) html source > $(<) - -$$(PACKAGEGEN)/BINARY.html : $(BINPACKAGE) - $(*) html binary > $(<) - -$$(PACKAGEGEN)/DETAILS.html : $(BINPACKAGE) - $(*) html intro > $(<) - -.source.exp .source.pkg .source.rpm : .MAKE - error 3 $(style): source package style not supported yet - -exe.cyg = .exe -vendor.cyg = gnu - -.name.cyg : .FUNCTION - local N - N := $(%) - if N == "*-*" - vendor := $(N:/-.*//) - if vendor == "$(vendor.cyg)" - vendor := - N := $(N:/[^-]*-//) - end - N := $(N:/-//G) - end - return $(N) - -.init.cyg : .FUNCTION - local N O - closure = 1 - init = . - strip = 1 - suffix = tar.bz2 - format = tbz - vendor := $(licenses:N!=$(vendor.cyg):O=1) - package.ini := $(package.ini) - package.src.pat := $(package.src.pat) - package.src := $(package.src) - package.bin := $(package.bin) - .source.gen : .CLEAR $(*.source.gen:V:N!=*.html) - name.original := $(name) - name := $(.name.cyg $(name)) - if name != "$(name.original)" - $(name) : $(~$(name.original)) - O := $(~covers) - covers : .CLEAR - for N $(O) - covers : $(.name.cyg $(N)) - end - end - stamp = [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9] - version.original := $(version) - version := $(version:/-//G)-1 - if opt - opt := $(opt)/$(vendor)/ - else - opt := $(name)-$(version)/ - end - if type == "source" - version := $(version)-src - source = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) - else - binary = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) - end - -.source.cyg : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - cat > $tmp/configure <<'!' - echo "you didn't have to do that" - ! - chmod +x $tmp/configure - echo ";;;$tmp/configure;configure" - cat > $tmp/Makefile0 <<'!' - HOSTTYPE := $$(shell bin/package) - ROOT = ../.. - ARCH = arch/$$(HOSTTYPE) - all : - PACKAGEROOT= CYGWIN="$$CYGWIN ntsec binmode" bin/package make $(export.$(style)) - install : all - $(install.$(style):V) - $(test.$(style):V) - ! - echo ";;;$tmp/Makefile0;Makefile" - cat > $tmp/CYGWIN-README <<'!' - $(readme.$(style):@?$$(readme.$$(style))$$("\n\n")??)To build binaries from source into the ./arch/`bin/package` tree run: - $() - make - $() - $(test.$(style):@?To test the binaries after building/installing run:$$("\n\n\t")make test$$("\n\n")??)To build and/or install the binaries run: - $() - make install - $() - The bin/package command provides a command line interface for all package - operations. The $(opt:/.$//) source and binary packages were generated by: - $() - package write cyg base source version=$(version.original) $(name.original) - package write cyg base binary version=$(version.original) $(name.original) - $() - using the $(org)-base package. To download and install the latest - $(org)-base source package in /opt/$(org) run: - $() - PATH=/opt/$(org)/bin:$PATH - cd /opt/$(org) - package authorize "NAME" password "PASSWORD" setup flat source $("\\") - $(url) $("\\") - $(org)-base - package make - $() - and export /opt/$(org)/bin in PATH to use. The NAME and PASSWORD signify your - agreement to the software license(s). All users get the same NAME and PASSWORD. - See $(url) for details. If multiple architectures may be built under - /opt/$(org) then drop "flat" and export /opt/$(org)/arch/`package`/bin in PATH - to use. To update previously downloaded packages from the same url simply run: - $() - cd /opt/$(org) - package setup - package make - $() - To download and install the latest $(org)-base binary package in - /opt/$(org) change "source" to "binary" and omit "package make". - ! - echo ";;;$tmp/CYGWIN-README;CYGWIN-PATCHES/README" - cat > $(source:/-src.$(suffix)//).setup.hint <<'!' - category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) - requires: cygwin - sdesc: "$(index)" - ldesc: "$($(name.original).README)" - ! - echo ";;;$(source:/-src.$(suffix)//).setup.hint;CYGWIN-PATCHES/setup.hint" - echo ";;;$(BINPACKAGE);bin/package" - cat > $tmp/Makefile <<'!' - :MAKE: - ! - echo ";;;$tmp/Makefile;src/Makefile" - echo ";;;$tmp/Makefile;src/cmd/Makefile" - echo ";;;$tmp/Makefile;src/lib/Makefile" - if [[ '$(mamfile)' == 1 ]] - then cat > $tmp/Mamfile1 <<'!' - info mam static - note source level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - echo ";;;$tmp/Mamfile1;src/Mamfile" - cat > $tmp/Mamfile2 <<'!' - info mam static - note component level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" - echo ";;;$tmp/Mamfile2;src/lib/Mamfile" - fi - $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) - echo ";;;$(PACKAGEGEN)/$(name.original).req" - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then if [[ '$(mamfile)' == 1 ]] - then (( o=m )) - s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) - if [[ $s ]] - then for j in $s - do if [[ -d $j ]] - then cd $j - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then (( m++ )) - $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/$j/Mamfile" - fi - cd $(INSTALLROOT)/$i - fi - done - if (( o != m )) - then (( m++ )) - cat > $tmp/$m.mam <<'!' - info mam static - note subcomponent level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - else (( m++ )) - $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - fi - $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) - fi - done - set -- $(package.dir:P=G) - for i - do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" - done - } | - { - : > $tmp/HEAD - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - --format=$(format) \ - --local \ - -wvf $(source) $(base) \ - $(PACKAGEVIEW:C%.*%-s",^&/,,"%) \ - $(vendor:?-s",^[^/],$(opt)&,"??) - $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) - rm -rf $tmp - fi - -.source.lcl : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) $(=) .FILES.+=Mamfile recurse list.package.local - done - set -- $(package.dir:P=G) - for i - do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" - done - } | - sort -t';' -k5,5 -u | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - -wvf $(source) $(base) \ - $(op:N=delta:?--format=gzip??) \ - $(PACKAGEVIEW:C%.*%-s",^&/,,"%) - rm -rf $tmp - fi - -.source.tgz : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - if [[ '$(init)' == '$(name)' ]] - then cat > $tmp/Makefile <<'!' - :MAKE: - ! - $(CMP) $(CMPFLAGS) $tmp/Makefile $(PACKAGEROOT)/src/Makefile && touch -r $(PACKAGEROOT)/src/Makefile $tmp/Makefile - echo ";;;$tmp/Makefile;src/Makefile" - cp $tmp/Makefile $tmp/Makefile1 - $(CMP) $(CMPFLAGS) $tmp/Makefile1 $(PACKAGEROOT)/src/cmd/Makefile && touch -r $(PACKAGEROOT)/src/cmd/Makefile $tmp/Makefile1 - echo ";;;$tmp/Makefile1;src/cmd/Makefile" - cp $tmp/Makefile $tmp/Makefile2 - $(CMP) $(CMPFLAGS) $tmp/Makefile2 $(PACKAGEROOT)/src/lib/Makefile && touch -r $(PACKAGEROOT)/src/lib/Makefile $tmp/Makefile2 - echo ";;;$tmp/Makefile2;src/lib/Makefile" - if [[ '$(mamfile)' == 1 ]] - then cat > $tmp/Mamfile1 <<'!' - info mam static - note source level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - $(CMP) $(CMPFLAGS) $tmp/Mamfile1 $(PACKAGEROOT)/src/Mamfile && touch -r $(PACKAGEROOT)/src/Mamfile $tmp/Mamfile1 - echo ";;;$tmp/Mamfile1;src/Mamfile" - cat > $tmp/Mamfile2 <<'!' - info mam static - note component level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - $(CMP) $(CMPFLAGS) $tmp/Mamfile2 $(PACKAGEROOT)/src/cmd/Mamfile && touch -r $(PACKAGEROOT)/src/cmd/Mamfile $tmp/Mamfile2 - echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" - cp $tmp/Mamfile2 $tmp/Mamfile3 - $(CMP) $(CMPFLAGS) $tmp/Mamfile3 $(PACKAGEROOT)/src/lib/Mamfile && touch -r $(PACKAGEROOT)/src/lib/Mamfile $tmp/Mamfile3 - echo ";;;$tmp/Mamfile3;src/lib/Mamfile" - fi - fi - $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) - if [[ '$(~covers)' ]] - then for i in $(~covers) - do for j in lib pkg - do if [[ -f $(PACKAGESRC)/$i.$j ]] - then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - for j in ver req - do if [[ -f $(PACKAGEGEN)/$i.$j ]] - then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - done - for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) - do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" - done - fi - if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] - then echo $(name) $(version) $(release|version) 1 > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).ver || cp $tmp/t $(PACKAGEGEN)/$(name).ver - echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" - sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).req || cp $tmp/t $(PACKAGEGEN)/$(name).req - echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).inx || cp $tmp/t $(PACKAGEGEN)/$(name).inx - { - { - echo '$($(name).README)' - if [[ '$(~covers)' ]] - then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - } | fmt - package help source - package release $(name) - } > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).README || cp $tmp/t $(PACKAGEGEN)/$(name).README - echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" - { - echo '.xx title="$(name) package"' - echo '.xx meta.description="$(name) package"' - echo '.xx meta.keywords="software, package"' - echo '.MT 4' - echo '.TL' - echo '$(name) package' - echo '.H 1 "$(name) package"' - echo '$($(name).README)' - set -- $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F:D::B) - hot= - for i - do hot="$hot -e s/\\(\\<$i\\>\\)/\\\\h'0*1'\\1\\\\h'0'/" - done - set -- $(package.closure:B) - if (( $# )) - then echo 'Components in this package:' - echo '.P' - echo '.TS' - echo 'center expand;' - echo 'l l l l l l.' - if [[ $hot ]] - then hot="sed $hot" - else hot=cat - fi - for i - do echo $i - done | - pr -6 -t -s' ' | - $hot - echo '.TE' - fi - echo '.P' - if [[ '$(~covers)' ]] - then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - set -- $(.package.licenses. --all $(name)) - case $# in - 0) ;; - *) case $# in - 1) echo 'The software is covered by this license:' ;; - *) echo 'The software is covered by these licenses:' ;; - esac - echo .BL - for j - do i=$( $(PROTO) -l $j -p -h -o type=usage /dev/null | sed -e 's,.*\[-license?\([^]]*\).*,\1,' ) - echo .LI - echo ".xx link=\"$i\"" - done - echo .LE - echo 'Individual components may be covered by separate licenses;' - echo 'refer to the component source and/or binaries for more information.' - echo .P - ;; - esac - echo 'A recent' - echo '.xx link="release change log"' - echo 'is also included.' - cat $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F) < /dev/null - echo '.H 1 "release change log"' - echo '.xx index' - echo '.nf' - package release $(name) | - sed -e 's/:::::::: \(.*\) ::::::::/.fi\$("\n").H 1 "\1 changes"\$("\n").nf/' - echo '.fi' - } | - $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t - $(STDED) $(STDEDFLAGS) $tmp/t <<'!' - /^$/,/^$/s/ changes$/,/^$/m// - w - q - ! - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).html || cp $tmp/t $(PACKAGEGEN)/$(name).html - echo ";;;$(PACKAGEGEN)/$(name).html;$(PACKAGELIB)/$(name).html" - if [[ '$(deltasince)' ]] - then { - echo '.xx title="$(name) package"' - echo '.xx meta.description="$(name) package $(version) delta $(release)"' - echo '.xx meta.keywords="software, package, delta"' - echo '.MT 4' - echo '.TL' - echo '$(name) package $(deltaversion) delta $(release)' - echo '.H 1 "$(name) package $(deltaversion) delta $(release) changes"' - echo '.nf' - package release $(deltasince) $(name) | - sed -e 's/:::::::: \(.*\) ::::::::/.H 2 \1/' - echo '.fi' - } | - $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).$(release).html || cp $tmp/t $(PACKAGEGEN)/$(name).$(release).html - echo ";;;$(PACKAGEGEN)/$(name).$(release).html;$(PACKAGELIB)/$(name).$(release).html" - fi - fi - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then if [[ '$(mamfile)' == 1 ]] - then (( o=m )) - s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) - if [[ $s ]] - then for j in $s - do if [[ -d $j ]] - then cd $j - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then (( m++ )) - $(MAKE) $(package.mam) > $tmp/$m.mam - $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/$j/Mamfile && touch -r $(PACKAGEROOT)/$i/$j/Mamfile $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/$j/Mamfile" - fi - cd $(INSTALLROOT)/$i - fi - done - if (( o != m )) - then (( m++ )) - cat > $tmp/$m.mam <<'!' - info mam static - note subcomponent level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - else (( m++ )) - $(MAKE) $(package.mam) > $tmp/$m.mam - $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - fi - $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) $(copyright:N=1:??LICENSE=?) - fi - done - set -- $(package.dir:P=G) - for i - do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" - done - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - $(CMP) $(CMPFLAGS) $tmp/README $(PACKAGEROOT)/README && touch -r $(PACKAGEROOT)/README $tmp/README - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - -wvf $(source) $(base) \ - $(op:N=delta:?--format=gzip??) \ - $(PACKAGEVIEW:C%.*%-s",^&/,,"%) - $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) - echo local > $(source:D:B=$(name):S=.tim) - if [[ '$(incremental)' == 1 && '$(old.source)' ]] - then $(PAX) -rf $(source) -wvf $(old.new.source) -z $(old.source) - $(SUM) -x $(checksum) < $(old.new.source) > $(old.new.source:D:B:S=.$(checksum)) - fi - rm -rf $tmp - else if [[ '$(old.source)' ]] && $(CMP) $(CMPFLAGS) $(source.$(name)) $(source) - then : $(name) is up to date - else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - : > $(PACKAGEGEN)/$(name).req - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - echo '.xx title="$(name) package"' - echo '.xx meta.description="$(name) package"' - echo '.xx meta.keywords="software, package"' - echo '.MT 4' - echo '.TL' - echo '$(name) package' - echo '.H 1' - echo '$($(name).README)' - } | - $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $(PACKAGEGEN)/$(name).html - if [[ '$(source.$(name))' ]] - then { - echo '$($(name).README)' - package help source - } > $(PACKAGEGEN)/$(name).README - cp $(source.$(name)) $(source) - $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) - fi - echo local > $(source:D:B=$(name):S=.tim) - fi - fi - -binary : .binary.init .binary.gen .binary.$$(style) - -.binary.init : .MAKE - local A B D I P V - type := binary - if ! "$(incremental)" - incremental = 0 - end - if ! "$(~$(name))" - if name == "ratz" - suffix = exe - else - suffix = gz - end - end - : $(.init.$(style)) : - : $(details.$(style):V:R) : - A := $(binary.list) - B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) - P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) - D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) - if op == "delta" - if ! B - error 3 delta requires a base archive - end - base := -z $(B) - if "$(release)" != "$(stamp)" - release := $("":T=R%Y-%m-%d) - end - binary := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) - version := $(binary:B:B:/$(name).//) - elif B || op == "base" - if op == "base" - for I $(B) $(P) - V := $(I:B:/$(name)\.\([^.]*\).*/\1/) - if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" - old.version := $(V) - old.binary := $(I) - if "$(old.version)" >= "$(version)" - error 3 $(name): previous base $(old.version) is newer than $(version) - end - break - end - end - else - binary := $(B) - end - if B == "$(binary)" - if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" - error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) - end - error 1 $(B:B:S): replacing current base - end - version := $(binary:B:/$(name).//:/\..*//) - end - PACKAGEGEN := $(PACKAGEBIN)/gen - -.binary.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) - -.binary.exp .binary.pkg .binary.rpm : .MAKE - error 3 $(style): binary package style not supported yet - -.binary.cyg : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - { - echo '$($(name.original).README)' | fmt - cat <<'!' - $(readme.$(style):@?$$("\n")$$(readme.$$(style))??) - ! - } > $tmp/README1 - echo ";;;$tmp/README1;usr/share/doc/Cygwin/$(opt:/.$//).README" - { - echo '$($(name.original).README)' | fmt - cat <<'!' - $() - The remainder of this file is the README from the source package - that was used to generate this binary package. It describes - the source build hierarchy, not the current directory. - $() - $(package.readme) - ! - } > $tmp/README2 - echo ";;;$tmp/README2;usr/share/doc/$(opt)README" - package release $(name.original) > $tmp/RELEASE - echo ";;;$tmp/RELEASE;usr/share/doc/$(opt)RELEASE" - cat > $(binary:/.$(suffix)//).setup.hint <<'!' - category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) - requires: cygwin - sdesc: "$(index)" - ldesc: "$($(name.original).README)" - ! - set -- $(.package.licenses. --text $(name.original):N!=*.lic) - for i - do echo ";;;${i};usr/share/doc/$(opt)LICENSE-${i##*/}" - done - cat <<'!' - $(filter.$(style)) - ! - if [[ '$(postinstall.$(style):V:O=1:?1??)' ]] - then cat >$tmp/postinstall <<'!' - $("#")!/bin/sh - $(postinstall.$(style)) - ! - echo ";;;$tmp/postinstall;etc/postinstall/$(name).sh" - fi - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - --format=$(format) \ - --local \ - -wvf $(binary) - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - rm -rf $tmp - fi - -.binary.lcl : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) - $(package.bin:U:T=F:/.*/echo ";;;&"$("\n")/) - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) recurse list.package.$(type) package.license.class=$(license:Q) cc- - done - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - --checksum=md5:$(PACKAGEGEN)/$(name).sum \ - --install=$(PACKAGEGEN)/$(name).ins \ - -wvf $(binary) $(base) \ - $(op:N=delta:?--format=gzip??) \ - -s",^$tmp/,$(INSTALLOFFSET)/," \ - $(PACKAGEROOT:C%.*%-s",^&/,,"%) - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) - rm -rf $tmp - fi - -.binary.tgz : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - if [[ '$(init)' == '$(name)' ]] - then for i in lib32 lib64 - do if [[ -d $(INSTALLROOT)/$i ]] - then echo ";physical;;$(INSTALLROOT)/$i" - fi - done - fi - $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) - $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] - then echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" - if [[ '$(~covers)' ]] - then for i in $(~covers) - do for j in lic pkg - do if [[ -f $(PACKAGESRC)/$i.$j ]] - then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - for j in ver req - do if [[ -f $(PACKAGEGEN)/$i.$j ]] - then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - done - for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) - do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" - done - fi - sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req - echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - { - echo '$($(name).README)' - if [[ '$(~covers)' ]] - then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - } | fmt - package help binary - package release $(name) - } > $(PACKAGEGEN)/$(name).README - echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" - fi - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- - done - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - --checksum=md5:$(PACKAGEGEN)/$(name).sum \ - --install=$(PACKAGEGEN)/$(name).ins \ - -wvf $(binary) $(base) \ - $(op:N=delta:?--format=gzip??) \ - -s",^$tmp/,$(INSTALLOFFSET)/," \ - $(PACKAGEROOT:C%.*%-s",^&/,,"%) - echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) - if [[ '$(incremental)' == 1 && '$(old.binary)' ]] - then $(PAX) -rf $(binary) -wvf $(old.new.binary) -z $(old.binary) - echo $(old.new.binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(old.new.binary) > $(old.new.binary:D:B:S=.$(checksum)) - echo $(old.new.binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - fi - rm -rf $tmp - else if [[ '$(binary.$(name))' ]] - then exe=$(binary.$(name)) - else exe=$(INSTALLROOT)/bin/$(name) - fi - if [[ '$(old.binary)' ]] && $(CMP) $(CMPFLAGS) $exe $(binary) - then : $(name) is up to date - else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - : > $(PACKAGEGEN)/$(name).req - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - echo '$($(name).README)' - package help binary - } > $(PACKAGEGEN)/$(name).README - case "$(binary)" in - *.gz) gzip < $exe > $(binary) ;; - *) cp $exe $(binary) ;; - esac - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) - fi - echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - fi - -runtime : .runtime.init .runtime.gen .runtime.$$(style) - -.runtime.init : .MAKE - local A B D I P V - type := runtime - if ! "$(incremental)" - incremental = 0 - end - if ! "$(~$(name))" - if name == "ratz" - suffix = exe - else - suffix = gz - end - end - : $(.init.$(style)) : - : $(details.$(style):V:R) : - A := $(runtime.list) - B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) - P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) - D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) - if op == "delta" - if ! B - error 3 delta requires a base archive - end - base := -z $(B) - if "$(release)" != "$(stamp)" - release := $("":T=R%Y-%m-%d) - end - runtime := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) - version := $(runtime:B:B:/$(name).//) - elif B || op == "base" - if op == "base" - for I $(B) $(P) - V := $(I:B:/$(name)-run\.\([^.]*\).*/\1/) - if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" - old.version := $(V) - old.runtime := $(I) - if "$(old.version)" >= "$(version)" - error 3 $(name): previous base $(old.version) is newer than $(version) - end - break - end - end - else - runtime := $(B) - end - if B == "$(runtime)" - if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" - error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) - end - error 1 $(B:B:S): replacing current base - end - version := $(runtime:B:/$(name)-run.//:/\..*//) - end - PACKAGEGEN := $(PACKAGESRC)/gen - -.runtime.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) - -.runtime.cyg .runtime.exp .runtime.lcl .runtime.pkg .runtime.rpm : .MAKE - error 3 $(style): runtime package style not supported yet - -.runtime.tgz : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - if [[ '$(init)' == '$(name)' ]] - then for i in lib32 lib64 - do if [[ -d $(INSTALLROOT)/$i ]] - then echo ";physical;;$(INSTALLROOT)/$i" - fi - done - fi - $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) - $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" - if [[ '$(~covers)' ]] - then for i in $(~covers) - do for j in lic pkg - do if [[ -f $(PACKAGESRC)/$i.$j ]] - then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - for j in ver req - do if [[ -f $(PACKAGEGEN)/$i.$j ]] - then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - done - for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) - do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" - done - fi - sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req - echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - { - echo '$($(name).README)' - if [[ '$(~covers)' ]] - then echo - echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo - echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - echo - echo "To install this $(type) package read the tarball into a directory" - echo "suitable for containing bin and lib subdirectories, and run the" - echo "$(PACKAGELIB)/gen/$(name)-run.ins script to fix up permissions." - echo - echo "To use the package export the bin directory in PATH. The commands and" - echo "libraries use \$PATH to locate dynamic libraries and related data files." - echo - } | fmt - } > $(PACKAGEGEN)/$(name)-run.README - echo ";;;$(PACKAGEGEN)/$(name)-run.README;$(PACKAGELIB)/$(name)-run.README" - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- - done - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - --checksum=md5:$(PACKAGEGEN)/$(name)-run.sum \ - --install=$(PACKAGEGEN)/$(name)-run.ins \ - -wvf $(runtime) $(base) \ - $(op:N=delta:?--format=gzip??) \ - -s",^$tmp/,$(INSTALLOFFSET)/," \ - $(PACKAGEROOT:C%.*%-s",^&/,,"%) - echo $(runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(runtime) > $(runtime:D:B:S=.$(checksum)) - echo $(runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - echo local > $(runtime:D:B=$(name)-run:S=.$(CC.HOSTTYPE).tim) - if [[ '$(incremental)' == 1 && '$(old.runtime)' ]] - then $(PAX) -rf $(runtime) -wvf $(old.new.runtime) -z $(old.runtime) - echo $(old.new.runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(old.new.runtime) > $(old.new.runtime:D:B:S=.$(checksum)) - echo $(old.new.runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - fi - rm -rf $tmp - fi - -list.installed list.manifest : - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - ignore $(MAKE) --noexec $(-) $(=) $(<) - done diff --git a/cde/programs/dtksh/ksh93/lib/package/zlib.def b/cde/programs/dtksh/ksh93/lib/package/zlib.def deleted file mode 100644 index f82f1be53..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/zlib.def +++ /dev/null @@ -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. -' -) diff --git a/cde/programs/dtksh/ksh93/lib/package/zlib.lic b/cde/programs/dtksh/ksh93/lib/package/zlib.lic deleted file mode 100644 index 7b7c52066..000000000 --- a/cde/programs/dtksh/ksh93/lib/package/zlib.lic +++ /dev/null @@ -1 +0,0 @@ -. zlib.def diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/CONVERT.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/CONVERT.mk deleted file mode 100644 index 63a60ef5f..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/CONVERT.mk +++ /dev/null @@ -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 <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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/MAPLIB.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/MAPLIB.mk deleted file mode 100644 index 55d653416..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/MAPLIB.mk +++ /dev/null @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/MSGFUN.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/MSGFUN.mk deleted file mode 100644 index 0888d0049..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/MSGFUN.mk +++ /dev/null @@ -1,2 +0,0 @@ -/* stub for pre-2000-05-01 nmake */ -":MSGFUN:" : .MAKE .OPERATOR diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/MSGKEY.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/MSGKEY.mk deleted file mode 100644 index db1855964..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/MSGKEY.mk +++ /dev/null @@ -1,2 +0,0 @@ -/* stub for pre-2000-05-01 nmake */ -":MSGKEY:" : .MAKE .OPERATOR diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/Mamfile b/cde/programs/dtksh/ksh93/src/cmd/INIT/Mamfile index 4dfe4c746..066858af6 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/Mamfile +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/Mamfile @@ -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 ][-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 ][-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 ][-author?Phong Vo ][-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 ][-author?Phong Vo ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 ][-author?Lefty Koutsofios ][-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 ][-author?Lefty Koutsofios ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 ][-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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/PROBE.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/PROBE.mk deleted file mode 100644 index 9a8553f2d..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/PROBE.mk +++ /dev/null @@ -1,13 +0,0 @@ -/* - * @(#)probe (AT&T Bell Laboratories) 11/11/91 - * - * :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)) diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/RELEASE b/cde/programs/dtksh/ksh93/src/cmd/INIT/RELEASE index f877be003..677586b25 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/RELEASE +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/RELEASE @@ -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 (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 if | (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 and @@ -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_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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/TEST.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/TEST.mk deleted file mode 100644 index adc43908c..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/TEST.mk +++ /dev/null @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/WWW.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/WWW.mk deleted file mode 100644 index 4542daeea..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/WWW.mk +++ /dev/null @@ -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 <) - 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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/ar.freebsd12.amd64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/ar.freebsd12.amd64 deleted file mode 100755 index dc34f235e..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/ar.freebsd12.amd64 +++ /dev/null @@ -1,6 +0,0 @@ -: linux.i386-64 ar wrapper - -case $1 in -*x*) /usr/bin/ar "$@" ;; -*) /usr/bin/ar U"$@" ;; -esac diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/ar.linux.i386-64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/ar.linux.i386-64 deleted file mode 100755 index dc34f235e..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/ar.linux.i386-64 +++ /dev/null @@ -1,6 +0,0 @@ -: linux.i386-64 ar wrapper - -case $1 in -*x*) /usr/bin/ar "$@" ;; -*) /usr/bin/ar U"$@" ;; -esac diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin deleted file mode 100755 index e9e188c6b..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin +++ /dev/null @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin07 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin07 deleted file mode 100755 index a29930caf..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin07 +++ /dev/null @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin11 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin11 deleted file mode 100755 index 23766681e..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.darwin11 +++ /dev/null @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.freebsd b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.freebsd deleted file mode 100755 index af3576cef..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.freebsd +++ /dev/null @@ -1,9 +0,0 @@ -: FreeBSD cc wrapper - -HOSTTYPE=freebsd.generic - -case " $* " in -*" -dumpmachine "*) echo $HOSTTYPE; exit ;; -esac - -exec /usr/bin/cc -P "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.ia64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.ia64 index 204bd0e1f..6b758c1b0 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.ia64 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.ia64 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa index cd5f57624..ed644d002 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa64 index 49f239597..bbd2cf664 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa64 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.hp.pa64 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc index f67c5f400..9df88088c 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc @@ -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 '' "$@" '' diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc.gcc b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc.gcc index ac8473f55..961650db8 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc.gcc +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.ibm.risc.gcc @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.aarch64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.aarch64 deleted file mode 100755 index c4e558e46..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.aarch64 +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64 deleted file mode 100755 index d7f3d7001..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64 +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64-icc b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64-icc deleted file mode 100755 index 4d945bf5c..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-64-icc +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-icc b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-icc deleted file mode 100755 index 09dc25c08..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.i386-icc +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.ia64-icc b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.ia64-icc deleted file mode 100755 index 09dc25c08..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.linux.ia64-icc +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.mvs.390 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.mvs.390 index 50bc7d576..3c1d89ec7 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.mvs.390 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.mvs.390 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.i386 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.i386 index 16df7093a..e8ad8dccc 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.i386 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.i386 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.m68k b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.m68k index 1c2f8b5ca..1e8dda7ce 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.m68k +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.next.m68k @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.openbsd b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.openbsd deleted file mode 100755 index fb8916729..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.openbsd +++ /dev/null @@ -1,9 +0,0 @@ -: OpenBSD cc wrapper - -HOSTTYPE=openbsd.generic - -case " $* " in -*" -dumpmachine "*) echo $HOSTTYPE; exit ;; -esac - -exec /usr/bin/cc -P "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips2 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips2 index a0e5d33f9..e6e8f92e2 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips2 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips2 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3 index 426317ac0..85ce521a0 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3-o32 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3-o32 index a9c6c9cb9..334145ce0 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3-o32 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips3-o32 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4 index 1300cd2af..915080341 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4-n32 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4-n32 index 0e1b562b1..c54027faa 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4-n32 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sgi.mips4-n32 @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386 deleted file mode 100755 index 9f2a9dad6..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386 +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386-64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386-64 deleted file mode 100755 index 116d0881c..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.i386-64 +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc deleted file mode 100755 index d9f238166..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc-64 b/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc-64 deleted file mode 100755 index c29afed49..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/cc.sol11.sparc-64 +++ /dev/null @@ -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 "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/crossexec.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/crossexec.sh index cedbccf8c..6b78843bf 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/crossexec.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/crossexec.sh @@ -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 ] +[-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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/db.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/db.c index 5a3a7c1ae..77c636fce 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/db.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/db.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/ditto.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/ditto.sh deleted file mode 100644 index 312f7022a..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/ditto.sh +++ /dev/null @@ -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 # -# # -######################################################################## -: 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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/dl.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/dl.c index c710ad6a5..528905fcf 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/dl.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/dl.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/execrate.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/execrate.sh index 50735dcc9..513b43dc9 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/execrate.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/execrate.sh @@ -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 # # # ######################################################################## -: 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 ] +[-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). diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/filter.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/filter.sh index f1c70448e..dd46bbfa0 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/filter.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/filter.sh @@ -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 ] +[-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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm.c index cc0a9f617..5e21b5908 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm1.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm1.c index 6ad207140..68d231751 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm1.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm1.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm2.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm2.c index 1b9a48f59..9e052ff95 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm2.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/gdbm2.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/hello.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/hello.c index 2a8e2d17a..7a6176373 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/hello.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/hello.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/hurl.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/hurl.sh deleted file mode 100644 index a1da1eac0..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/hurl.sh +++ /dev/null @@ -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 # -# # -######################################################################## -: 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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/iconv.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/iconv.c index 64f2797d5..0fd7aa941 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/iconv.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/iconv.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.sh index 6eaaacc2e..9729587f5 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.sh @@ -2,6 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2012 AT&T Intellectual Property # +# Copyright (c) 2020-2021 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # @@ -21,17 +22,20 @@ # AT&T Research # # test if feature exists -# this script is written to make it through all sh variants +# this script is written to make it through POSIX sh variants # -# NOTE: .exe a.out suffix and [\\/] in path patterns for dos/nt +# NOTE: .exe a.out suffix and [\\/] in path patterns for DOS/NT -(command set -o posix) 2>/dev/null && set -o posix -case `uname -s` in -AIX) unset LIBPATH ;; +case ${ZSH_VERSION+z} in +z) emulate ksh ;; +*) (command set -o posix) 2>/dev/null && set -o posix ;; +esac +case $HOSTTYPE in +ibm.*) unset LIBPATH ;; # AIX: avoid failure to link to libiconv esac command=iffe -version=2012-07-17 # update in USAGE too # +version=2021-12-31 compile() # $cc ... { @@ -39,23 +43,18 @@ compile() # $cc ... _compile_status=$? if test -s $tmp.err then cat $tmp.err >&2 - case $_compile_status in - [1-9]|[1-9][0-9]|1[01][0-9]|12[0-7]) - if egrep -i -c 'terminated with signal|core dump|segmentation fault' $tmp.err >&$nullout - then _compile_status=139 - fi - ;; - esac fi - case $_compile_status in - ?|??|1[01]?|12[0-8]|25?) - ;; - *) echo "$command: $@" >&$stderr + if test "$_compile_status" -gt 128 + then echo "$command: $@" >&$stderr cat $tmp.err >&$stderr - echo "$command: $1: core dump or fatal interruption -- results inconclusive" >&$stderr + sig=$(kill -l "$_compile_status") + case $sig in + [!0-9]?*) + echo "$command: $1: terminated by SIG$sig" ;; + *) echo "$command: $1: fatal interruption ($_compile_status)" ;; + esac >&$stderr exit $_compile_status - ;; - esac + fi return $_compile_status } @@ -74,7 +73,7 @@ is_hdr() # [ - ] [ file.c ] hdr _is_hdr_status=$? case $_is_hdr_status in 0) if test -s $tmp.e - then case `grep '#.*error' $tmp.e` in + then case $(grep '#.*error' $tmp.e) in ?*) _is_hdr_status=1 ;; esac fi @@ -95,11 +94,45 @@ is_hdr() # [ - ] [ file.c ] hdr pkg() # package { case $1 in - '') pth=`getconf PATH 2>/dev/null` + '') # Determine default system path, store in $pth. + pth=$( + PATH=/run/current-system/sw/bin:/usr/xpg7/bin:/usr/xpg6/bin:/usr/xpg4/bin:/bin:/usr/bin:$PATH + exec getconf PATH 2>/dev/null + ) case $pth in - '') pth="/bin /usr/bin" ;; - *:*) pth=`echo "$pth" | sed 's/:/ /g'` ;; + '' | [!/]* | *:[!/]* | *: ) + pth="/bin /usr/bin /sbin /usr/sbin" ;; + *:*) pth=$(echo "$pth" | sed 's/:/ /g') ;; esac + # Fix for NixOS. Not all POSIX standard utilities come with the default system, + # e.g. 'bc', 'file', 'vi'. The command that NixOS recommends to get missing + # utilities, e.g. 'nix-env -iA nixos.bc', installs them in a default profile + # directory that is not in $(getconf PATH). So add this path to the standard path. + # See: https://github.com/NixOS/nixpkgs/issues/65512 + if test -e /etc/NIXOS && + nix_profile_dir=/nix/var/nix/profiles/default/bin && + test -d "$nix_profile_dir" + then case " $pth " in + *" $nix_profile_dir "* ) + # nothing to do + ;; + * ) # insert the default profile directory as the second entry + pth=$( + set $pth + one=$1 + shift + echo "$one $nix_profile_dir${1+ }$@" + ) ;; + esac + fi + # Fix for AIX. At least as of version 7.1, the system default 'find', 'diff -u' and 'patch' utilities + # are broken and/or non-compliant in ways that make them incompatible with POSIX 2018. However, GNU + # utilities are commonly installed in /opt/freeware/bin, and under standard names (no g- prefix). + if test -d /opt/freeware/bin + then case $(uname) in + AIX ) pth="/opt/freeware/bin $pth" ;; + esac + fi return ;; '<') shift @@ -375,68 +408,22 @@ noisy() esac } -here_broken=0 - -literal() # line that echo might process -{ - if cat <&$stderr - ;; - esac - sh -c "cat <&$stderr - ;; - esac - sh -c "cat < "$1" + ksh) print -r - "$2" ;; - *) if cat > "$1" <&$stderr - ;; - esac - sh -c "cat > \"$1\" < "$1" ;; esac } @@ -448,7 +435,7 @@ checkcc() # check for local package root directories case $PACKAGE_PATH in - ?*) for i in `echo $PACKAGE_PATH | sed 's,:, ,g'` + ?*) for i in $(echo $PACKAGE_PATH | sed 's,:, ,g') do if test -d $i/include then cc="$cc -I$i/include" occ="$occ -I$i/include" @@ -481,67 +468,6 @@ checkcc() esac } -checkread() -{ - case $cctest in - "") checkcc ;; - esac - case $posix_read in - -no) ;; - *) posix_read=`(read -r _checkread_line; echo $_checkread_line) 2>/dev/null <= 0) - { - if (c == ' ' || c == '\\t') - { - if (k < sizeof(s)) - s[k++] = c; - continue; - } - if (k > 1 && c != '#' && c != '\\n' && c != '\\r') - write(1, s + 1, k - 1); - k = -1; - } - if (c == '\\r') - { - r = c; - if (read(0, &c, 1) == 1 && c != '\\n') - write(1, &r, 1); - } - write(1, &c, 1); - if (c == '\\n') - return 0; - } - return 1; - }" - if compile $cc -o ${tmp}r.exe ${tmp}r.c >&$nullout - then posix_read=${tmp}r.exe - else echo "$command: cannot compile read -r workaround" >&$stderr - exit 1 - fi - ;; - esac -} - execute() { case $verbose in @@ -625,7 +551,8 @@ ifs=${IFS-' in= includes= intrinsic= -libpaths="LD_LIBRARY_PATH LD_LIBRARYN32_PATH LD_LIBRARY64_PATH LIBPATH SHLIB_PATH" +libpaths="DYLD_LIBRARY_PATH LD_LIBRARY_PATH LD_LIBRARYN32_PATH LD_LIBRARY64_PATH LIBPATH SHLIB_PATH" + DYLD_LIBRARY_PATH_default=:/lib:/usr/lib LD_LIBRARY_PATH_default=:/lib:/usr/lib LD_LIBRARYN32_PATH_default=:/lib32:/usr/lib32 LD_LIBRARY64_PATH_default=:/lib64:/usr/lib64 @@ -637,33 +564,23 @@ optimize=1 occ=cc one= out= -posix_read=-check -case `(set -f && set x * && echo $# && set +f) 2>/dev/null` in +case $( (set -f && set x * && echo $# && set +f) 2>/dev/null ) in 2) posix_noglob="set -f" posix_glob="set +f" ;; -*) case `(set -F && set x * && echo $# && set +F) 2>/dev/null` in +*) case $( (set -F && set x * && echo $# && set +F) 2>/dev/null ) in 2) posix_noglob="set -F" posix_glob="set +F" ;; *) posix_noglob=":" posix_glob=":" ;; esac ;; esac -protoflags= puthdr= putlib= pragma= -case `eval 'v=NOposixNO; w=$(export "w=$v"; echo "${w%%NO}"); echo "${w##NO}"' 2>/dev/null` in -posix) shell=posix # or at least POSIX-ish - case $BASH_VERSION in - [1-9]*) shell=bash ;; - esac - case `eval 'PATH=/dev/null && let i=93-5 && typeset -u v=ksh$i && print -r - "$v"' 2>/dev/null` in - KSH88) shell=ksh ;; # also pdksh, mksh, zsh - esac - ;; -*) shell=bsh # ancient pre-POSIX Bourne shell - ($executable .) 2>/dev/null || executable='test -r' - ($exists .) 2>/dev/null || exists='test -r' - ;; + +shell=posix +case $(eval 'PATH=/dev/null && let i=93-5 && typeset -u v=ksh$i && print -r - "$v"' 2>/dev/null) in +KSH88) shell=ksh ;; # also pdksh, mksh, zsh esac + reallystatic= reallystatictest= regress= @@ -674,10 +591,7 @@ case $COTEMP in ""|?|??|???|????|????) tmp=${HOSTNAME} ;; - *) case $shell in - bsh) eval `echo $HOSTNAME | sed 's/\\(....\\).*/tmp=\\1/'` ;; - *) eval 'tmp=${HOSTNAME%${HOSTNAME#????}}' ;; - esac + *) tmp=${HOSTNAME%${HOSTNAME#????}} ;; esac tmp=${tmp}$$ @@ -690,10 +604,7 @@ export COTEMP case $tmp in ./*) ;; ??????????*) - case $shell in - bsh) eval `echo $tmp | sed 's/\\(.........\\).*/tmp=\\1/'` ;; - *) eval 'tmp=${tmp%${tmp#?????????}}' ;; - esac + tmp=${tmp%${tmp#?????????}} ;; ?????????) ;; @@ -716,12 +627,16 @@ case $1 in esac set= -case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +case $( (getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null ) in 0123) USAGE=$' [-? -@(#)$Id: iffe (AT&T Research) 2012-07-17 $ +@(#)$Id: iffe (ksh 93u+m) '${version}$' $ ] -'$USAGE_LICENSE$' +[-author?Glenn Fowler ] +[-author?Phong Vo ] +[-copyright?(c) 1994-2012 AT&T Intellectual Property] +[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh] +[-license?http://www.eclipse.org/org/documents/epl-v10.html] [+NAME?iffe - C compilation environment feature probe] [+DESCRIPTION?\biffe\b is a command interpreter that probes the C compilation environment for features. A feature is any file, option @@ -771,9 +686,8 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in [N!:optimize?\b--nooptimize\b disables compiler optimization options.] [o:output?Sets the output file name to \afile\a.]:[file] [O:stdio?Sets the standard io header to \ahdr\a.]:[hdr:=stdio.h] -[e:package?Sets the \bproto\b(1) package name to \aname\a.]:[name] -[p:prototyped?Emits \b#pragma prototyped\b at the top of the - output file. See \bproto\b(1).] +[e:package?Obsolete; ignored.] +[p:prototyped?Obsolete; ignored.] [P:pragma?Emits \b#pragma\b \atext\a at the top of the output file.]:[text] [r:regress?Massage output for regression testing.] [s:shell?Sets the internal shell name to \aname\a. Used for debugging @@ -835,30 +749,21 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in } [+?\abegin\a\b{\b ... \b}end\b delimit multiline code blocks that override or augment the default code provided by \biffe\b. User supplied code - blocks should be compatible with the K&R, ANSI, and C++ C language - dialects for maximal portability. Test code may call the function + blocks should be compatible with the C89/C90 C language + standard for maximal portability. Test code may call the function \bNOTE("...")\b to emit short text in \b--verbose\b output; only one \bNOTE()\b should be called per test for readability. In addition to all macro definitions generated by previous tests, all generated - code contains the following at the top to hide dialect differences:]{ - [+ ?#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)] + code contains the following at the top:]{ + [+ ?/* AST backwards compatibility macros */] + [+ ?#define _NIL_(x) ((x)0)] [+ ?#define _STD_ 1] [+ ?#define _ARG_(x) x] [+ ?#define _VOID_ void] - [+ ?#else] - [+ ?#define _STD_ 0] - [+ ?#define _ARG_(x) ()] - [+ ?#define _VOID_ char] - [+ ?#endif] - [+ ?#if defined(__cplusplus)] - [+ ?#define _BEGIN_EXTERNS_ extern "C" {] - [+ ?#define _END_EXTERNS_ }] - [+ ?#else] [+ ?#define _BEGIN_EXTERNS_] [+ ?#define _END_EXTERNS_] - [+ ?#endif] - [+ ?#define _NIL_(x) ((x)0)] - [+ ?#include ] + [+ ?/* if/when available, "$INSTALLROOT/src/lib/libast/FEATURE/standards" is included here */] + [+ ?/* then is included, unless this was disabled using the "stdio" option */] } [+?= \adefault\a may be specified for the \bkey\b, \blib\b, \bmac\b, \bmth\b and \btyp\b tests. If the test fails for \aarg\a then @@ -892,7 +797,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in happy.] [+?The feature tests are:]{ [+# \acomment\a?Comment line - ignored.] - [+api \aname\a \aYYYYMMDD\a \asymbol ...\a?Emit api compatibility tests + [+api \aname\a \aYYYYMMDD\a \asymbol ...\a?Emit API compatibility tests for \aname\a and \b#define\b \asymbol\a \asymbol\a_\aYYYYMMDD\a when \aNAME\a_API is >= \aYYYYMMDD\a (\aNAME\a is \aname\a converted to upper case). If \aNAME\a_API is not defined @@ -912,8 +817,8 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in [+ver \aname\a \aYYYYMMDD\a?\b#define\b \aNAME\a_VERSION \aYYYYMMDD\a (\aNAME\a is \aname\a converted to upper case).] [+cmd \aname\a?Defines \b_cmd_\b\aname\a if \aname\a is an executable - in one of the standard system directories (\b/bin, /etc, - /usr/bin, /usr/etc, /usr/ucb\b). + in one of the standard system directories + (as output by \bgetconf PATH\b). \b_\b\adirectory\a\b_\b\aname\a is defined for \adirectory\a in which \aname\a is found (with \b/\b translated to \b_\b).] [+dat \aname\a?Defines \b_dat_\b\aname\a if \aname\a is a data symbol @@ -1037,11 +942,16 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in [+execute?The block is compiled, linked, and executed. \b0\b exit status means success.] [+fail?If the test fails then the block text is evaluated by - \bsh\b(1).] + \bsh\b(1) in \biffe\b'\'$'s current shell environment. + Changes in the shell state, such as variables, will survive the block. + Standard input is redirected to \b/dev/null\b. + Standard output is copied to the output file. + Standard error may be used to log informative or error messages. + The block may use \bexit\b to abort the \biffe\b run.] [+link?The block is compiled and linked (\bcc -o\b).] [+macro?The block is preprocessed (\bcc -E\b) and lines containing - text bracketed by \b<<"\b ... \b">>\b (\aless-than less-than - double-quote ... double-quote greater-than greater-than\a) + text bracketed by \b<<"\b ... \b">>\b (\aless-than\a \aless-than\a + \adouble-quote\a ... \adouble-quote\a \agreater-than\a \agreater-than\a) are copied to the output file with the brackets omitted.] [+no?If the test fails then the block text is copied to the output file. Deprecated: use { \bif\b \belif\b \belse\b @@ -1051,7 +961,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in [+output?The block is compiled, linked, and executed, and the output is copied to the output file.] [+pass?If the test succeeds then the block text is evaluated by - \bsh\b(1).] + \bsh\b(1) in the same manner as \bfail\b above.] [+preprocess?The block is preprocessed (\bcc -E\b).] [+run?The block is executed as a shell script and the output is copied to the output file. Successful test macros are also @@ -1067,7 +977,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in \bendif\b } with unnamed \b{\b ... \b}\b blocks.] } [+SEE ALSO?\bautoconf\b(1), \bconfig\b(1), \bgetconf\b(1), \bcrossexec\b(1), - \bnmake\b(1), \bpackage\b(1), \bproto\b(1), \bsh\b(1)] + \bnmake\b(1), \bpackage\b(1), \bsh\b(1)] ' while getopts -a "$command" "$USAGE" OPT do case $OPT in @@ -1084,8 +994,8 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in n) set="$set set namval $OPTARG :" ;; N) set="$set set nooptimize $OPTARG :" ;; o) set="$set set output $OPTARG :" ;; - e) set="$set set package $OPTARG :" ;; - p) set="$set set prototyped :" ;; + e) ;; # obsolete + p) ;; # obsolete P) set="$set set pragma $OPTARG :" ;; r) set="$set set regress :" ;; s) set="$set set shell $OPTARG :" ;; @@ -1097,7 +1007,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in X) set="$set set exclude $OPTARG :" ;; esac done - shift `expr $OPTIND - 1` + shift $((OPTIND - 1)) ;; *) while : do case $# in @@ -1112,64 +1022,64 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in --a|--al|--all) REM=a ;; - --cc=*) REM=c`echo X$1 | sed 's,[^=]*=,,'` + --cc=*) REM=c$(echo X$1 | sed 's,[^=]*=,,') ;; --co|--con|--conf|--confi|--config) REM=C ;; --cr=*|--cro=*|--cros=*|--cross=*) - REM=x`echo X$1 | sed -e 's,[^=]*=,,'` + REM=x$(echo X$1 | sed -e 's,[^=]*=,,') ;; --d=*|--de=*|--deb=*|--debu=*|--debug=*) - REM=d`echo X$1 | sed 's,[^=]*=,,'` + REM=d$(echo X$1 | sed 's,[^=]*=,,') ;; --def|--defi|--defin|--define) REM=D ;; --e=*|--ex=*|--exc=*|--excl=*|--exclu=*|--exclud=*|--exclude=*) - REM=X`echo X$1 | sed 's,[^=]*=,,'` + REM=X$(echo X$1 | sed 's,[^=]*=,,') ;; --e|--ex|--exp|--expl|--expli|--explic|--explici|--explicit) REM=E ;; --f=*|--fe=*|--fea=*|--feat=*|--featu=*|--featur=*|--feature=*|--features=*) - REM=F`echo X$1 | sed 's,[^=]*=,,'` + REM=F$(echo X$1 | sed 's,[^=]*=,,') ;; --inp=*|--inpu=*|--input=*) - REM=i`echo X$1 | sed 's,[^=]*=,,'` + REM=i$(echo X$1 | sed 's,[^=]*=,,') ;; --inc=*|--incl=*|--inclu=*|--includ=*|--include=*) - REM=I`echo X$1 | sed 's,[^=]*=,,'` + REM=I$(echo X$1 | sed 's,[^=]*=,,') ;; --l=*|--li=*|--lib=*|--libr=*|--libra=*|--librar=*|--library=*) - REM=L`echo X$1 | sed 's,[^=]*=,,'` + REM=L$(echo X$1 | sed 's,[^=]*=,,') ;; --n|--na|--nam|--name|--name-v|--name-va|--name-val|--name-valu|--name-value) REM=n ;; --o=*|--ou=*|--out=*|--outp=*|--outpu=*|--output=*) - REM=o`echo X$1 | sed 's,[^=]*=,,'` + REM=o$(echo X$1 | sed 's,[^=]*=,,') ;; --pa=*|--pac=*|--pack=*|--packa=*|--packag=*|--package=*) - REM=e`echo X$1 | sed 's,[^=]*=,,'` + # obsolete ;; --pro|--prot|--proto|--protot|--prototy|--prototyp|--prototype|--prototyped) - REM=p + # obsolete ;; --pra=*|--prag=*|--pragma=*) - REM=P`echo X$1 | sed 's,[^=]*=,,'` + REM=P$(echo X$1 | sed 's,[^=]*=,,') ;; --r|--re|--reg|--regre|--regres|--regress) REM=r ;; --sh=*|--she=*|--shel=*|--shell=*) - REM=s`echo X$1 | sed 's,[^=]*=,,'` + REM=s$(echo X$1 | sed 's,[^=]*=,,') ;; --sta=*|--stat=*|--stati=*|--static=*) - REM=S`echo X$1 | sed 's,[^=]*=,,'` + REM=S$(echo X$1 | sed 's,[^=]*=,,') ;; --std=*|--stdi=*|--stdio=*) - REM=O`echo X$1 | sed 's,[^=]*=,,'` + REM=O$(echo X$1 | sed 's,[^=]*=,,') ;; --u|--un|--und|--unde|--undef) REM=u @@ -1180,7 +1090,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in --*) echo $command: $1: unknown option >&2 exit 2 ;; - -*) REM=`echo X$1 | sed 's,X-,,'` + -*) REM=$(echo X$1 | sed 's,X-,,') ;; *) break ;; @@ -1190,7 +1100,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in do case $REM in '') break ;; esac - eval `echo $REM | sed "s,\(.\)\(.*\),OPT='\1' REM='\2',"` + eval $(echo $REM | sed "s,\(.\)\(.*\),OPT='\1' REM='\2',") case $OPT in [cdFiILoOePsSxX]) case $REM in @@ -1221,8 +1131,8 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in n) set="$set set namval $OPTARG :" ;; N) set="$set set nooptimize $OPTARG :" ;; o) set="$set set output $OPTARG :" ;; - e) set="$set set package $OPTARG :" ;; - p) set="$set set prototyped :" ;; + e) ;; # obsolete + p) ;; # obsolete P) set="$set set pragma $OPTARG :" ;; r) set="$set set regress :" ;; s) set="$set set shell $OPTARG :" ;; @@ -1275,9 +1185,9 @@ esac # prompt complications -case `print -n aha /dev/null` in +case $(print -n aha /dev/null) in aha) show='print -n' SHOW='' ;; -*) case `echo -n aha 2>/dev/null` in +*) case $(echo -n aha 2>/dev/null) in -n*) show=echo SHOW='\c' ;; *) show='echo -n' SHOW='' ;; esac @@ -1308,23 +1218,18 @@ status=2 # standard header for c source -std='#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus) +std='/* AST backwards compatibility macros */ +#define _NIL_(x) ((x)0) #define _STD_ 1 #define _ARG_(x) x #define _VOID_ void -#else -#define _STD_ 0 -#define _ARG_(x) () -#define _VOID_ char -#endif -#if defined(__cplusplus) -#define _BEGIN_EXTERNS_ extern "C" { -#define _END_EXTERNS_ } -#else #define _BEGIN_EXTERNS_ -#define _END_EXTERNS_ -#endif -#define _NIL_(x) ((x)0)' +#define _END_EXTERNS_' +# To ensure the environment tested is the same as that used, add standards +# compliance macros as probed by libast as soon as they are available. +if test -f "${INSTALLROOT}/src/lib/libast/FEATURE/standards" +then std=${std}${nl}$(cat "${INSTALLROOT}/src/lib/libast/FEATURE/standards") +fi tst= ext="#include " @@ -1343,7 +1248,6 @@ ini= init=1 line=0 nan= -prototyped= while : do case $in in "") case $argx:$* in @@ -1356,10 +1260,7 @@ do case $in in ;; *) case $ini in '') if read lin - then case $shell in - ksh) let line=line+1 ;; - *) line=`expr $line + 1` ;; - esac + then line=$((line+1)) $posix_noglob set x $lin $posix_glob @@ -1454,7 +1355,7 @@ do case $in in ksh) ifelse=${ifstack%%:*} ifstack=${ifstack#*:} ;; - *) eval `echo $ifstack | sed 's,\([^:]*\):\(.*\),ifelse=\1 ifstack=\2,'` + *) eval $(echo $ifstack | sed 's,\([^:]*\):\(.*\),ifelse=\1 ifstack=\2,') ;; esac shift @@ -1474,16 +1375,7 @@ do case $in in :) shift continue ;; - run) case $shell in - bsh) case $2 in - */*) x=`echo $2 | sed 's,.*[\\\\/],,'` ;; - *) x=$2 ;; - esac - ;; - *) eval 'x=${2##*[\\/]}' - ;; - esac - case $x in + run) case ${2##*[\\/]} in *.iffe|*.iff) set set in $2 ;; *.*) ;; @@ -1524,7 +1416,7 @@ do case $in in echo "$command: $file$line: warning: $*: operands ignored" >&$stderr ;; esac - eval `sed -e '/^#define[ ]/!d' -e 's/#define[ ]//' -e 's/[ (].*//' ${e:+"-e/$e/!d"} -e 's/.*/&=1/' $p | LC_ALL=C sort -u` + eval $(sed -e '/^#define[ ]/!d' -e 's/#define[ ]//' -e 's/[ (].*//' ${e:+"-e/$e/!d"} -e 's/.*/&=1/' $p | LC_ALL=C sort -u) continue ;; set) case $ifelse in @@ -1537,20 +1429,11 @@ do case $in in *) arg= op=$1 case $op in - --*) case $shell in - bsh) op=`echo X$op | sed 's/X--//'` ;; - *) op=${op#--} ;; - esac + --*) op=${op#--} ;; -*) case $op in - -??*) case $shell in - bsh) arg=`echo X$op | sed 's/X-.//'` - op=`echo X$op | sed 's/X\\(-.\\).*/\\1/'` - ;; - *) arg=${op#-?} - op=${op%$arg} - ;; - esac + -??*) arg=${op#-?} + op=${op%$arg} ;; esac case $op in @@ -1567,8 +1450,8 @@ do case $in in n) op=namval ;; N) op=nooptimize ;; o) op=output ;; - e) op=package ;; - p) op=prototyped ;; + e) ;; # obsolete + p) ;; # obsolete P) op=pragma ;; r) op=regress ;; s) op=shell ;; @@ -1612,13 +1495,7 @@ do case $in in for x in $arg do case $occ in "") case $x in - *=*) case $shell in - bsh) eval $x - export `echo $x | sed 's/=.*//'` - ;; - *) export $x - ;; - esac + *=*) export "$x" ;; -O*) case $optimize in 1) occ=$x ;; @@ -1703,13 +1580,8 @@ do case $in in case $out in "") case $in in *[.\\/]*) - case $shell in - bsh) eval `echo $in | sed -e 's,.*[\\\\/],,' -e 's/\\.[^.]*//' -e 's/^/out=/'` - ;; - *) eval 'out=${in##*[\\/]}' - eval 'out=${out%.*}' - ;; - esac + out=${in##*[\\/]} + out=${out%.*} ;; *) out=$in ;; @@ -1747,7 +1619,7 @@ do case $in in nooptimize) optimize=0 case $occ in - *" -O"*)occ=`echo $occ | sed 's/ -O[^ ]*//g'` + *" -O"*)occ=$(echo $occ | sed 's/ -O[^ ]*//g') cc=$occ ;; esac @@ -1769,15 +1641,11 @@ do case $in in def= test= ;; - package)protoflags="$protoflags -e $arg" + package)# obsolete continue ;; prototyped|noprototyped) - pragma="$pragma $op" - case $op in - prototyped) prototyped=1 ;; - *) prototyped= ;; - esac + # obsolete continue ;; pragma) pragma="$pragma $arg" @@ -1787,12 +1655,7 @@ do case $in in version=1995-03-19 continue ;; - shell) case $arg in - osh) posix_read=-no - shell=bsh - ;; - esac - shell=$arg + shell) shell=$arg continue ;; static) static=$arg @@ -2000,58 +1863,28 @@ do case $in in SEP= while : do case $# in - 0) case $posix_read in - -*) checkread ;; - esac - case $in in + 0) case $in in "") echo "$command: $file$line: missing }end" >&$stderr exit 1 ;; esac while : - do case $posix_read in - 1) case $shell in - ksh) IFS= read -r lin - eof=$? - while : - do lin="${lin#[' ']}" - case $lin in - [' ']*'#'*);; - *) break ;; - esac - done - ;; - *) IFS= - read -r lin - eof=$? - IFS=$ifs - case $lin in - [' ']*) lin=`sed -e 's,^[ ],,' -e 's,^[ ]*#,#,' < $usr -_BEGIN_EXTERNS_ struct _iffe_struct { int _iffe_member; }; -extern struct _iffe_struct* $x _ARG_((struct _iffe_struct*)); -_END_EXTERNS_ +extern struct _iffe_struct* $x (struct _iffe_struct*); " # some compilers with -O only warn for invalid intrinsic prototypes case " $cc " in - *" -O "*) xx=`echo $cc | sed 's/ -O / /g'` ;; + *" -O "*) xx=$(echo $cc | sed 's/ -O / /g') ;; *) xx=$cc ;; esac if compile $xx -c $tmp.c <&$nullin >&$nullout @@ -2396,13 +2215,7 @@ _END_EXTERNS_ ;; esac copy - "extern $t $x$v;" - # NOTE: technically if prototyped is on all tests should - # be run through proto(1), but we'd like iffe to - # work sans proto -- so we drop the extern's in - # the test headers - case $prototyped in - '') usr="$usr${nl}extern $t $x$v;" ;; - esac + usr="$usr${nl}extern $t $x$v;" else failure - case $in in "") while : @@ -2548,7 +2361,7 @@ int x; ;; 1) case $shell in ksh) typeset -u u=$x ;; - *) u=`echo $x | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + *) u=$(echo $x | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;; esac c=HAVE_SYS_${u}_H ;; @@ -2605,15 +2418,10 @@ int x; ;; *" + $x "*) ;; - *) case $shell in - bsh) eval `echo $x | sed -e 's,^\\([^\\\\/]*\\).*[\\\\/]\\([^\\\\/]*\\)\$,\\1_\\2,' -e 's/\\..*//' -e 's/^/c=/'` - ;; - *) eval 'c=${x##*[\\/]}' - eval 'c=${c%%.*}' - case $x in - */*) eval 'c=${x%%[\\/]*}_${c}' ;; - esac - ;; + *) c=${x##*[\\/]} + c=${c%%.*} + case $x in + */*) c=${x%%[\\/]*}_${c} ;; esac case $explicit in 0) dis=0 @@ -2636,7 +2444,7 @@ int x; ;; 1) case $shell in ksh) typeset -u u=$c ;; - *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + *) u=$(echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;; esac c=HAVE_${u}_H ;; @@ -2740,13 +2548,10 @@ int x; fi y= for x in $p - do case $shell in - bsh) c=`echo X$x | sed 's,X-l,,'` ;; - *) eval 'c=${x#-l}' ;; - esac + do c=${x#-l} case $c in *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) - c=`echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,'` + c=$(echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,') ;; esac case $config in @@ -2765,7 +2570,7 @@ int x; ;; 1) case $shell in ksh) typeset -u u=$c ;; - *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + *) u=$(echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;; esac c=$u case $e in @@ -2830,14 +2635,8 @@ int x; ;; esac IFS=" ," - case $shell in - bash) op=`echo $op` - arg=`echo $arg` - ;; - *) eval op=\"$op\" - eval arg=\"$arg\" - ;; - esac + eval op=\"$op\" + eval arg=\"$arg\" IFS=$ifs # check for op aliases @@ -2866,32 +2665,18 @@ int x; case $o in sys) x=sys/$x ;; esac - case $shell in - bsh) eval `echo $x | sed 's,\\(.*\\)\.\\([^.]*\\),x=\\1 o=\\2,'` - ;; - *) o=${x##*.} - x=${x%.${o}} - ;; - esac + o=${x##*.} + x=${x%.${o}} v=$x ;; esac case $x in - *[\\/]*)case $shell in - bsh) eval `echo $x | sed 's,\\(.*\\)[\\\\//]\\(.*\\),p=\\1 v=\\2,'` - ;; - *) eval 'p=${x%/*}' - eval 'v=${x##*/}' - ;; - esac + *[\\/]*) + p=${x%/*} + v=${x##*/} ;; - *.*) case $shell in - bsh) eval `echo $x | sed 's,\\(.*\\)\\.\\(.*\\),p=\\1 v=\\2,'` - ;; - *) eval 'p=${x%.*}' - eval 'v=${x##*.}' - ;; - esac + *.*) p=${x%.*} + v=${x##*.} ;; *) p= ;; @@ -2901,15 +2686,10 @@ int x; *) c=$v ;; esac ;; - *) case $shell in - bsh) eval `echo $a | sed -e 's,.*[\\\\/],,' -e 's/\\(.*\\)\\.\\(.*\\)/p=\\1 v=\\2/'` - ;; - *) eval 'p=${a%.*}' - eval 'p=${p##*[\\/]}' - eval 'v=${a##*.}' - eval 'v=${v##*[\\/]}' - ;; - esac + *) p=${a%.*} + p=${p##*[\\/]} + v=${a##*.} + v=${v##*[\\/]} ;; esac case $p in @@ -2922,13 +2702,8 @@ int x; m=_${v} ;; mem) case $p in - *.*) case $shell in - bsh) eval `echo $p | sed 's/\\([^.]*\\)\\.\\(.*\\)/p=\\1 m=\\2/'` - ;; - *) eval 'm=${p#*.}' - eval 'p=${p%%.*}' - ;; - esac + *.*) m=${p#*.} + p=${p%%.*} v=${m}.${v} esac case $config in @@ -2971,7 +2746,7 @@ int x; i=0 ;; *) case $m in - *'*') m=`echo "$m" | sed 's,\*,_ptr,g'` ;; + *'*') m=$(echo "$m" | sed 's,\*,_ptr,g') ;; esac case $m in *[-+/\\]*) @@ -3008,7 +2783,7 @@ int x; esac case $m in *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) - m=`echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + m=$(echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g') ;; esac @@ -3023,23 +2798,23 @@ int x; *) case $vers in ?*) echo for api in $vers - do API=`echo $api | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + do API=$(echo $api | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) eval ver='${'ver_${api}'}' echo "#define ${API}_VERSION ${ver}" done esac case $apis in ?*) for api in $apis - do API=`echo $api | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` + do API=$(echo $api | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) echo "#define ${API}API(rel) ( _BLD_${api} || !_API_${api} || _API_${api} >= rel )" map= sep= eval syms='"${'api_sym_${api}'}"' - # old solaris requires -k # - set x x `echo "$syms" | sort -t: -u -k 1,1 -k 2,2nr 2>/dev/null | sed 's/:/ /'` + # old Solaris requires -k # + set x x $(echo "$syms" | sort -t: -u -k 1,1 -k 2,2nr 2>/dev/null | sed 's/:/ /') case $# in 2) # ancient sort doesn't have -k # - set x x `echo "$syms" | sort -t: -u +0 -1 +1 -2nr 2>/dev/null | sed 's/:/ /'` + set x x $(echo "$syms" | sort -t: -u +0 -1 +1 -2nr 2>/dev/null | sed 's/:/ /') ;; esac sym= @@ -3093,8 +2868,7 @@ int x; n) sed '/^#/d' $tmp.h > $tmp.c sed '/^#/d' $x > $tmp.t ;; - *) (proto -r $protoflags $tmp.h) >/dev/null 2>&1 - sed 's,/\*[^/]*\*/, ,g' $tmp.h > $tmp.c + *) sed 's,/\*[^/]*\*/, ,g' $tmp.h > $tmp.c sed 's,/\*[^/]*\*/, ,g' $x > $tmp.t ;; esac @@ -3155,23 +2929,18 @@ int x; case $out in ""|-|+) x=$m ;; - *.*) case $shell in - bsh) eval `echo $in | sed -e 's,\\.,_,g' -e 's/^/x=/'` - ;; - *) i=$out - x=_ - while : - do case $i in - *.*) eval 'x=$x${i%%.*}_' - eval 'i=${i#*.}' - ;; - *) x=$x$i - break - ;; - esac - done - ;; - esac + *.*) i=$out + x=_ + while : + do case $i in + *.*) x=$x${i%%.*}_ + i=${i#*.} + ;; + *) x=$x$i + break + ;; + esac + done ;; *) x=_$out ;; @@ -3185,7 +2954,7 @@ int x; *) case $regress in '') case $x in *-*) ;; - *) x=`pwd | sed -e 's,.*[\\\\/],,' -e 's,\\..*,,' -e 's,^lib,,' -e 's,^,'${x}_',' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + *) x=$(pwd | sed -e 's,.*[\\\\/],,' -e 's,\\..*,,' -e 's,^lib,,' -e 's,^,'${x}_',' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g') # ksh n+ bug workaround case $x in *[!_]*) ;; @@ -3236,9 +3005,8 @@ int x; ?*) continue ;; esac case $v in - *.*) for x in `echo $v | sed 's,\\., ,g'` - do pre="$pre -#undef $x" + *.*) for x in $(echo $v | sed 's,\\., ,g') + do pre="$pre$nl#undef $x" done ;; *) case $o in @@ -3255,15 +3023,10 @@ int x; ;; esac ;; - *.h) case $shell in - bsh) eval `echo $x | sed -e 's,^\\([^\\\\/]*\\).*[\\\\/]\\([^\\\\/]*\\)\$,\\1_\\2,' -e 's/\\..*//' -e 's/^/c=/'` - ;; - *) eval 'c=${x##*[\\/]}' - eval 'c=${c%%.*}' - case $x in - */*) eval 'c=${x%%[\\/]*}_${c}' ;; - esac - ;; + *.h) c=${x##*[\\/]} + c=${c%%.*} + case $x in + */*) c=${x%%[\\/]*}_${c} ;; esac case $config in 0) case $x in @@ -3273,7 +3036,7 @@ int x; ;; 1) case $shell in ksh) typeset -u u=$c ;; - *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + *) u=$(echo "$c" | LC_ALL=C tr a-z A-Z) ;; esac c=HAVE_${u}_H ;; @@ -3285,8 +3048,7 @@ int x; usr="$usr$nl#define $c 1" ;; esac - inc="$inc -#include <$x>" + inc="$inc$nl#include <$x>" ;; esac done @@ -3296,11 +3058,11 @@ int x; for x in $lib $deflib do case $shell in ksh) eval 'c=${x#-l}' ;; - *) c=`echo X$x | sed 's,X-l,,'` ;; + *) c=$(echo X$x | sed 's,X-l,,') ;; esac case $c in *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) - c=`echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,'` + c=$(echo '' $c | sed -e 's,.*[\\\\/],,' -e 's,\.[^.]*$,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g' -e '/^lib./s,^lib,,') ;; esac case $config in @@ -3308,7 +3070,7 @@ int x; ;; 1) case $shell in ksh) typeset -u u=$c ;; - *) u=`echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + *) u=$(echo $c | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;; esac c=HAVE_${u}_LIB ;; @@ -3335,7 +3097,7 @@ int x; esac case $shell in ksh) typeset -u u=$m ;; - *) u=`echo $m | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + *) u=$(echo $m | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;; esac case $o in tst|var)case $m in @@ -3344,7 +3106,7 @@ int x; hdr_*|lib_*|sys_*) case $shell in ksh) u=${u#????} ;; - *) u=`echo $u | sed 's/....//'` ;; + *) u=$(echo $u | sed 's/....//') ;; esac ;; esac @@ -3360,7 +3122,7 @@ int x; pth) m=${u}_PATH case $shell in ksh) m=${m#_} ;; - *) m=`echo $m | sed 's,^_,,'` ;; + *) m=$(echo $m | sed 's,^_,,') ;; esac ;; nxt) m=HAVE${u}_NEXT ;; @@ -3420,14 +3182,12 @@ $src '') #UNDENT... reallystatictest=. - echo "$tst -$ext -int main(){printf("hello");return(0);}" > ${tmp}s.c + echo "$tst$nl$ext${nl}int main(){printf("hello");return(0);}" > ${tmp}s.c rm -f ${tmp}s.exe if compile $cc -c ${tmp}s.c <&$nullin >&$nullout && compile $cc -o ${tmp}s.exe ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe - then e=`wc -l ${tmp}s.e` + then e=$(wc -l ${tmp}s.e) eval set x x $binding while : do shift @@ -3437,18 +3197,18 @@ int main(){printf("hello");return(0);}" > ${tmp}s.c esac rm -f ${tmp}s.exe compile $cc -o ${tmp}s.exe $1 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue - case `wc -l ${tmp}s.e` in + case $(wc -l ${tmp}s.e) in $e) ;; *) continue ;; esac - d=`ls -s ${tmp}s.exe` + d=$(ls -s ${tmp}s.exe) rm -f ${tmp}s.exe compile $cc -o ${tmp}s.exe $2 ${tmp}s.o <&$nullin >&$nullout 2>${tmp}s.e && $executable ${tmp}s.exe || continue - case `wc -l ${tmp}s.e` in + case $(wc -l ${tmp}s.e) in $e) ;; *) continue ;; esac - case `ls -s ${tmp}s.exe` in + case $(ls -s ${tmp}s.exe) in $d) ;; *) reallystatic=$2 set x @@ -3547,9 +3307,7 @@ $tst $ext $std $usr -_BEGIN_EXTERNS_ extern int $statictest; -_END_EXTERNS_ int main(){char* i = (char*)&$statictest; return ((unsigned int)i)^0xaaaa;} " rm -f $tmp.exe @@ -3565,7 +3323,7 @@ int main(){printf("hello");return(0);} if compile $cc -c $tmp.c <&$nullin >&$nullout && compile $cc -o $tmp.exe $tmp.o <&$nullin >&$nullout && $executable $tmp.exe - then e=`wc -l $tmp.e` + then e=$(wc -l $tmp.e) eval set x x $binding while : do shift @@ -3575,18 +3333,18 @@ int main(){printf("hello");return(0);} esac rm -f $tmp.exe compile $cc -o $tmp.exe $1 $tmp.o <&$nullin >&$nullout && $executable $tmp.exe || continue - case `wc -l $tmp.e` in + case $(wc -l $tmp.e) in $e) ;; *) continue ;; esac - d=`ls -s $tmp.exe` + d=$(ls -s $tmp.exe) rm -f $tmp.exe compile $cc -o $tmp.exe $2 $tmp.o <&$nullin >&$nullout && $executable $tmp.exe || continue - case `wc -l $tmp.e` in + case $(wc -l $tmp.e) in $e) ;; *) continue ;; esac - case `ls -s $tmp.exe` in + case $(ls -s $tmp.exe) in $d) ;; *) static=$2 set x @@ -3614,34 +3372,30 @@ int main(){printf("hello");return(0);} esac is $o $a k=1 - for j in "" usr - do case $j in - "") d= s= ;; - *) d=/$j s=_$j ;; - esac - for i in bin etc ucb - do if test -f $d/$i/$a - then case $k in - 1) k=0 - case $M in - *-*) ;; - *) usr="$usr$nl#define $m 1" - case $define in - 1) echo "#define $m 1 /* $a in ?(/usr)/(bin|etc|ucb) */" ;; - n) echo "$m=1" ;; - esac - ;; + pkg $pth # set system default path + for d in $pth + do if test -f "$d/$a" + then s=$(echo "$d" | LC_ALL=C sed 's,[^0-9A-Za-z],_,g') + case $k in + 1) k=0 + case $M in + *-*) ;; + *) usr="$usr$nl#define $m 1" + case $define in + 1) echo "#define $m 1 /* $a in $pth */" ;; + n) echo "$m=1" ;; esac ;; esac - c=${s}_${i}_${v} - usr="$usr$nl#define $c 1" - case $define in - 1) echo "#define $c 1 /* $d/$i/$a found */" ;; - n) echo "$c=1" ;; - esac - fi - done + ;; + esac + c=${s}_${v} + usr="$usr$nl#define $c 1" + case $define in + 1) echo "#define $c 1 /* $d/$a found */" ;; + n) echo "$c=1" ;; + esac + fi done case $k in 0) success ;; @@ -3662,9 +3416,7 @@ $pre case $inc in ?*) echo "$inc" ;; - *) echo "_BEGIN_EXTERNS_ -extern int $v; -_END_EXTERNS_" + *) echo "extern int $v;" ;; esac echo " @@ -3741,7 +3493,7 @@ $inc ;; *) is exp "$note" x= - for i in `echo '' $test | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_], & ,g'` + for i in $(echo '' $test | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_], & ,g') do case $i in [\ \ ]) ;; @@ -3771,7 +3523,7 @@ $inc ;; esac done - c=`eval expr $x 2>&$stderr` + c=$(eval expr $x 2>&$stderr) ;; esac case $c in @@ -3805,20 +3557,20 @@ $inc *) e='-e /[\\\\\/]sys[\\\\\/]'$f'\\.h"/d' ;; esac if compile $cc -E $tmp.c <&$nullin >$tmp.i - then i=`sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q` + then i=$(sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q) case $i in [abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]:[\\/]*) ;; - */*/*) k=`echo "$i" | sed 's,.*/\([^/]*/[^/]*\)$,../\1,'` + */*/*) k=$(echo "$i" | sed 's,.*/\([^/]*/[^/]*\)$,../\1,') echo "$pre $tst $ext $inc #include <$k>" > $tmp.c if compile $cc -E $tmp.c <&$nullin >$tmp.i - then j=`sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q` - wi=`wc < "$i"` - wj=`wc < "$j"` + then j=$(sed -e '/^#[line ]*[0123456789][0123456789]*[ ][ ]*"[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:]*[\\\\\/].*[\\\\\/]'$f'\\.h"/!d' $e -e s'/.*"\\(.*\\)".*/\\1/' -e 's,\\\\,/,g' -e 's,///*,/,g' $tmp.i | sed 1q) + wi=$(wc < "$i") + wj=$(wc < "$j") case $wi in $wj) i=$k ;; esac @@ -3986,13 +3738,13 @@ int f(){int $w = 1;return($w);}" > $tmp.c esac case $shell in ksh) typeset -u u=$w ;; - *) u=`echo $w | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` ;; + *) u=$(echo $w | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;; esac u=_$u M=$w case $M in *[!abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*) - M=`echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g'` + M=$(echo "X$m" | sed -e 's,^.,,' -e 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_],_,g') ;; esac case $config in @@ -4031,13 +3783,15 @@ $std $usr $pre $inc +#ifdef _IFFE_type +$v i; +#else typedef int (*_IFFE_fun)(); #ifdef _IFFE_extern -_BEGIN_EXTERNS_ extern int $v(); -_END_EXTERNS_ #endif static _IFFE_fun i=(_IFFE_fun)$v;int main(){return ((unsigned int)i)^0xaaaa;} +#endif " d=-D_IFFE_extern if compile $cc -c $tmp.c <&$nullin >&$nullout @@ -4065,26 +3819,28 @@ static _IFFE_fun i=(_IFFE_fun)$v;int main(){return ((unsigned int)i)^0xaaaa;} ;; esac fi - else case $intrinsic in - '') copy $tmp.c " + else if compile $cc -D_IFFE_type -c $tmp.c <&$nullin >&$nullout + then c=1 + else case $intrinsic in + '') copy $tmp.c " $tst $ext $std $usr $pre $inc -_BEGIN_EXTERNS_ extern int foo(); -_END_EXTERNS_ static int ((*i)())=foo;int main(){return(i==0);} " - compile $cc -c $tmp.c <&$nullin >&$nullout - intrinsic=$? - ;; - esac + compile $cc -c $tmp.c <&$nullin >&$nullout + intrinsic=$? + ;; + esac + c=$intrinsic + fi case $o in - mth) report $intrinsic 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" ;; - *) report $intrinsic 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" ;; + mth) report $c 1 "$v() in math lib" "$v() not in math lib" "default for function $v()" ;; + *) report $c 1 "$v() in default lib(s)" "$v() not in default lib(s)" "default for function $v()" ;; esac fi ;; @@ -4195,18 +3951,12 @@ $std $usr $pre $inc -_BEGIN_EXTERNS_ struct _iffe_struct { int _iffe_member; }; -#if _STD_ extern struct _iffe_struct* $v(struct _iffe_struct*); -#else -extern struct _iffe_struct* $v(); -#endif -_END_EXTERNS_ " # some compilers with -O only warn for invalid intrinsic prototypes case " $cc " in - *" -O "*) xx=`echo $cc | sed 's/ -O / /g'` ;; + *" -O "*) xx=$(echo $cc | sed 's/ -O / /g') ;; *) xx=$cc ;; esac compile $xx -c $tmp.c <&$nullin >&$nullout @@ -4220,9 +3970,7 @@ $std $usr $pre $inc -_BEGIN_EXTERNS_ int _iffe_int = $v / 2; -_END_EXTERNS_ " compile $cc -c $tmp.c <&$nullin >&$nullout report $? 1 "$v is a numeric constant" "$v is not a numeric constant" @@ -4252,9 +4000,9 @@ _END_EXTERNS_ if compile $cc -E $tmp.c <&$nullin >$tmp.i then c=$i case $c in - *[\\/]*) c=`echo $c | sed 's,[\\\\/],[\\\\/],g'` ;; + *[\\/]*) c=$(echo $c | sed 's,[\\\\/],[\\\\/],g') ;; esac - case `sed -e '/^#[line ]*1[ ][ ]*"[\\\\\/].*[\\\\\/]'$c'"/!d' $tmp.i` in + case $(sed -e '/^#[line ]*1[ ][ ]*"[\\\\\/].*[\\\\\/]'$c'"/!d' $tmp.i) in ?*) break ;; esac fi @@ -4427,7 +4175,7 @@ int main() { if compile $cc -o $tmp.exe $tmp.c $lib $deflib <&$nullin >&$nullout && $executable $tmp.exe && execute $tmp.exe > $tmp.dat - then z=`cat $tmp.dat` + then z=$(cat $tmp.dat) c=0 else z=0 c=1 @@ -4545,7 +4293,8 @@ struct xxx* f() { return &v; }" *) user_pf=$pass user_yn=$yes ;; esac case $user_pf in - ?*) eval "$user_pf" <&$nullin ;; + ?*) # Run a pass{ or fail{ block in iffe's current environment + eval "$user_pf" <&$nullin 2>&$stderr ;; esac case $user_yn in ?*) case $def in @@ -4611,10 +4360,7 @@ struct xxx* f() { return &v; }" *) lib="$lib $1" ;; esac ;; - +l*) case $shell in - bsh) x=`echo X$1 | sed 's/X+/-/'` ;; - *) eval 'x=-${1#+}' ;; - esac + +l*) x=-${1#+} case $group in -*) groups="$groups $x" ;; *) lib="$lib $x" ;; diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.tst b/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.tst index 75a916674..dc6a40ff3 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.tst +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/iffe.tst @@ -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 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 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 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 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 ok */ #include diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/ignore.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/ignore.sh index 09611b70b..1c16225de 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/ignore.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/ignore.sh @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/intl.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/intl.c index 1623dd651..803cd5cd5 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/intl.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/intl.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.cygwin.i386 b/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.cygwin.i386 index 5976b1fe8..b9df84f19 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.cygwin.i386 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.cygwin.i386 @@ -1,5 +1,5 @@ #!/bin/env sh -: cygwin.i386 ldd -- how many ways does this confirm the windows bias? +: cygwin.i386 ldd -- how many ways does this confirm the Windows bias? for f do case $f in *.exe) ;; diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.darwin b/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.darwin index ec75f7b27..6f06d9830 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.darwin +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/ldd.darwin @@ -1,2 +1,2 @@ -: mac os10 ldd +: Mac OS X ldd otool -L "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/m.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/m.c index b56b99b7c..e597bfde9 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/m.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/m.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/m2.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/m2.c index cad12b11f..25b1f136c 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/m2.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/m2.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/m3.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/m3.c index 5d8999102..f630bb9fb 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/m3.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/m3.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/m4.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/m4.c index 79b87f040..e573b4343 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/m4.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/m4.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/m5.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/m5.c index f85392169..b73f358c6 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/m5.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/m5.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/m6.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/m6.c index 4387ea044..fab55f8f8 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/m6.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/m6.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/make.probe b/cde/programs/dtksh/ksh93/src/cmd/INIT/make.probe index c1b931748..d02a18afd 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/make.probe +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/make.probe @@ -72,7 +72,6 @@ extern int i; int i = 1; extern int f(){return(!i);} int main(){FILE* fp=stdin;return(f());}' > pic.$src -echo 'class x {int n;} m;' > plusplus.$src echo 'int prefix(){return 0;}' > prefix.$src echo 'template int gt(T a, T b); template int gt(T a, T b) { return a > b; } @@ -89,7 +88,7 @@ echo '#if mips && !sgi || __CYGWIN__ CONST char x[]={1,2,3,4,5,6,7,8,9,0}; int main(){*(char*)x=0; return x[0];} #endif' > readonly.$src -# NOTE: sfclose() defined on uwin, not defined on all other systems +# NOTE: sfclose() defined on UWIN, not defined on all other systems echo 'extern int sfclose(); extern int ShareD(){return(sfclose());}' > shared.$src echo '#define g(a,b) a ## b volatile int a; @@ -102,9 +101,7 @@ int i; int main(){int j;j = i * 10;return j;}' > strip.$src echo 'template void f(T){} int main(){f(1);return 0;}' > toucho.$src -echo '#if defined(__STDC__) || defined(__cplusplus) -extern type call(int); -#endif +echo 'extern type call(int); int main() {call(0);return(0);}' > tstlib.$src echo 'int main(){return 0;}' > warn.$src echo 'int f(){return 0;}' > warn1.$src @@ -154,7 +151,6 @@ nmedit= nmflags= no_protect= optimize= -plusplus= prefix_archive=lib prefix_dynamic= prefix_shared=lib @@ -404,7 +400,7 @@ int main() { f(); return 0; }' > picok.$src } case $1 in -Wc,*exportall*) - # get specific since sgi gets this far too + # get specific since SGI gets this far too rm -f pic.$exe pic.x $cc -Wl,dll -o pic.$exe pic.$obj || continue test -f pic.$exe || continue @@ -433,7 +429,6 @@ int main() { f(); return 0; }' > picok.$src esac fi -$cc -c plusplus.$src && plusplus=1 $cc -E -dD dDflag.$src > t case `grep '#define[ ][ ]*dDflag[ ][ ]*on' t` in ?*) dDflag=1 ;; @@ -441,90 +436,7 @@ esac case `grep '#define.*_GNUC_' t` in ?*) gnu=1 ;; esac -case $plusplus in -"") $cc -c stdc.$src && stdc=1 ;; -*) mkdir ptr - cd ptr - $cc -c ../ptr.$src & - NFS_locks_are_botched=$! - cd .. - if $cc -c require.$src && $cc require.$obj - then set x `$cc require.$obj 2>&1` - d= - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - -l*) d="$d $1" ;; - esac - done - for f in ++ - do if $cc require.$obj -l$f - then set x `$cc require.$obj -l$f 2>&1` - r= - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - -l*) case " $d $r " in - *" "$1" "*) ;; - *) r="$r $1" ;; - esac - esac - done - case $r in - ?*) require="$require $f" - echo '' $r > req.$f - ;; - esac - fi - done - fi - cd ptr - for i in * - do if test -d $i - then repository=$i - break - fi - done - cd .. - kill -9 $NFS_locks_are_botched - rm -rf ptr - case $repository in - *?) mkdir ptr - cd ptr - i=PTR - case $repository in - $i) i=$i$i ;; - esac - $cc -ptr$i -c ../ptr.$src & - NFS_locks_are_botched=$! - cd .. - sleep 5 - if test -d ptr/$i/$repository - then ptrimplicit=1 - fi - kill -9 $NFS_locks_are_botched - rm -rf ptr - ;; - esac - $cc -o implc implc.$src && $executable implc && implicitc=1 - if $cc -c toucho.$src && test -f toucho.$obj - then o=`ls -l toucho.$obj` - if $cc -o toucho toucho.$obj && $executable toucho - then n=`ls -l touch.$obj` - case $n in - "$o") ;; - *) toucho=1 ;; - esac - fi - fi - ;; -esac +$cc -c stdc.$src && stdc=1 if $cc -c pic.$src then eval set x $probe_nmflags @@ -660,7 +572,7 @@ case $cc_dll:$cc_pic:$so:$dynamic:$static in if $cc -shared -Wl,--enable-auto-image-base -Wl,--out-implib=xxx.lib -o xxx.dll exp.$obj && test -f xxx.lib -a -f xxx.dll then - : cygwin + : Cygwin cc_dll=$cc_dll_def dll_dir='$(BINDIR)' sd=.dll @@ -713,37 +625,34 @@ case $cc_dll:$cc_pic:$so:$dynamic:$static in esac dld=$xx shared=$1 - # does -nostartfiles make sense for C? - case $plusplus in - '') z=`wc -c < xxx$dll` - eval set x $probe_shared_nostart - while : - do shift - case $# in - 0) break ;; - esac - rm -f xxx$dll - if $dld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll - then case `wc -c < xxx$dll` in - $z) ;; - *) if test -s e - then case `cat e` in - *[Ee][Rr][Rr][Oo][Rr]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) - continue - ;; - esac - fi - case $shared in - '') shared=$1 ;; - *) shared="$shared $1" ;; + # does -nostartfiles make sense? + z=`wc -c < xxx$dll` + eval set x $probe_shared_nostart + while : + do shift + case $# in + 0) break ;; + esac + rm -f xxx$dll + if $dld $shared $1 -o xxx$dll shared.$obj 2>e && test -r xxx$dll + then case `wc -c < xxx$dll` in + $z) ;; + *) if test -s e + then case `cat e` in + *[Ee][Rr][Rr][Oo][Rr]*|*[Ww][Aa][Rr][Nn][Ii][Nn][Gg]*|*[Oo][Pp][Tt][Ii][Oo][Nn]*) + continue + ;; esac - break - ;; + fi + case $shared in + '') shared=$1 ;; + *) shared="$shared $1" ;; esac - fi - done - ;; - esac + break + ;; + esac + fi + done case $cc_dll in "") cc_dll=$cc_dll_def ;; esac @@ -1319,9 +1228,7 @@ case $stdlib in fi tstlib="$tstlib $implib" if $cc -Dtype=void -Dcall=exit -c tstlib.$src && mv tstlib.$obj tst.$obj - then case $plusplus in - '') probe_lxx= ;; - esac + then probe_lxx= l= for sym in $probe_l $probe_lxx do case $l in @@ -1445,7 +1352,7 @@ case $stdlib in ok=0 for x in $xs do case $x in - *_p) continue ;; # linux gcc known to hang for -lc_p + *_p) continue ;; # Linux gcc known to hang for -lc_p esac if $cc -o doti.$exe doti.$obj -l$x 2>e then ok=1 @@ -1666,9 +1573,6 @@ done case $stdc in ?*) dialect="$dialect ANSI" ;; esac -case $plusplus in -?*) dialect="$dialect C++" ;; -esac case $hosted in "") dialect="$dialect CROSS" ;; esac diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/mamake.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/mamake.c index 4bcca91f5..89b7c697d 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/mamake.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/mamake.c @@ -2,6 +2,7 @@ * * * This software is part of the ast package * * Copyright (c) 1990-2011 AT&T Intellectual Property * +* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -17,7 +18,7 @@ * Glenn Fowler * * * ***********************************************************************/ -#pragma prototyped +#pragma clang diagnostic ignored "-Wdeprecated-register" #pragma clang diagnostic ignored "-Wparentheses" /* @@ -27,7 +28,7 @@ */ #define RELEASE_DATE "2021-01-21" -static char id[] = "\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\0\n"; +static char id[] = "\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\0\n"; #if _PACKAGE_ast @@ -35,8 +36,11 @@ static char id[] = "\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\0 #include static const char usage[] = -"[-?\n@(#)$Id: mamake (AT&T Research/ksh93) " RELEASE_DATE " $\n]" -USAGE_LICENSE +"[-?\n@(#)$Id: mamake (ksh 93u+m) " RELEASE_DATE " $\n]" +"[-author?Glenn Fowler ]" +"[-copyright?(c) 1994-2012 AT&T Intellectual Property]" +"[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh]" +"[-license?http://www.eclipse.org/org/documents/epl-v10.html]" "[+NAME?mamake - make abstract machine make]" "[+DESCRIPTION?\bmamake\b reads \amake abstract machine\a target and" " prerequisite file descriptions from a mamfile (see \b-f\b) and executes" @@ -106,7 +110,7 @@ USAGE_LICENSE #include #include -#if !_PACKAGE_ast && defined(__STDC__) +#if !_PACKAGE_ast #include #include #endif @@ -383,7 +387,7 @@ buffer(void) if (buf = state.old) state.old = state.old->old; else if (!(buf = newof(0, Buf_t, 1, 0)) || !(buf->buf = newof(0, char, CHUNK, 0))) - report(3, "out of space [buffer]", NiL, (unsigned long)0); + report(3, "out of memory [buffer]", NiL, (unsigned long)0); buf->end = buf->buf + CHUNK; buf->nxt = buf->buf; return buf; @@ -415,7 +419,7 @@ appendn(Buf_t* buf, char* str, int n) i = buf->nxt - buf->buf; m = (((buf->end - buf->buf) + n + CHUNK + 1) / CHUNK) * CHUNK; if (!(buf->buf = newof(buf->buf, char, m, 0))) - report(3, "out of space [buffer resize]", NiL, (unsigned long)0); + report(3, "out of memory [buffer resize]", NiL, (unsigned long)0); buf->end = buf->buf + m; buf->nxt = buf->buf + i; } @@ -450,7 +454,7 @@ duplicate(char* s) n = strlen(s); if (!(t = newof(0, char, n, 1))) - report(3, "out of space [duplicate]", s, (unsigned long)0); + report(3, "out of memory [duplicate]", s, (unsigned long)0); strcpy(t, s); return t; } @@ -465,7 +469,7 @@ dictionary(void) Dict_t* dict; if (!(dict = newof(0, Dict_t, 1, 0))) - report(3, "out of space [dictionary]", NiL, (unsigned long)0); + report(3, "out of memory [dictionary]", NiL, (unsigned long)0); return dict; } @@ -539,7 +543,7 @@ search(register Dict_t* dict, char* name, void* value) else if (value) { if (!(root = newof(0, Dict_item_t, 1, strlen(name)))) - report(3, "out of space [dictionary]", name, (unsigned long)0); + report(3, "out of memory [dictionary]", name, (unsigned long)0); strcpy(root->name, name); } if (root) @@ -606,7 +610,7 @@ rule(char* name) if (!(r = (Rule_t*)search(state.rules, name, NiL))) { if (!(r = newof(0, Rule_t, 1, 0))) - report(3, "out of space [rule]", name, (unsigned long)0); + report(3, "out of memory [rule]", name, (unsigned long)0); r->name = (char*)search(state.rules, name, (void*)r); } return r; @@ -625,7 +629,7 @@ cons(Rule_t* r, Rule_t* p) if (!x) { if (!(x = newof(0, List_t, 1, 0))) - report(3, "out of space [list]", r->name, (unsigned long)0); + report(3, "out of memory [list]", r->name, (unsigned long)0); x->rule = p; x->next = r->prereqs; r->prereqs = x; @@ -709,7 +713,7 @@ view(void) } n = strlen(s); if (!(vp = newof(0, View_t, 1, strlen(p) + n + 1))) - report(3, "out of space [view]", s, (unsigned long)0); + report(3, "out of memory [view]", s, (unsigned long)0); vp->node = n + 1; strcpy(vp->dir, s); *(vp->dir + n) = '/'; @@ -861,7 +865,7 @@ substitute(Buf_t* buf, register char* s) } if (c != '-') break; - /*FALLTHROUGH*/ + /* FALLTHROUGH */ case 0: case '=': case '}': @@ -1076,13 +1080,23 @@ push(char* file, Stdio_t* fp, int flags) else if (++state.sp >= &state.streams[elementsof(state.streams)]) report(3, "input stream stack overflow", NiL, (unsigned long)0); if (state.sp->fp = fp) - state.sp->file = "pipeline"; + { + if(state.sp->file) + free(state.sp->file); + state.sp->file = strdup("pipeline"); + if(!state.sp->file) + report(3, "out of memory [push]", NiL, (unsigned long)0); + } else if (flags & STREAM_PIPE) report(3, "pipe error", file, (unsigned long)0); else if (!file || !strcmp(file, "-") || !strcmp(file, "/dev/stdin")) { flags |= STREAM_KEEP; - state.sp->file = "/dev/stdin"; + if(state.sp->file) + free(state.sp->file); + state.sp->file = strdup("/dev/stdin"); + if(!state.sp->file) + report(3, "out of memory [push]", NiL, (unsigned long)0); state.sp->fp = stdin; } else @@ -1092,6 +1106,8 @@ push(char* file, Stdio_t* fp, int flags) { if (!(state.sp->fp = fopen(path, "r"))) report(3, "cannot read", path, (unsigned long)0); + if(state.sp->file) + free(state.sp->file); state.sp->file = duplicate(path); drop(buf); } @@ -1136,7 +1152,7 @@ input(void) /* * pass shell action s to ${SHELL:-/bin/sh} * the -c wrapper ensures that scripts are run in the selected shell - * even on systems that otherwise demand #! magic (can you say cygwin) + * even on systems that otherwise demand #! magic (can you say Cygwin) */ static int @@ -1443,6 +1459,7 @@ require(char* lib, int dontcare) Buf_t* tmp; struct stat st; + int tofree = 0; static int dynamic = -1; if (dynamic < 0) @@ -1487,7 +1504,10 @@ require(char* lib, int dontcare) } } if (r != lib) + { + tofree = 1; r = duplicate(r); + } search(state.vars, lib, r); append(tmp, lib + 2); append(tmp, ".req"); @@ -1516,6 +1536,8 @@ require(char* lib, int dontcare) } } fclose(f); + if(tofree) + free(r); r = use(buf); } else if (dontcare) @@ -1530,7 +1552,11 @@ require(char* lib, int dontcare) append(tmp, "rm -f x.${!-$$}.[cox]\n"); append(tmp, "exit $c\n"); if (execute(expand(buf, use(tmp)))) + { + if(tofree) + free(r); r = ""; + } } r = duplicate(r); search(state.vars, lib, r); @@ -2115,7 +2141,7 @@ main(int argc, char** argv) continue; case 'N': state.never = 1; - /*FALLTHROUGH*/ + /* FALLTHROUGH */ case 'n': append(state.opt, " -n"); state.exec = 0; @@ -2154,8 +2180,8 @@ main(int argc, char** argv) search(state.vars, "-strip-symbols", "1"); continue; case '?': - error(ERROR_USAGE|4, "%s", opt_info.arg); - continue; + error(ERROR_usage(2), "%s", opt_info.arg); + UNREACHABLE(); case ':': error(2, "%s", opt_info.arg); continue; @@ -2163,7 +2189,10 @@ main(int argc, char** argv) break; } if (error_info.errors) - error(ERROR_USAGE|4, "%s", optusage(NiL)); + { + error(ERROR_usage(2), "%s", optusage(NiL)); + UNREACHABLE(); + } argv += opt_info.index; #else while ((s = *++argv) && *s == '-') @@ -2220,7 +2249,7 @@ main(int argc, char** argv) continue; case 'N': state.never = 1; - /*FALLTHROUGH*/ + /* FALLTHROUGH */ case 'n': append(state.opt, " -n"); state.exec = 0; @@ -2275,6 +2304,7 @@ main(int argc, char** argv) break; default: report(2, "unknown option", s, (unsigned long)0); + /* FALLTHROUGH */ case '?': usage(); break; diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/mamprobe.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/mamprobe.sh index d3f513fc9..294a9aaf6 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/mamprobe.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/mamprobe.sh @@ -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 # diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/mktest.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/mktest.sh index f24183eed..cc237b7ee 100755 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/mktest.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/mktest.sh @@ -2,6 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2011 AT&T Intellectual Property # +# Copyright (c) 2020-2021 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # @@ -34,7 +35,9 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in [-? @(#)$Id: mktest (AT&T Labs Research) 2010-08-11 $ ] -'$USAGE_LICENSE$' +[-author?Glenn Fowler ] +[-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property] +[-license?http://www.eclipse.org/org/documents/epl-v10.html] [+NAME?mktest - generate a regression test scripts] [+DESCRIPTION?\bmktest\b generates regression test scripts from test template commands in the \aunit\a.\brt\b file. The generated test @@ -81,7 +84,7 @@ unit.rt [ unit [ arg ... ] ] [+PROG \acommand\a [ \aarg\a ... ]]?Run \acommand\a with optional arguments.] [+TEST [ \anumber\a ]] [ \adescription\a ... ]]?Define a new - test group with optional \anumber\a and \adescripion\a.] + test group with optional \anumber\a and \adescription\a.] [+TWD [ \adir\a ... ]]?Set the temporary test dir to \adir\a. The default is \aunit\a\b.tmp\b, where \aunit\a is the test input file sans directory and suffix. If \adir\a matches \b/*\b diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/mprobe.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/mprobe.sh index 975ebb1c2..92279603f 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/mprobe.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/mprobe.sh @@ -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 # diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/nsl.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/nsl.c index e961e0108..f168303ea 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/nsl.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/nsl.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/p.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/p.c index 387c4bbf4..73f826cc0 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/p.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/p.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/package.mk b/cde/programs/dtksh/ksh93/src/cmd/INIT/package.mk deleted file mode 100644 index 1a945d9fe..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/package.mk +++ /dev/null @@ -1,1537 +0,0 @@ -/* - * source and binary package support - * - * @(#)package.mk (AT&T Research) 2012-02-14 - * - * usage: - * - * cd $INSTALLROOT/lib/package - * nmake -f name [closure] [cyg|exp|lcl|pkg|rpm|tgz] [base|delta] type - * - * where: - * - * name package description file or component - * - * type source build source archive, generates - * $(PACKAGEDIR)/name.version.release.suffix - * binary build binary archive, generates - * $(PACKAGEDIR)/name.version.hosttype.release.suffix - * runtime build binary archive, generates - * $(PACKAGEDIR)/name-run.version.hosttype.release.suffix - * - * NOTE: $(PACKAGEDIR) is in the lowest view and is shared among all views - * - * generated archive member files are $(PACKAGEROOT) relative - * - * main assertions: - * - * NAME [ name=value ] :PACKAGE: component ... - * :OMIT: component ... - * :LICENSE: license-class-pattern - * :CATEGORY: category-id ... - * :COVERS: package ... - * :REQUIRES: package ... - * :INDEX: index description line - * :DESCRIPTION: - * [ verbose description ] - * :DETAILS: style - * :README: - * readme lines - * :EXPORT: - * name=value - * target :INSTALL: [ source ] - * - * option variables, shown with default values - * - * format=tgz - * archive format - * - * version=YYYY-MM-DD - * package base version (overrides current date) - * - * release=YYYY-MM-DD - * package delta release (overrides current date) - * - * license=type.class - * :LICENSE: type.class pattern override - * - * notice=1 - * include the conspicuous empty notice file - * - * copyright=0 - * do not prepend source file copyright notice - * - * strip=0 - * don't strip non-lcl binary package members - * - * variants=pattern - * include variants matching pattern in binary packages - * - * incremental=[source:1 binary:0] - * if a base archive is generated then also generate an - * incremental delta archive from the previous base - * - * NOTE: the Makerules.mk :PACKAGE: operator defers to :package: when - * a target is specified - */ - -/* these are ast centric -- we'll parameterize another day */ - -org = ast -url = http://www.research.att.com/sw/download - -/* generic defaults */ - -base = -category = utils -checksum = md5 -closure = -copyright = 1 -delta = -format = tgz -incremental = -index = -init = INIT -license = -licenses = $(org) -mamfile = 1 -opt = -name = -notice = -release = -strip = 0 -style = tgz -suffix = tgz -type = -variants = !(cc-g) -vendor = -version = $("":T=R%Y-%m-%d) - -SUM = sum - -package.notice = ------------ NOTICE -- LICENSED SOFTWARE -- SEE README FOR DETAILS ------------ - -package.readme = $(@.package.readme.) - -.package.readme. : - This is a package root directory $PACKAGEROOT. Source and binary - packages in this directory tree are controlled by the command - $() - bin/package - $() - Binary files may be in this directory or in the install root directory - $() - INSTALLROOT=$PACKAGEROOT/arch/`bin/package` - $() - For more information run - $() - bin/package help - $() - Many of the packaged commands self-document via the --man and --html - options; those that do have no separate man page. - $() - Each package is covered by one of the license files - $() - $(PACKAGELIB)/LICENSES/ - $() - where is the license type for the package. At the top - of each license file is a URL; the license covers all software that - refers to this URL. For details run - $() - bin/package license [] - $() - Any archives, distributions or packages made from source or - binaries covered by license(s) must contain the corresponding - license file(s)$(notice:?, this README file, and the empty file$$("\n")$$(package.notice)?.?) - -.package.licenses. : .FUNCTION - local I F L R T all save text - L := $(%) - while L == "--*" - I := $(L:O=1) - if I == "--all" - all = 1 - elif I == "--save" - save = 1 - elif I == "--text" - text = 1 - end - L := $(L:O>1) - end - if "$(L)" == "*-*" - L += $(L:/[^-]*-//) $(L:/-.*//) - end - L += $(licenses) - for I $(L:U) - if I == "gpl" - I = gnu - all = - end - if F = "$(I:D=$(PACKAGESRC):B:S=.lic:T=F)" - R += $(F) - if save || text - T := $(.FIND. lib/package .lic $(F):P=W,query=type) - R += $(T:D=$(PACKAGESRC)/LICENSES:B) - end - if save - R += $(F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F) - elif ! all - break - end - end - end - return $(R) - -/* - * glob(3) doesn't handle / in alternation -- should it? - */ - -.package.glob. : .FUNCTION - local A D I P S - for I $(%) - if I == "*/*" - D := $(I:C,/.*,,) - if ! "$(A:N=$(D))" - local S.$(D) - A += $(D) - end - S.$(D) += $(I:C,[^/]*/,,) - else - P := $(P)$(S)$(I) - end - S = | - end - if P == "*\|*" - P := ($(P)) - end - for I $(A) - P += $(I)/$(.package.glob. $(S.$(I))) - end - return $(P) - - -.MAKEINIT : .package.init - -.package.init : .MAKE .VIRTUAL .FORCE - local V - V := $(VROOT:T=F:P=L*) - if ! PACKAGEROOT - PACKAGEROOT := $(V:N!=*/arch/+([!/]):O=1) - end - if V == "$(PACKAGEROOT)" - V := - end - V += $(INSTALLROOT) $(PACKAGEROOT) - PACKAGEVIEW := $(V:H=RU) - INSTALLOFFSET := $(INSTALLROOT:C%$(PACKAGEROOT)/%%) - if license - license := $(license)|none.none - end - -PACKAGELIB = lib/package -PACKAGESRC = $(PACKAGEROOT)/$(PACKAGELIB) -PACKAGEBIN = $(INSTALLROOT)/$(PACKAGELIB) -PACKAGEDIR = $(PACKAGESRC)/$(style) -INSTALLOFFSET = $(INSTALLROOT:C%$(PACKAGEROOT)/%%) - -package.omit = -|*/$(init) -package.glob.all = $(INSTALLROOT)/src/*/*/($(MAKEFILES:/:/|/G)) -package.all = $(package.glob.all:P=G:W=O=$(?$(name):A=.VIRTUAL):N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) -package.glob.pkg = $(.package.glob. $(~$(name):P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%) $(~$(name):P=U:N=$(name):?$$(INSTALLROOT)/src/$$(name)/($$(MAKEFILES:/:/|/G))??) -package.pkg = $(package.glob.pkg:P=G:D:N!=$(package.omit):T=F:$(PACKAGEVIEW:C,.*,C;^&/;;,:/ /:/G):U) -package.closure = $(closure:?$$(package.all)?$$(package.pkg)?) - -package.init = $(.package.glob. $("$(init)$(name)":P=U):C%.*%$(INSTALLROOT)/src/*/&/($(MAKEFILES:/:/|/G))%:P=G:T=F:D::B) -package.ini = ignore mamprobe manmake package silent -package.src.pat = $(PACKAGESRC)/($(name).(ini|pkg)) -package.src = $(package.src.pat:P=G) $(.package.licenses. --save $(name)) -package.bin = $(PACKAGEBIN)/$(name).ini - -package.mam = --never --force --mam=static --corrupt=accept --clobber --compare --link='lib*.a*' CC=$(CC.DIALECT:N=C++:?CC?cc?) package.license.class=$(license:Q) $(=) 'dontcare test' install test - -op = current -stamp = [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9] -source = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(suffix) -binary = $(PACKAGEDIR)/$(name).$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) -runtime = $(PACKAGEDIR)/$(name)-run.$(version)$(release:?.$(release)??).$(CC.HOSTTYPE).$(suffix) -old.new.source = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(suffix) -old.new.binary = $(PACKAGEDIR)/$(name).$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) -old.new.runtime = $(PACKAGEDIR)/$(name)-run.$(version).$(old.version).$(CC.HOSTTYPE).$(suffix) - -source.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(suffix)":P=G:H=R) -binary.list = $("$(PACKAGEDIR)/$(name).*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H=R) -runtime.list = $("$(PACKAGEDIR)/$(name)-run.*$(stamp).$(CC.HOSTTYPE).$(suffix)":P=G:H>) - -source.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz.c":T=F) -binary.ratz = $("$(INSTALLROOT)/src/cmd/$(init)/ratz":T=F) - -$(init) : .VIRTUAL $(init) - -package.requires = 0 - -":package:" : .MAKE .OPERATOR - local P I R V - P := $(<:O=1) - $(P) : $(>:V) - if ! package.requires - if ! name - name := $(P) - .PACKAGE. := $(P) - if name == "$(init)" - package.omit = - - package.src += $(package.ini:C,^,$(PACKAGEROOT)/bin/,) $(PACKAGESRC)/package.mk - else - $(P) : $(package.init) - end - for I $(<:O>1) - if I == "*=*" - eval - $(I) - end - else - version := $(I) - end - end - LICENSEFILEDEFAULT := $(.package.licenses. $(name):@/ /:/G) - export LICENSEFILEDEFAULT - end - if "$(>)" - for I $(>:V) - $(I) : .VIRTUAL - if I == "/*" - package.dir += $(I:V) - end - end - end - if "$(@)" - $(P).README := $(@) - else - $(P).README := This is the $(P) package. - end - end - -":AUXILIARY:" : .MAKE .OPERATOR - package.auxiliary.$(style) += $(>:N=/*:T=F) $(>:N!=/*:C%^%$(INSTALLROOT)/%:T=F) - -":CATEGORY:" : .MAKE .OPERATOR - if ! package.requires - category := $(>) - end - -.covers. : .FUNCTION - local I C D F K=0 L - for I $(%) - if ! "$(~covers:N=$(I:B))" - if F = "$(I:D:B:S=.pkg:T=F)" - if D = "$(F:T=I)" - covers : $(I:B) - for L $(D) - if L == ":COVERS:" - K = 1 - elif L == ":*:" - if K - break - end - elif K - : $(.covers. $(L)) - end - end - end - else - error $(--exec:?3?1?) $(I): unknown package $(I) - end - end - end - -":COVERS:" : .MAKE .OPERATOR - if ! package.requires - : $(.covers. $(>)) - end - -":DESCRIPTION:" : .MAKE .OPERATOR - if ! package.requires - $(name).README := $(@:V) - end - -":DETAILS:" : .MAKE .OPERATOR - if ! package.requires - details.$(>:O=1) := $(@:V) - end - -":EXPORT:" : .MAKE .OPERATOR - if ! package.requires - export.$(style) := $(@:/$$("\n")/ /G) - end - -":INDEX:" : .MAKE .OPERATOR - if ! package.requires - index := $(>) - end - -":INSTALL:" : .MAKE .OPERATOR - if ! package.requires - local T S F X - S := $(>) - T := $(<) - if "$(exe.$(style))" && "$(T)" == "bin/*([!./])" - T := $(T).exe - end - if ! "$(S)" - S := $(T) - elif "$(exe.$(style))" && "$(S)" == "bin/*([!./])" - S := $(S).exe - end - install.$(style) := $(install.$(style):V)$("\n")install : $$(ROOT)/$(T)$("\n")$$(ROOT)/$(T) : $$(ARCH)/$(S)$("\n\t")cp $< $@ - if strip && "$(T:N=*.exe)" - install.$(style) := $(install.$(style):V)$("\n\t")strip $@ 2>/dev/null - end - X := $(PACKAGEROOT)/arch/$(CC.HOSTTYPE)/$(S) - if strip && "$(X:T=Y)" == "*/?(x-)(dll|exe)" - F := filter $(STRIP) $(STRIPFLAGS) $(X) - end - if "$(filter.$(style):V)" - filter.$(style) := $(filter.$(style):V)$$("\n") - end - filter.$(style) := $(filter.$(style):V);;$(F);$(X);usr/$(T) - end - -":LICENSE:" : .MAKE .OPERATOR - if ! package.requires && ! license - license := $(>) - end - -":OMIT:" : .MAKE .OPERATOR - if ! package.requires - package.omit := $(package.omit)|$(>:C,^,*/,:/ /|/G) - end - -":POSTINSTALL:" : .MAKE .OPERATOR - if ! package.requires - postinstall.$(style) := $(@:V) - end - -":README:" : .MAKE .OPERATOR - if ! package.requires - readme.$(style) := $(@:V) - end - -.requires. : .FUNCTION - local I C D F K=0 L V T M=0 - for I $(%) - if ! "$(~requires:N=$(I:B))" - if F = "$(I:D:B:S=.pkg:T=F)" - if I == "$(init)" - package.omit = - - else - requires : $(I:B) - end - if V = "$(I:D:B=gen/$(I:B):S=.ver:T=F)" - req : $(I:B) - else - error 1 $(I): package should be written before $(P) - end - let package.requires = package.requires + 1 - include "$(F)" - let package.requires = package.requires - 1 - else - error 1 $(I): package not found - end - end - end - -":REQUIRES:" : .MAKE .OPERATOR - : $(.requires. $(>)) - -":TEST:" : .MAKE .OPERATOR - if ! package.requires - local T - T := $(>) - if "$(T)" == "bin/*([!./])" - if "$(exe.$(style))" - T := $(T).exe - end - T := $$(PWD)/$$(ARCH)/$(T) - end - test.$(style) := $(test.$(style):V)$("\n")test : $(T:V)$("\n\t")$(@) - end - -base delta : .MAKE .VIRTUAL .FORCE - op := $(<) - -closure : .MAKE .VIRTUAL .FORCE - $(<) := 1 - -cyg exp lcl pkg rpm tgz : .MAKE .VIRTUAL .FORCE - style := $(<) - -source : .source.init .source.gen .source.$$(style) - -.source.init : .MAKE - local A B D P V I - type := source - if ! "$(incremental)" - incremental = 1 - end - if "$(source.$(name))" - suffix = c - end - : $(.init.$(style)) - : $(details.$(style):V:R) : - A := $(source.list) - B := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) - P := $(A:N=*.$(stamp).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) - D := $(A:N=*.$(stamp).$(stamp).$(suffix):O=1:T=F) - if op == "delta" - if ! B - error 3 delta requires a base archive - end - base := -z $(B) - deltaversion := $(B:B:/$(name).//) - let deltasince = $(deltaversion:/.*-//) + 1 - deltasince := $(deltaversion:/[^-]*$/$(deltasince:F=%02d)/) - if "$(release)" != "$(stamp)" - release := $("":T=R%Y-%m-%d) - end - source := $(B:D:B:S=.$(release).$(suffix)) - version := $(source:B:B:/$(name).//) - elif B || op == "base" - if op == "base" - for I $(B) $(P) - V := $(I:B:/$(name)\.\([^.]*\).*/\1/) - if V == "$(stamp)" && V != "$(version)" - old.version := $(V) - old.source := $(I) - if "$(old.version)" >= "$(version)" - error 3 $(name): previous base $(old.version) is newer than $(version) - end - break - end - end - else - source := $(B) - end - if B == "$(source)" - if "$(B:D:B:B)" == "$(D:D:B:B)" && "$(B:B::S)" != "$(D:B::S)" - error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) - end - error 1 $(B:B:S): replacing current base - end - version := $(source:B:S:/^$(name).\(.*\).$(suffix)$/\1/) - end - PACKAGEGEN := $(PACKAGESRC)/gen - -.source.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) $$(PACKAGEGEN)/SOURCE.html $$(PACKAGEGEN)/BINARY.html $$(PACKAGEGEN)/DETAILS.html - -BINPACKAGE := $(PATH:/:/ /G:X=package:T=F:O=1) - -$$(PACKAGEDIR) $$(PACKAGEGEN) : .IGNORE - [[ -d $(<) ]] || mkdir $(<) - -$$(PACKAGEGEN)/SOURCE.html : $(BINPACKAGE) - $(*) html source > $(<) - -$$(PACKAGEGEN)/BINARY.html : $(BINPACKAGE) - $(*) html binary > $(<) - -$$(PACKAGEGEN)/DETAILS.html : $(BINPACKAGE) - $(*) html intro > $(<) - -.source.exp .source.pkg .source.rpm : .MAKE - error 3 $(style): source package style not supported yet - -exe.cyg = .exe -vendor.cyg = gnu - -.name.cyg : .FUNCTION - local N - N := $(%) - if N == "*-*" - vendor := $(N:/-.*//) - if vendor == "$(vendor.cyg)" - vendor := - N := $(N:/[^-]*-//) - end - N := $(N:/-//G) - end - return $(N) - -.init.cyg : .FUNCTION - local N O - closure = 1 - init = . - strip = 1 - suffix = tar.bz2 - format = tbz - vendor := $(licenses:N!=$(vendor.cyg):O=1) - package.ini := $(package.ini) - package.src.pat := $(package.src.pat) - package.src := $(package.src) - package.bin := $(package.bin) - .source.gen : .CLEAR $(*.source.gen:V:N!=*.html) - name.original := $(name) - name := $(.name.cyg $(name)) - if name != "$(name.original)" - $(name) : $(~$(name.original)) - O := $(~covers) - covers : .CLEAR - for N $(O) - covers : $(.name.cyg $(N)) - end - end - stamp = [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-[0-9] - version.original := $(version) - version := $(version:/-//G)-1 - if opt - opt := $(opt)/$(vendor)/ - else - opt := $(name)-$(version)/ - end - if type == "source" - version := $(version)-src - source = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) - else - binary = $(PACKAGEDIR)/$(name)-$(version)$(release:?.$(release)??).$(suffix) - end - -.source.cyg : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - cat > $tmp/configure <<'!' - echo "you didn't have to do that" - ! - chmod +x $tmp/configure - echo ";;;$tmp/configure;configure" - cat > $tmp/Makefile0 <<'!' - HOSTTYPE := $$(shell bin/package) - ROOT = ../.. - ARCH = arch/$$(HOSTTYPE) - all : - PACKAGEROOT= CYGWIN="$$CYGWIN ntsec binmode" bin/package make $(export.$(style)) - install : all - $(install.$(style):V) - $(test.$(style):V) - ! - echo ";;;$tmp/Makefile0;Makefile" - cat > $tmp/CYGWIN-README <<'!' - $(readme.$(style):@?$$(readme.$$(style))$$("\n\n")??)To build binaries from source into the ./arch/`bin/package` tree run: - $() - make - $() - $(test.$(style):@?To test the binaries after building/installing run:$$("\n\n\t")make test$$("\n\n")??)To build and/or install the binaries run: - $() - make install - $() - The bin/package command provides a command line interface for all package - operations. The $(opt:/.$//) source and binary packages were generated by: - $() - package write cyg base source version=$(version.original) $(name.original) - package write cyg base binary version=$(version.original) $(name.original) - $() - using the $(org)-base package. To download and install the latest - $(org)-base source package in /opt/$(org) run: - $() - PATH=/opt/$(org)/bin:$PATH - cd /opt/$(org) - package authorize "NAME" password "PASSWORD" setup flat source $("\\") - $(url) $("\\") - $(org)-base - package make - $() - and export /opt/$(org)/bin in PATH to use. The NAME and PASSWORD signify your - agreement to the software license(s). All users get the same NAME and PASSWORD. - See $(url) for details. If multiple architectures may be built under - /opt/$(org) then drop "flat" and export /opt/$(org)/arch/`package`/bin in PATH - to use. To update previously downloaded packages from the same url simply run: - $() - cd /opt/$(org) - package setup - package make - $() - To download and install the latest $(org)-base binary package in - /opt/$(org) change "source" to "binary" and omit "package make". - ! - echo ";;;$tmp/CYGWIN-README;CYGWIN-PATCHES/README" - cat > $(source:/-src.$(suffix)//).setup.hint <<'!' - category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) - requires: cygwin - sdesc: "$(index)" - ldesc: "$($(name.original).README)" - ! - echo ";;;$(source:/-src.$(suffix)//).setup.hint;CYGWIN-PATCHES/setup.hint" - echo ";;;$(BINPACKAGE);bin/package" - cat > $tmp/Makefile <<'!' - :MAKE: - ! - echo ";;;$tmp/Makefile;src/Makefile" - echo ";;;$tmp/Makefile;src/cmd/Makefile" - echo ";;;$tmp/Makefile;src/lib/Makefile" - if [[ '$(mamfile)' == 1 ]] - then cat > $tmp/Mamfile1 <<'!' - info mam static - note source level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - echo ";;;$tmp/Mamfile1;src/Mamfile" - cat > $tmp/Mamfile2 <<'!' - info mam static - note component level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" - echo ";;;$tmp/Mamfile2;src/lib/Mamfile" - fi - $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) - echo ";;;$(PACKAGEGEN)/$(name.original).req" - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then if [[ '$(mamfile)' == 1 ]] - then (( o=m )) - s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) - if [[ $s ]] - then for j in $s - do if [[ -d $j ]] - then cd $j - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then (( m++ )) - $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/$j/Mamfile" - fi - cd $(INSTALLROOT)/$i - fi - done - if (( o != m )) - then (( m++ )) - cat > $tmp/$m.mam <<'!' - info mam static - note subcomponent level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - else (( m++ )) - $(MAKE) $(package.mam) $(export.$(style):Q) > $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - fi - $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) - fi - done - set -- $(package.dir:P=G) - for i - do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" - done - } | - { - : > $tmp/HEAD - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - --format=$(format) \ - --local \ - -wvf $(source) $(base) \ - $(PACKAGEVIEW:C%.*%-s",^&/,,"%) \ - $(vendor:?-s",^[^/],$(opt)&,"??) - $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) - rm -rf $tmp - fi - -.source.lcl : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) $(=) .FILES.+=Mamfile recurse list.package.local - done - set -- $(package.dir:P=G) - for i - do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" - done - } | - sort -t';' -k5,5 -u | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - -wvf $(source) $(base) \ - $(op:N=delta:?--format=gzip??) \ - $(PACKAGEVIEW:C%.*%-s",^&/,,"%) - rm -rf $tmp - fi - -.source.tgz : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - if [[ '$(init)' == '$(name)' ]] - then cat > $tmp/Makefile <<'!' - :MAKE: - ! - $(CMP) $(CMPFLAGS) $tmp/Makefile $(PACKAGEROOT)/src/Makefile && touch -r $(PACKAGEROOT)/src/Makefile $tmp/Makefile - echo ";;;$tmp/Makefile;src/Makefile" - cp $tmp/Makefile $tmp/Makefile1 - $(CMP) $(CMPFLAGS) $tmp/Makefile1 $(PACKAGEROOT)/src/cmd/Makefile && touch -r $(PACKAGEROOT)/src/cmd/Makefile $tmp/Makefile1 - echo ";;;$tmp/Makefile1;src/cmd/Makefile" - cp $tmp/Makefile $tmp/Makefile2 - $(CMP) $(CMPFLAGS) $tmp/Makefile2 $(PACKAGEROOT)/src/lib/Makefile && touch -r $(PACKAGEROOT)/src/lib/Makefile $tmp/Makefile2 - echo ";;;$tmp/Makefile2;src/lib/Makefile" - if [[ '$(mamfile)' == 1 ]] - then cat > $tmp/Mamfile1 <<'!' - info mam static - note source level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*/*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - $(CMP) $(CMPFLAGS) $tmp/Mamfile1 $(PACKAGEROOT)/src/Mamfile && touch -r $(PACKAGEROOT)/src/Mamfile $tmp/Mamfile1 - echo ";;;$tmp/Mamfile1;src/Mamfile" - cat > $tmp/Mamfile2 <<'!' - info mam static - note component level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - $(CMP) $(CMPFLAGS) $tmp/Mamfile2 $(PACKAGEROOT)/src/cmd/Mamfile && touch -r $(PACKAGEROOT)/src/cmd/Mamfile $tmp/Mamfile2 - echo ";;;$tmp/Mamfile2;src/cmd/Mamfile" - cp $tmp/Mamfile2 $tmp/Mamfile3 - $(CMP) $(CMPFLAGS) $tmp/Mamfile3 $(PACKAGEROOT)/src/lib/Mamfile && touch -r $(PACKAGEROOT)/src/lib/Mamfile $tmp/Mamfile3 - echo ";;;$tmp/Mamfile3;src/lib/Mamfile" - fi - fi - $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) - if [[ '$(~covers)' ]] - then for i in $(~covers) - do for j in lib pkg - do if [[ -f $(PACKAGESRC)/$i.$j ]] - then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - for j in ver req - do if [[ -f $(PACKAGEGEN)/$i.$j ]] - then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - done - for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) - do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" - done - fi - if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] - then echo $(name) $(version) $(release|version) 1 > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).ver || cp $tmp/t $(PACKAGEGEN)/$(name).ver - echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" - sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).req || cp $tmp/t $(PACKAGEGEN)/$(name).req - echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).inx || cp $tmp/t $(PACKAGEGEN)/$(name).inx - { - { - echo '$($(name).README)' - if [[ '$(~covers)' ]] - then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - } | fmt - package help source - package release $(name) - } > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).README || cp $tmp/t $(PACKAGEGEN)/$(name).README - echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" - { - echo '.xx title="$(name) package"' - echo '.xx meta.description="$(name) package"' - echo '.xx meta.keywords="software, package"' - echo '.MT 4' - echo '.TL' - echo '$(name) package' - echo '.H 1 "$(name) package"' - echo '$($(name).README)' - set -- $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F:D::B) - hot= - for i - do hot="$hot -e s/\\(\\<$i\\>\\)/\\\\h'0*1'\\1\\\\h'0'/" - done - set -- $(package.closure:B) - if (( $# )) - then echo 'Components in this package:' - echo '.P' - echo '.TS' - echo 'center expand;' - echo 'l l l l l l.' - if [[ $hot ]] - then hot="sed $hot" - else hot=cat - fi - for i - do echo $i - done | - pr -6 -t -s' ' | - $hot - echo '.TE' - fi - echo '.P' - if [[ '$(~covers)' ]] - then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - set -- $(.package.licenses. --all $(name)) - case $# in - 0) ;; - *) case $# in - 1) echo 'The software is covered by this license:' ;; - *) echo 'The software is covered by these licenses:' ;; - esac - echo .BL - for j - do i=$( $(PROTO) -l $j -p -h -o type=usage /dev/null | sed -e 's,.*\[-license?\([^]]*\).*,\1,' ) - echo .LI - echo ".xx link=\"$i\"" - done - echo .LE - echo 'Individual components may be covered by separate licenses;' - echo 'refer to the component source and/or binaries for more information.' - echo .P - ;; - esac - echo 'A recent' - echo '.xx link="release change log"' - echo 'is also included.' - cat $(package.closure:C,.*,$(INSTALLROOT)/&/PROMO.mm,:T=F) < /dev/null - echo '.H 1 "release change log"' - echo '.xx index' - echo '.nf' - package release $(name) | - sed -e 's/:::::::: \(.*\) ::::::::/.fi\$("\n").H 1 "\1 changes"\$("\n").nf/' - echo '.fi' - } | - $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t - $(STDED) $(STDEDFLAGS) $tmp/t <<'!' - /^$/,/^$/s/ changes$/,/^$/m// - w - q - ! - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).html || cp $tmp/t $(PACKAGEGEN)/$(name).html - echo ";;;$(PACKAGEGEN)/$(name).html;$(PACKAGELIB)/$(name).html" - if [[ '$(deltasince)' ]] - then { - echo '.xx title="$(name) package"' - echo '.xx meta.description="$(name) package $(version) delta $(release)"' - echo '.xx meta.keywords="software, package, delta"' - echo '.MT 4' - echo '.TL' - echo '$(name) package $(deltaversion) delta $(release)' - echo '.H 1 "$(name) package $(deltaversion) delta $(release) changes"' - echo '.nf' - package release $(deltasince) $(name) | - sed -e 's/:::::::: \(.*\) ::::::::/.H 2 \1/' - echo '.fi' - } | - $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $tmp/t - $(CMP) $(CMPFLAGS) $tmp/t $(PACKAGEGEN)/$(name).$(release).html || cp $tmp/t $(PACKAGEGEN)/$(name).$(release).html - echo ";;;$(PACKAGEGEN)/$(name).$(release).html;$(PACKAGELIB)/$(name).$(release).html" - fi - fi - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then if [[ '$(mamfile)' == 1 ]] - then (( o=m )) - s=$( $(MAKE) --noexec --recurse=list recurse 2>/dev/null ) - if [[ $s ]] - then for j in $s - do if [[ -d $j ]] - then cd $j - if [[ ! '$(license)' ]] || $(MAKE) --noexec --silent 'exit $$(LICENSECLASS:N=$(license):?0?1?)' . - then (( m++ )) - $(MAKE) $(package.mam) > $tmp/$m.mam - $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/$j/Mamfile && touch -r $(PACKAGEROOT)/$i/$j/Mamfile $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/$j/Mamfile" - fi - cd $(INSTALLROOT)/$i - fi - done - if (( o != m )) - then (( m++ )) - cat > $tmp/$m.mam <<'!' - info mam static - note subcomponent level :MAKE: equivalent - make install - make all - exec - ${MAMAKE} -r '*' ${MAMAKEARGS} - done all virtual - done install virtual - ! - $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - else (( m++ )) - $(MAKE) $(package.mam) > $tmp/$m.mam - $(CMP) $(CMPFLAGS) $tmp/$m.mam $(PACKAGEROOT)/$i/Mamfile && touch -r $(PACKAGEROOT)/$i/Mamfile $tmp/$m.mam - echo ";;;$tmp/$m.mam;$i/Mamfile" - fi - fi - $(MAKE) --noexec $(-) $(=) recurse list.package.$(type) package.license.class=$(license:Q) $(copyright:N=1:??LICENSE=?) - fi - done - set -- $(package.dir:P=G) - for i - do tw -d $i -e "action:printf(';;;%s;%s\n',path,path);" - done - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - $(CMP) $(CMPFLAGS) $tmp/README $(PACKAGEROOT)/README && touch -r $(PACKAGEROOT)/README $tmp/README - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - -wvf $(source) $(base) \ - $(op:N=delta:?--format=gzip??) \ - $(PACKAGEVIEW:C%.*%-s",^&/,,"%) - $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) - echo local > $(source:D:B=$(name):S=.tim) - if [[ '$(incremental)' == 1 && '$(old.source)' ]] - then $(PAX) -rf $(source) -wvf $(old.new.source) -z $(old.source) - $(SUM) -x $(checksum) < $(old.new.source) > $(old.new.source:D:B:S=.$(checksum)) - fi - rm -rf $tmp - else if [[ '$(old.source)' ]] && $(CMP) $(CMPFLAGS) $(source.$(name)) $(source) - then : $(name) is up to date - else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - : > $(PACKAGEGEN)/$(name).req - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - echo '.xx title="$(name) package"' - echo '.xx meta.description="$(name) package"' - echo '.xx meta.keywords="software, package"' - echo '.MT 4' - echo '.TL' - echo '$(name) package' - echo '.H 1' - echo '$($(name).README)' - } | - $(MM2HTML) $(MM2HTMLFLAGS) -o nohtml.ident > $(PACKAGEGEN)/$(name).html - if [[ '$(source.$(name))' ]] - then { - echo '$($(name).README)' - package help source - } > $(PACKAGEGEN)/$(name).README - cp $(source.$(name)) $(source) - $(SUM) -x $(checksum) < $(source) > $(source:D:B:S=.$(checksum)) - fi - echo local > $(source:D:B=$(name):S=.tim) - fi - fi - -binary : .binary.init .binary.gen .binary.$$(style) - -.binary.init : .MAKE - local A B D I P V - type := binary - if ! "$(incremental)" - incremental = 0 - end - if ! "$(~$(name))" - if name == "ratz" - suffix = exe - else - suffix = gz - end - end - : $(.init.$(style)) : - : $(details.$(style):V:R) : - A := $(binary.list) - B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) - P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) - D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) - if op == "delta" - if ! B - error 3 delta requires a base archive - end - base := -z $(B) - if "$(release)" != "$(stamp)" - release := $("":T=R%Y-%m-%d) - end - binary := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) - version := $(binary:B:B:/$(name).//) - elif B || op == "base" - if op == "base" - for I $(B) $(P) - V := $(I:B:/$(name)\.\([^.]*\).*/\1/) - if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" - old.version := $(V) - old.binary := $(I) - if "$(old.version)" >= "$(version)" - error 3 $(name): previous base $(old.version) is newer than $(version) - end - break - end - end - else - binary := $(B) - end - if B == "$(binary)" - if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" - error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) - end - error 1 $(B:B:S): replacing current base - end - version := $(binary:B:/$(name).//:/\..*//) - end - PACKAGEGEN := $(PACKAGEBIN)/gen - -.binary.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) - -.binary.exp .binary.pkg .binary.rpm : .MAKE - error 3 $(style): binary package style not supported yet - -.binary.cyg : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - integer m=0 o - { - echo '$($(name.original).README)' | fmt - cat <<'!' - $(readme.$(style):@?$$("\n")$$(readme.$$(style))??) - ! - } > $tmp/README1 - echo ";;;$tmp/README1;usr/share/doc/Cygwin/$(opt:/.$//).README" - { - echo '$($(name.original).README)' | fmt - cat <<'!' - $() - The remainder of this file is the README from the source package - that was used to generate this binary package. It describes - the source build hierarchy, not the current directory. - $() - $(package.readme) - ! - } > $tmp/README2 - echo ";;;$tmp/README2;usr/share/doc/$(opt)README" - package release $(name.original) > $tmp/RELEASE - echo ";;;$tmp/RELEASE;usr/share/doc/$(opt)RELEASE" - cat > $(binary:/.$(suffix)//).setup.hint <<'!' - category: $(category:/\(.\).*/\1/U)$(category:/.\(.*\)/\1/L) - requires: cygwin - sdesc: "$(index)" - ldesc: "$($(name.original).README)" - ! - set -- $(.package.licenses. --text $(name.original):N!=*.lic) - for i - do echo ";;;${i};usr/share/doc/$(opt)LICENSE-${i##*/}" - done - cat <<'!' - $(filter.$(style)) - ! - if [[ '$(postinstall.$(style):V:O=1:?1??)' ]] - then cat >$tmp/postinstall <<'!' - $("#")!/bin/sh - $(postinstall.$(style)) - ! - echo ";;;$tmp/postinstall;etc/postinstall/$(name).sh" - fi - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - --format=$(format) \ - --local \ - -wvf $(binary) - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - rm -rf $tmp - fi - -.binary.lcl : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - $(package.src:U:T=F:/.*/echo ";;;&"$("\n")/) - $(package.bin:U:T=F:/.*/echo ";;;&"$("\n")/) - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) recurse list.package.$(type) package.license.class=$(license:Q) cc- - done - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - --checksum=md5:$(PACKAGEGEN)/$(name).sum \ - --install=$(PACKAGEGEN)/$(name).ins \ - -wvf $(binary) $(base) \ - $(op:N=delta:?--format=gzip??) \ - -s",^$tmp/,$(INSTALLOFFSET)/," \ - $(PACKAGEROOT:C%.*%-s",^&/,,"%) - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) - rm -rf $tmp - fi - -.binary.tgz : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - if [[ '$(init)' == '$(name)' ]] - then for i in lib32 lib64 - do if [[ -d $(INSTALLROOT)/$i ]] - then echo ";physical;;$(INSTALLROOT)/$i" - fi - done - fi - $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) - $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - if [[ '$(PACKAGEDIR:B)' == '$(style)' ]] - then echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" - if [[ '$(~covers)' ]] - then for i in $(~covers) - do for j in lic pkg - do if [[ -f $(PACKAGESRC)/$i.$j ]] - then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - for j in ver req - do if [[ -f $(PACKAGEGEN)/$i.$j ]] - then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - done - for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) - do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" - done - fi - sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req - echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - { - echo '$($(name).README)' - if [[ '$(~covers)' ]] - then echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - } | fmt - package help binary - package release $(name) - } > $(PACKAGEGEN)/$(name).README - echo ";;;$(PACKAGEGEN)/$(name).README;$(PACKAGELIB)/$(name).README" - fi - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- - done - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - --checksum=md5:$(PACKAGEGEN)/$(name).sum \ - --install=$(PACKAGEGEN)/$(name).ins \ - -wvf $(binary) $(base) \ - $(op:N=delta:?--format=gzip??) \ - -s",^$tmp/,$(INSTALLOFFSET)/," \ - $(PACKAGEROOT:C%.*%-s",^&/,,"%) - echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) - if [[ '$(incremental)' == 1 && '$(old.binary)' ]] - then $(PAX) -rf $(binary) -wvf $(old.new.binary) -z $(old.binary) - echo $(old.new.binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(old.new.binary) > $(old.new.binary:D:B:S=.$(checksum)) - echo $(old.new.binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - fi - rm -rf $tmp - else if [[ '$(binary.$(name))' ]] - then exe=$(binary.$(name)) - else exe=$(INSTALLROOT)/bin/$(name) - fi - if [[ '$(old.binary)' ]] && $(CMP) $(CMPFLAGS) $exe $(binary) - then : $(name) is up to date - else echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - : > $(PACKAGEGEN)/$(name).req - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - echo '$($(name).README)' - package help binary - } > $(PACKAGEGEN)/$(name).README - case "$(binary)" in - *.gz) gzip < $exe > $(binary) ;; - *) cp $exe $(binary) ;; - esac - $(SUM) -x $(checksum) < $(binary) > $(binary:D:B:S=.$(checksum)) - echo local > $(binary:D:B=$(name):S=.$(CC.HOSTTYPE).tim) - fi - echo $(binary) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - echo $(binary:D:B:S=.$(checksum)) >> $(binary:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - fi - -runtime : .runtime.init .runtime.gen .runtime.$$(style) - -.runtime.init : .MAKE - local A B D I P V - type := runtime - if ! "$(incremental)" - incremental = 0 - end - if ! "$(~$(name))" - if name == "ratz" - suffix = exe - else - suffix = gz - end - end - : $(.init.$(style)) : - : $(details.$(style):V:R) : - A := $(runtime.list) - B := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=1:T=F) - P := $(A:N=*.$(stamp).$(CC.HOSTTYPE).$(suffix):N!=*.$(stamp).$(stamp).*:O=2:T=F) - D := $(A:N=*.$(stamp).$(stamp).$(CC.HOSTTYPE).$(suffix):O=1:T=F) - if op == "delta" - if ! B - error 3 delta requires a base archive - end - base := -z $(B) - if "$(release)" != "$(stamp)" - release := $("":T=R%Y-%m-%d) - end - runtime := $(B:/$(CC.HOSTTYPE).$(suffix)$/$(release).&/) - version := $(runtime:B:B:/$(name).//) - elif B || op == "base" - if op == "base" - for I $(B) $(P) - V := $(I:B:/$(name)-run\.\([^.]*\).*/\1/) - if V == "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]" && V != "$(version)" - old.version := $(V) - old.runtime := $(I) - if "$(old.version)" >= "$(version)" - error 3 $(name): previous base $(old.version) is newer than $(version) - end - break - end - end - else - runtime := $(B) - end - if B == "$(runtime)" - if "$(B:D:B)" == "$(D:D:B)" && "$(B:S)" != "$(D:S)" - error 3 $(B:B:S): base overwrite would invalidate delta $(D:B:S) - end - error 1 $(B:B:S): replacing current base - end - version := $(runtime:B:/$(name)-run.//:/\..*//) - end - PACKAGEGEN := $(PACKAGESRC)/gen - -.runtime.gen : $$(PACKAGEDIR) $$(PACKAGEGEN) - -.runtime.cyg .runtime.exp .runtime.lcl .runtime.pkg .runtime.rpm : .MAKE - error 3 $(style): runtime package style not supported yet - -.runtime.tgz : - if [[ '$(~$(name))' ]] - then tmp=/tmp/pkg$(tmp) - mkdir $tmp - { - if [[ '$(init)' == '$(name)' ]] - then for i in lib32 lib64 - do if [[ -d $(INSTALLROOT)/$i ]] - then echo ";physical;;$(INSTALLROOT)/$i" - fi - done - fi - $(package.src:U:T=F:C%^$(PACKAGEROOT)/%%:C%.*%echo ";;;$(PACKAGEROOT)/&;&"$("\n")%) - $(package.bin:U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - $(package.auxiliary.$(style):U:T=F:C%^$(INSTALLROOT)/%%:C%.*%echo ";;;$(INSTALLROOT)/&;&"$("\n")%) - echo $(name) $(version) $(release|version) 1 > $(PACKAGEGEN)/$(name).ver - echo ";;;$(PACKAGEGEN)/$(name).ver;$(PACKAGELIB)/$(name).ver" - if [[ '$(~covers)' ]] - then for i in $(~covers) - do for j in lic pkg - do if [[ -f $(PACKAGESRC)/$i.$j ]] - then echo ";;;$(PACKAGESRC)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - for j in ver req - do if [[ -f $(PACKAGEGEN)/$i.$j ]] - then echo ";;;$(PACKAGEGEN)/$i.$j;$(PACKAGELIB)/$i.$j" - fi - done - done - for i in $(~covers:D=$(PACKAGESRC):B:S=.lic:T=F:T=I:N=*.def:D=$(PACKAGESRC):B:S:T=F:B:S) - do echo ";;;$(PACKAGESRC)/$i;$(PACKAGELIB)/$i" - done - fi - sed 's,1$,0,' $(~req:D=$(PACKAGEGEN):B:S=.ver:T=F) < /dev/null > $(PACKAGEGEN)/$(name).req - echo ";;;$(PACKAGEGEN)/$(name).req;$(PACKAGELIB)/$(name).req" - { - echo "name='$(name)'" - echo "index='$(index)'" - echo "covers='$(~covers)'" - echo "requires='$(~req)'" - } > $(PACKAGEGEN)/$(name).inx - { - { - echo '$($(name).README)' - if [[ '$(~covers)' ]] - then echo - echo "This package is a superset of the following package$(~covers:O=2:?s??): $(~covers); you won't need $(~covers:O=2:?these?this?) if you download $(name)." - fi - if [[ '$(~requires)' ]] - then echo - echo 'It requires the following package$(~requires:O=2:?s??): $(~requires).' - fi - echo - echo "To install this $(type) package read the tarball into a directory" - echo "suitable for containing bin and lib subdirectories, and run the" - echo "$(PACKAGELIB)/gen/$(name)-run.ins script to fix up permissions." - echo - echo "To use the package export the bin directory in PATH. The commands and" - echo "libraries use \$PATH to locate dynamic libraries and related data files." - echo - } | fmt - } > $(PACKAGEGEN)/$(name)-run.README - echo ";;;$(PACKAGEGEN)/$(name)-run.README;$(PACKAGELIB)/$(name)-run.README" - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - $(MAKE) --noexec $(-) --variants=$(variants:Q) $(=) package.strip=$(strip) recurse list.package.$(type) package.license.class=$(license:Q) cc- - done - } | - { - : > $tmp/HEAD - [[ '$(notice)' ]] && echo ";;;$tmp/HEAD;$(package.notice)" - cat > $tmp/README <<'!' - $(package.readme) - ! - echo ";;;$tmp/README;README" - sort -t';' -k5,5 -u - : > $tmp/TAIL - [[ '$(notice)' ]] && echo ";;;$tmp/TAIL;$(package.notice)" - } | - $(PAX) --filter=- \ - --to=ascii \ - $(op:N=delta:??--format=$(format)?) \ - --local \ - --checksum=md5:$(PACKAGEGEN)/$(name)-run.sum \ - --install=$(PACKAGEGEN)/$(name)-run.ins \ - -wvf $(runtime) $(base) \ - $(op:N=delta:?--format=gzip??) \ - -s",^$tmp/,$(INSTALLOFFSET)/," \ - $(PACKAGEROOT:C%.*%-s",^&/,,"%) - echo $(runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(runtime) > $(runtime:D:B:S=.$(checksum)) - echo $(runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - echo local > $(runtime:D:B=$(name)-run:S=.$(CC.HOSTTYPE).tim) - if [[ '$(incremental)' == 1 && '$(old.runtime)' ]] - then $(PAX) -rf $(runtime) -wvf $(old.new.runtime) -z $(old.runtime) - echo $(old.new.runtime) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - $(SUM) -x $(checksum) < $(old.new.runtime) > $(old.new.runtime:D:B:S=.$(checksum)) - echo $(old.new.runtime:D:B:S=.$(checksum)) >> $(runtime:D:B=PACKAGE:S=.$(CC.HOSTTYPE).lst) - fi - rm -rf $tmp - fi - -list.installed list.manifest : - set -- $(package.closure) - for i - do cd $(INSTALLROOT)/$i - ignore $(MAKE) --noexec $(-) $(=) $(<) - done diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/package.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/package.sh index dfbedb435..1559ef771 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/package.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/package.sh @@ -2,6 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2012 AT&T Intellectual Property # +# Copyright (c) 2020-2021 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # @@ -17,61 +18,68 @@ # Glenn Fowler # # # ######################################################################## -### this script contains archaic constructs that work with all sh variants ### -# package - source and binary package control -# Glenn Fowler +### this sh script is POSIX compliant and compatible with shell bugs ### +# KornShell 93u+m build system, main control script # +# based on AST 'package' by Glenn Fowler # +# simplified and rewritten by Martijn Dekker # +######################################################################## -command=package +# Escape from a non-POSIX shell +# ('test X -ef Y' is technically non-POSIX, but practically universal) +min_posix='test / -ef / && path=Bad && case $PATH in (Bad) exit 1;; esac && '\ +'PWD=Bad && cd -P -- / && case $PWD in (/) ;; (*) exit 1;; esac && '\ +'! { ! case x in ( x ) : ${0##*/} || : $( : ) ;; esac; } && '\ +'trap "exit 0" 0 && exit 1' +if (eval "$min_posix") 2>/dev/null +then : good shell +else "$SHELL" -c "$min_posix" 2>/dev/null && exec "$SHELL" -- "$0" ${1+"$@"} + sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} + DEFPATH=`getconf PATH` 2>/dev/null || DEFPATH=/usr/xpg4/bin:/bin:/usr/bin:/sbin:/usr/sbin + PATH=$DEFPATH:$PATH + export PATH + sh -c "$min_posix" 2>/dev/null && exec sh -- "$0" ${1+"$@"} + echo "$0: Can't escape from obsolete or broken shell. Run me with a POSIX shell." >&2 + exit 128 +fi +readonly min_posix # use for checksh() +# Set standards compliance mode (command set -o posix) 2>/dev/null && set -o posix -path=Bad -case $PATH in -Bad*) echo "Cannot be run by zsh in native mode; use a sh symlink to zsh" >&2 - exit 1 ;; -esac +# Sanitize 'cd' unset CDPATH + +# Make the package root the current working directory +# This makes it possible to run '/my/path/package make' without cd'ing first +# (for all its featuritis, the AT&T version never could manage this) case $0 in --*) +[0123456789+-]*) echo "dodgy \$0: $0" >&2 - exit 1 ;; -*/package) - mydir=`echo "$0" | sed 's,/package$,,'` - cd "$mydir" || exit - case $PWD in - */bin) ;; - *) echo "this script must live in bin/" >&2 - exit 1 ;; - esac - cd .. || exit - unset mydir ;; -package) - echo "this script must be invoked with a direct path, e.g. bin/package" >&2 - exit 1 ;; + exit 128 ;; +*/*) + me=$0 ;; *) - echo "this script must be named 'package'" >&2 - exit 1 ;; + me=$(command -v "$0") || exit 128 ;; esac +me=$(dirname "$me") +cd "$me" || exit +unset -v me +case $PWD in +*/arch/*/*/bin) + cd .. ;; +*/arch/*/bin) + cd ../../.. ;; +*/bin) + cd .. ;; +*) + echo "this script must live in bin/" >&2 + exit 1 ;; +esac || exit # shell checks checksh() { - "$1" -ec ' - # reject csh - case 1 in - 1) ;; - esac - # reject special use of $path (to use zsh, use a "sh -> zsh" symlink, which disables this) - path=Bad - case $PATH in - Bad*) exit 1 ;; - esac - # catch (our own) pipe/socket configuration mismatches - date | "$1" -c "read x" || exit 1 - # check Bourne/POSIX compatible trap exit status (should exit with status 0) - trap "exit 0" 0 - exit 1 - ' x "$1" 2>/dev/null || return 1 + "$1" -c "$min_posix" 2>/dev/null || return 1 } LC_ALL=C @@ -83,94 +91,65 @@ export TMPDIR src="cmd contrib etc lib" use="/usr/common /exp /usr/local /usr/add-on /usr/addon /usr/tools /usr /opt" usr="/home" -lib="" # nee /usr/local/lib /usr/local/shlib +lib="" # need /usr/local/lib /usr/local/shlib ccs="/usr/kvm /usr/ccs/bin" org="gnu GNU" makefiles="Mamfile" # ksh 93u+m no longer uses these: Nmakefile nmakefile Makefile makefile -env="HOSTTYPE NPROC PACKAGEROOT INSTALLROOT PATH" -checksum=md5sum -checksum_commands="$checksum md5" -checksum_empty="d41d8cd98f00b204e9800998ecf8427e" +env="HOSTTYPE PACKAGEROOT INSTALLROOT PATH" package_use='=$HOSTTYPE=$PACKAGEROOT=$INSTALLROOT=$EXECROOT=$CC=' -PACKAGE_admin_tail_timeout=${PACKAGE_admin_tail_timeout:-"1m"} - CROSS=0 -admin_db=admin.db -admin_env=admin.env -admin_ditto="ditto --checksum --delete --verbose" -admin_ditto_update=--update -admin_ditto_skip="OFFICIAL|core|old|*.core|*.tmp|.nfs*" -admin_list='PACKAGE.$type.lst' -admin_ping="ping -c 1 -w 5" - -default_url=default.url MAKESKIP=${MAKESKIP:-"*[-.]*"} -RATZ=ratz -SED= -TAR=tar -TARFLAGS=xv -TARPROBE=B -TR= all_types='*.*|sun4' # all but sun4 match *.* -case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in +command=${0##*/} +case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in 0123) USAGE=$' [-? -@(#)$Id: package (AT&T Research) 2012-06-28 $ -]'$USAGE_LICENSE$' -[+NAME?package - source and binary package control] -[+DESCRIPTION?The \bpackage\b command controls source and binary - packages. It is a \bsh\b(1) script coded for maximal portability. All - package files are in the \b$PACKAGEROOT\b directory tree. - \b$PACKAGEROOT\b must at minimum contain a \bbin/package\b command or a - \blib/package\b directory. Binary package files are in the - \b$INSTALLROOT\b (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where - \ahosttpe\a=`\bpackage\b`. All \aactions\a but \bhost\b and \buse\b - require the current directory to be under \b$PACKAGEROOT\b. See - \bDETAILS\b for more information.] +@(#)$Id: '$command$' (ksh 93u+m) 2021-12-31 $ +] +[-author?Glenn Fowler ] +[-author?Contributors to https://github.com/ksh93/ksh] +[-copyright?(c) 1994-2012 AT&T Intellectual Property] +[-copyright?(c) 2020-2021 Contributors to https://github.com/ksh93/ksh] +[-license?http://www.eclipse.org/org/documents/epl-v10.html] +[+NAME?'$command$' - build, test and install ksh 93u+m] +[+DESCRIPTION?The \b'$command$'\b command is the main control script + for building and installing KornShell 93u+m. + It is a POSIX \bsh\b(1) script coded for maximal portability. + A POSIX shell and C compiler installation are the only requirements. + All package files are in the \b$PACKAGEROOT\b directory tree. + Binary package files are in the \b$INSTALLROOT\b + (\b$PACKAGEROOT/arch/\b\ahosttype\a) tree, where + \ahosttype\a=$(\bbin/package host type\b). + See \bDETAILS\b for more information.] [+?Note that no environment variables need be set by the user; - \bpackage\b determines the environment based on the current working + \b'$command$'\b determines the environment based on the current working directory. The \buse\b action starts a \bsh\b(1) with the environment initialized. \bCC\b, \bCCFLAGS\b, \bHOSTTYPE\b and \bSHELL\b may be set by explicit command argument assignments to override the defaults.] -[+?Packages are composed of components. Each component is built and - installed by an \bast\b \bnmake\b(1) makefile. Each package is also - described by an \bnmake\b makefile that lists its components and - provides a content description. The package makefile and component - makefiles provide all the information required to read, write, build - and install packages.] -[+?Package recipients only need \bsh\b(1) and \bcc\b(1) to build and - install source packages, and \bsh\b to install binary packages. - \bnmake\b and \bksh93\b are required to write new packages. An - \b$INSTALLROOT/bin/cc\b script may be supplied for some architectures. - This script supplies a reasonable set of default options for compilers - that accept multiple dialects or generate multiple object/executable - formats.] [+?The command arguments are composed of a sequence of words: zero or more \aqualifiers\a, one \aaction\a, and zero or more action-specific - \aarguments\a, and zero or more \aname=value\a definitions. \apackage\a - names a particular package. The naming scheme is a \b-\b separated - hierarchy; the leftmost parts describe ownership, e.g., - \bgnu-fileutils\b, \bast-base\b. If no packages are specified then all - packages are operated on. \boptget\b(3) documentation options are also - supported. The default with no arguments is \bhost type\b.] + \aarguments\a, and zero or more \aname=value\a definitions. + \boptget\b(3) documentation options such as \b--man\b, \b--html\b + and \b--nroff\b are also supported. + The default with no arguments is \bhost type\b.] [+?The qualifiers are:] { - [+authorize \aname\a?Remote authorization user name or license - acceptance phrase.] [+debug|environment?Show environment and actions but do not execute.] - [+flat?Collapse \b$INSTALLROOT\b { bin fun include lib } onto - \b$PACKAGEROOT\b.] + [+flat?With the \bmake\b action, create a flat view by linking all + files from \b$INSTALLROOT\b, minus \b*.old\b files, + onto their corresponding path under \b$PACKAGEROOT\b. + Only one architecture can have a flat view. + If \bflat\b is specified with the \bclean\b action, then + only clean up this flat view and do not delete \b$INSTALLROOT\b.] [+force?Force the action to override saved state.] [+never?Run make -N and show other actions.] [+only?Only operate on the specified packages.] - [+password \apassword\a?Remote authorization or license - acceptance password.] [+quiet?Do not list captured action output.] [+show?Run make -n and show other actions.] [+verbose?Provide detailed action output.] @@ -178,64 +157,11 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in } [+?The actions are:] { - [+admin\b [\ball\b]] [\bdb\b \afile\a]] [\bon\b \apattern\a]][\aaction\a ...]]?Apply - \aaction\a ... to the hosts listed in \afile\a. If \afile\a is - omitted then \badmin.db\b is assumed. The caller must have - \brcp\b(1) and \brsh\b(1) or \bscp\b(1) and \bssh\b(1) access - to the hosts. Output for \aaction\a is saved per-host in the - file \aaction\a\b.log/\b\ahost\a. Logs can be viewed by - \bpackage admin\b [\bon\b \ahost\a]] \bresults\b [\aaction\a]]. - By default only local PACKAGEROOT hosts are selected from - \afile\a; \ball\b selects all hosts. \bon\b \apattern\a selects - only hosts matching the \b|\b separated \apattern\a. \afile\a - contains four types of lines. Blank lines and lines beginning - with \b#\b are ignored. Lines starting with \aid\a=\avalue\a - are variable assignments. Set admin_ping to local conventions - if \"'$admin_ping$'\" fails. If a package list is not specified - on the command line the \aaction\a applies to all packages; a - variable assignment \bpackage\b=\"\alist\a\" applies \aaction\a - to the packages in \alist\a for subsequent hosts in \afile\a. - The remaining line type is a host description consisting of 6 - tab separated fields. The first 3 are mandatory; the remaining - 3 are updated by the \badmin\b action. \afile\a is saved in - \afile\a\b.old\b before update. The fields are:] - { - [+hosttype?The host type as reported by - \"\bpackage\b\".] - [+[user@]]host?The host name and optionally user name - for \brcp\b(1) and \brsh\b(1) access.] - [+[remote::[[master]]::]]]]PACKAGEROOT?The absolute remote package - root directory and optionally the remote protocol (rsh - or ssh) if the directory is on a different server than - the master package root directory. If - \blib/package/admin/'$admin_env$'\b exists under this - directory then it is sourced by \bsh\b(1) before - \aaction\a is done. If this field begins with \b-\b - then the host is ignored. If this field contains \b:\b - then \bditto\b(1) is used to sync the remote \bsrc\b - directory hierarchy to the local one. If [\amaster\a]]: - is specified then the sync is deferred to the \amaster\a - host. If \amaster\a is omitted (two :) then the sync is - disabled. These directories must exist on the remote side: - \blib/package\b, \bsrc/cmd\b, \bsrc/lib\b.] - [+date?\aYYMMDD\a of the last action.] - [+time?Elapsed wall time for the last action.] - [+M T W?The \badmin\b action \bmake\b, \btest\b and - \bwrite\b action error counts. A non-numeric value in - any of these fields disables the corresponding action.] - [+owner?The owner contact information.] - [+attributes?\aname=value\a attributes. Should at least contain - \bcc\b=\acompiler-version\a.] - } - [+clean | clobber?Delete the \barch/\b\aHOSTTYPE\a hierarchy; this + [+clean | clobber?Clean up the flat view, if any. + Then, unless \bflat\b was given, + delete the \barch/\b\aHOSTTYPE\a hierarchy; this deletes all generated files and directories for \aHOSTTYPE\a. - The hierarchy can be rebuilt by \bpackage make\b.] - [+contents\b [ \apackage\a ... ]]?List description and - components for \apackage\a on the standard output.] - [+copyright\b [ \apackage\a ... ]]?List the general copyright - notice(s) for \apackage\a on the standard output. Note that - individual components in \apackage\a may contain additional or - replacement notices.] + The hierarchy can be rebuilt by \b'$command$' make\b.] [+export\b [ \avariable\a ...]]?List \aname\a=\avalue\a for \avariable\a, one per line. If the \bonly\b attribute is specified then only the variable values are listed. If no @@ -249,11 +175,11 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in \aattribute\a order. The attributes are:] { [+canon \aname\a?An external host type name to be - converted to \bpackage\b syntax.] - [+cpu?The number of cpus; 1 if the host is not a + converted to \b'$command$'\b syntax.] + [+cpu?The number of CPUs; 1 if the host is not a multiprocessor.] [+name?The host name.] - [+rating?The cpu rating in pseudo mips; the value is + [+rating?The CPU rating in pseudo mips; the value is useful useful only in comparisons with rating values of other hosts. Other than a vax rating (mercifully) fixed at 1, ratings can vary wildly but consistently from @@ -268,188 +194,45 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in release incompatibilities has for the most part been futile.] } - [+html\b [ \aaction\a ]]?Display html help text on the standard - error (standard output for \aaction\a).] - [+install\b [ \aarchitecture\a ... ]] \adirectory\a [ \apackage\a ... ]]?Copy - the package binary hierarchy to \adirectory\a. If - \aarchitecture\a is omitted then all architectures are - installed. If \bflat\b is specified then exactly one - \aarchitecture\a must be specified; this architecture will be - installed in \adirectory\a without the \barch/\b\aHOSTTYPE\a - directory prefixes. Otherwise each architecture will be - installed in a separate \barch/\b\aHOSTTYPE\a subdirectory of - \adirectory\a. The \aarchitecture\a \b-\b names the current - architecture. \adirectory\a must be an existing directory. If - \apackage\a is omitted then all binary packages are installed. - This action requires \bnmake\b.] - [+license\b [ \apackage\a ... ]]?List the source license(s) for - \apackage\a on the standard output. Note that individual - components in \apackage\a may contain additional or replacement - licenses.] - [+list\b [ \apackage\a ... ]]?List the name, version and - prerequisites for \apackage\a on the standard output.] + [+install\b To be reimplemented.] [+make\b [ \apackage\a ]] [ \aoption\a ... ]] [ \atarget\a ... ]]?Build and install. The default \atarget\a is \binstall\b, which makes and installs \apackage\a. If the standard output is a terminal then the output is also captured in \b$INSTALLROOT/lib/package/gen/make.out\b. The build is done in the \b$INSTALLROOT\b directory tree viewpathed on top of the - \b$PACKAGEROOT\b directory tree. If \bflat\b is specified then - the \b$INSTALLROOT\b { bin fun include lib } directories are - linked to the same directories in the package root. Only one - architecture may be \bflat\b. Leaf directory names matching the + \b$PACKAGEROOT\b directory tree. Leaf directory names matching the \b|\b-separated shell pattern \b$MAKESKIP\b are ignored. The \bview\b action is done before making. \aoption\a operands are passed to the underlying make command.] - [+read\b [ \apackage\a ... | \aarchive\a ... ]]?Read the named - package or archive(s). Must be run from the package root - directory. Archives are searched for in \b.\b and - \blib/package/tgz\b. Each package archive is read only once. - The file \blib/package/tgz/\b\apackage\a[.\atype\a]]\b.tim\b - tracks the read time. See the \bwrite\b action for archive - naming conventions. Text file archive member are assumed to be - ASCII or UTF-8 encoded.] - [+regress?\bdiff\b(1) the current and previous \bpackage test\b - results.] - [+release\b [ [\aCC\a]]\aYY-MM-DD\a [ [\acc\a]]\ayy-mm-dd\a ]]]] [ \apackage\a ]]?Display - recent changes for the date range [\aCC\a]]\aYY-MM-DD\a (up to - [\acc\a]]\ayy-mm-dd\a.), where \b-\b means lowest (or highest.) - If no dates are specified then changes for the last 4 months - are listed. \apackage\a may be a package or component name.] - [+remove\b [ \apackage\a ]]?Remove files installed for - \apackage\a.] [+results\b [ \bfailed\b ]] [ \bpath\b ]] [ \bold\b ]] [\bmake\b | \btest\b | \bwrite\b ]]?List results and interesting messages captured by the most recent \bmake\b (default), \btest\b or \bwrite\b action. \bold\b specifies the previous results, if any (current and previous - results are retained.) \b$HOME/.pkgresults\b, if it exists, + results are retained). \b$HOME/.pkgresults\b, if it exists, must contain an \begrep\b(1) expression of result lines to be ignored. \bfailed\b lists failures only and \bpath\b lists the results file path name only.] - [+setup\b [ beta ]] [ binary ]] [ source ]] [ \aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?This - action initializes the current directory as a package root, runs the - \bupdate\b action to download new or out of date packages, and runs the - \bread\b action on those packages. If \bflat\b is specified then the - \b$INSTALLROOT\b { bin fun include lib } directories are linked to the - same directories in the package root. Only one architecture may be - \bflat\b. See the \bupdate\b and \bread\b action descriptions for - argument details.] - [+test\b [ \apackage\a ]]?Run the regression tests for - \apackage\a. If the standard output is a terminal then the - output is also captured in - \b$INSTALLROOT/lib/package/gen/test.out\b. In general a package - must be made before it can be tested. Components tested with - the \bregress\b(1) command require \bksh93\b. If \bonly\b is - also specified then only the listed package components are - tested, otherwise the closure of the components is tested.] - [+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download - the latest release of the selected and required packages from \aurl\a - (e.g., \bhttp://www.research.att.com/sw/download\b) into the directory - \b$PACKAGEROOT/lib/package/tgz\b. \bbeta\b accesses beta packages; - download these at your own risk. If \aarchitecture\a is omitted then - only architectures already present in the \btgz\b directory will be - downloaded. If \aarchitecture\a is \b-\b then all posted architectures - will be downloaded. If \aurl\a matches \b*.url\b then it is interpreted - as a file containing shell variable assignments for \burl\b, - \bauthorize\b and \bpassword\b. If \aurl\a is omitted then the - definitions for \burl\b, \bauthorize\b and \bpassword\b in - \b$PACKAGEROOT/lib/package/tgz/default.url\b, if it exists, are used. - If \b$PACKAGEROOT/lib/package/tgz/default.url\b does not exist then it - is initialized with the current \burl\b, \bauthorize\b and \bpassword\b - values and read permission for the current user only. If \apackage\a is - omitted then only packages already present in the tgz directory will be - downloaded. If \apackage\a is \b-\b then all posted packages will be - downloaded. If \bsource\b and \bbinary\b are omitted then both source - and binary packages will be downloaded. If \bonly\b is specified then - only the named packages are updated; otherwise the closure of required - packages is updated. This action requires \bwget\b(1), \blynx\b(1), - \bcurl\b(1) or a shell that supports io to - \b/dev/tcp/\b\ahost\a/\aport\a.] + [+test\b [ \aargument\a ... ]]?Run the regression tests for + \bksh\b. If the standard output is a terminal then the + output is also captured in \b$INSTALLROOT/lib/package/gen/test.out\b. + \bksh\b must be made before it can be tested. + All \aargument\as following \atest\a are passed to \bbin/shtests\b. + See \bbin/shtests --man\b for more information.] [+use\b [ \auid\a | \apackage\a | . [ 32 | 64 ]] | 32 | 64 | - ]] [ command ...]]?Run \acommand\a, or an interactive shell if \acommand\a is omitted, with the environment initialized for using the package (can you say \ashared\a \alibrary\a or \adll\a without cussing?) If \auid\a or \apackage\a or \a.\a is specified then it is used to determine a \b$PACKAGEROOT\b, possibly different from - the current directory. For example, to try out bozo`s package: + the current directory. For example, to try out bozo'\'$'s package: \bpackage use bozo\b. The \buse\b action may be run from any directory. If the file \b$INSTALLROOT/lib/package/profile\b is readable then it is sourced to initialize the environment. 32 or 64 implies \b$PACKAGEROOT\b of . and specifies the target architecture - word size (which may be silently ignored.)] - [+verify\b [ \apackage\a ]]?Verify installed binary files - against the checksum files in - \b$INSTALLROOT/lib/\b\apackage\a\b/gen/*.sum\b. The checksum - files contain mode, user and group information. If the checksum - matches for a given file then the mode, user and group are - changed as necessary to match the checksum entry. A warning is - printed on the standard error for each mismatch. Requires the - \bast\b package \bcksum\b(1) command.] + word size (which may be silently ignored).] [+view\b?Initialize the architecture specific viewpath - hierarchy. If \bflat\b is specified then the \b$INSTALLROOT\b { - bin fun include lib } directories are linked to the same - directories in the package root. Only one architecture may be - \bflat\b. The \bmake\b action implicitly calls this action.] - [+write\b [\aformat\a]] \atype\a ... [ \apackage\a ...]]?Write - a package archive for \apackage\a. All work is done in the - \b$PACKAGEROOT/lib/package\b directory. \aformat\a-specific - files are placed in the \aformat\a subdirectory. A - \apackage\a[.\atype\a]]\b.tim\b file in this directory tracks - the write time and prevents a package from being read in the - same root it was written. If more than one file is generated - for a particular \aformat\a then those files are placed in the - \aformat\a/\apackage\a subdirectory. File names in the - \aformat\a subdirectory will contain the package name, a - \ayyyy-mm-dd\a date, and for binary packages, \aHOSTTYPE\a. If - \apackage\a is omitted then an ordered list of previously - written packages is generated. If \bonly\b is specified then - only the named packages will be written; otherwise prerequisite - packages are written first. Package components must be listed - in \apackage\a\b.pkg\b. \aformat\a may be one of:] - { - [+cyg?Generate a \bcygwin\b package.] - [+exp?Generate an \bexptools\b maintainer source - archive and \aNPD\a file, suitable for \bexpmake\b(1)] - [+lcl?Generate a package archive suitable for - restoration into the local source tree (i.e., the - source is not annotated for licencing.)] - [+pkg?Generate a \bpkgmk\b(1) package suitable for - \bpkgadd\b(1).] - [+rpm?Generate an \brpm\b(1) package.] - [+tgz?Generate a \bgzip\b(1) \btar\b(1) package - archive. This is the default.] - [+tst?Generate a \btgz\b format package archive in the - \btst\b subdirectory. Version state files are not updated.] - } - [+?\btype\b specifies the package type which must be one of - \bsource\b, \bbinary\b or \bruntime\b. A source package - contains the source needed to build the corresponding binary - package. A binary package includes the libraries and headers - needed for compiling and linking against the public interfaces. - A runtime package contains the commands and required dynamic - libraries.] - [+?A package may be either a \bbase\b or \bdelta\b. A base - package contains a complete copy of all components. A delta - package contains only changes from a previous base package. - Delta recipients must have the \bast\b \bpax\b(1) command (in - the \bast-base\b package.) If neither \bbase\b nor \bdelta\b is - specified, then the current base is overwritten if there are no - deltas referring to the current base. Only the \btgz\b and - \blcl\b formats support \bdelta\b. If \bbase\b is specified - then a new base and two delta archives are generated: one delta - to generate the new base from the old, and one delta to - generate the old base from the new; the old base is then - removed. If \bdelta\b is specified then a new delta referring - to the current base is written.] - [+?\apackage\a\b.pkg\b may reference other packages. By default - a pointer to those packages is written. The recipient \bpackage - read\b will then check that all required packages have been - downloaded. If \bclosure\b is specified then the components for - all package references are included in the generated package. - This may be useful for \blcl\b and versioning.] - [+?All formats but \blcl\b annotate each \bsource\b file (not - already annotated) with a license comment as it is written to - the package archive using \bproto\b(1).] + hierarchy. The \bmake\b action implicitly calls this action.] } [+DETAILS?The package directory hierarchy is rooted at \b$PACKAGEROOT\b. All source and binaries reside under this tree. A two @@ -460,102 +243,46 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in architectures can be made from a single copy of the source.] [+?Independent \b$PACKAGEROOT\b hierarchies can be combined by appending \b$INSTALLROOT:$PACKAGEROOT\b pairs to \bVPATH\b. The - \bVPATH\b viewing order is from left to right. Each \b$PACKAGEROOT\b - must have a \b$PACKAGEROOT/lib/package\b directory.] -[+?Each package contains one or more components. Component source for - the \afoo\a command is in \b$PACKAGEROOT/src/cmd/\b\afoo\a, and source - for the \abar\a library is in \b$PACKAGEROOT/src/lib/lib\b\abar\a. This - naming is for convenience only; the underlying makefiles handle - inter-component build order. The \bINIT\b component, which contains - generic package support files, is always made first, then the - components named \bINIT\b*, then the component order determined by the - closure of component makefile dependencies.] -[+?\b$PACKAGEROOT/lib/package\b contains package specific files. The - package naming convention is \agroup\a[-\apart\a]]; e.g., \bast-base\b, - \bgnu-fileutils\b. The *\b.pkg\b files are ast \bnmake\b(1) makefiles - that contain the package name, package components, references to other - packages, and a short package description. *\b.pkg\b files are used by - \bpackage write\b to generate new source and binary packages.] -[+?\b$PACKAGEROOT/lib/package/\b\agroup\a\b.lic\b files contain license - information that is used by the \bast\b \bproto\b(1) and \bnmake\b(1) - commands to generate source and binary license strings. \agroup\a is - determined by the first \b:PACKAGE:\b operator name listed in the - component \bnmake\b makefile. \agroup\a\b.lic\b files are part of the - licensing documentation. Each component may have its own \bLICENSE\b file - that overrides the \agroup\a\b.lic\b file. The full text of the licenses - are in the \b$PACKAGEROOT/lib/package/LICENSES\b and - \b$INSTALLROOT/lib/package/LICENSES\b directories.] -[+?A few files are generated in \b$PACKAGEROOT/lib/package/gen\b and - \b$INSTALLROOT/lib/package/gen\b. \apackage\a\b.ver\b contains one line - consisting of \apackage version release\a \b1\b for the most recent - instance of \apackage\a read into \b$PACKAGEROOT\b, where \apackage\a - is the package name, \aversion\a is the \aYYYY-MM-DD\a base version, - and \arelease\a is \aversion\a for the base release or \aYYYY-MM-DD\a - for delta releases. \apackage\a\b.req\b contains *\b.ver\b entries for - the packages required by \apackage\a, except that the fourth field is - \b0\b instead of \b1\b. All packages except \bINIT\b require the - \bINIT\b package. A simple sort of \apackage\a\b.pkg\b and *\b.ver\b - determines if the required package have been read in. Finally, - \apackage\a\b.README\b and \apackage\a\a.html\b contain the README text - for \apackage\a and all its components. Included are all changes added - to the component \bRELEASE\b, \bCHANGES\b or \bChangeLog\b files dated - since the two most recent base releases. Component \bRELEASE\b files - contain tag lines of the form [\aYY\a]]\aYY-MM-DD\a [ \atext\a ]] (or - \bdate\b(1) format dates) followed by README text, in reverse - chronological order (newer entries at the top of the file.) \bpackage - release\b lists this information, and \bpackage contents ...\b lists - the descriptions and components.] + \bVPATH\b viewing order is from left to right.] [+?\b$HOSTYPE\b names the current binary architecture and is determined - by the output of \bpackage\b (no arguments.) The \b$HOSTTYPE\b naming + by the output of \b'$command$'\b (no arguments). The \b$HOSTTYPE\b naming scheme is used to separate incompatible executable and object formats. All architecture specific binaries are placed under \b$INSTALLROOT\b - (\b$PACKAGEROOT/arch/$HOSTTYPE\b.) There are a few places that match + (\b$PACKAGEROOT/arch/$HOSTTYPE\b). There are a few places that match against \b$HOSTTYPE\b when making binaries; these are limited to makefile compiler workarounds, e.g., if \b$HOSTTYPE\b matches \bhp.*\b then turn off the optimizer for these objects. All other architecture - dependent logic is handled either by the \bast\b \biffe\b(1) command or + dependent logic is handled either by the \bAST\b \biffe\b(1) command or by component specific configure scripts. Explicit \b$HOSTYPE\b values matching *,*cc*[,-*,...]] optionally set the default \bCC\b and \bCCFLAGS\b. This is handy for build farms that support different compilers on the same architecture.] -[+?Each component contains an \bast\b \bnmake\b(1) makefile (either - \bNmakefile\b or \bMakefile\b) and a \bMAM\b (make abstract machine) - file (\bMamfile\b.) A Mamfile contains a portable makefile description - that is used by \bmamake\b(1) to simulate \bnmake\b. Currently there is - no support for old-make/gnu-make makefiles; if the binaries are just - being built then \bmamake\b will suffice; if source or makefile - modifications are anticipated then \bnmake\b (in the \bast-base\b - package) should be used. Mamfiles are automatically generated by - \bpackage write\b.] -[+?Most component C source is prototyped. If \b$CC\b (default value - \bcc\b) is not a prototyping C compiler then \bpackage make\b runs - \bproto\b(1) on portions of the \b$PACKAGEROOT/src\b tree and places - the converted output files in the \b$PACKAGEROOT/proto/src\b tree. - Converted files are then viewpathed over the original source. - \bproto\b(1) converts an ANSI C subset to code that is compatible with - K&R, ANSI, and C++ dialects.] +[+?Each component contains a \bMAM\b (make abstract machine) + file (\bMamfile\b). A Mamfile contains a portable makefile description + written in a simple dependency tree language using indented + \bmake\b...\bdone\b blocks.] [+?All scripts and commands under \b$PACKAGEROOT\b use \b$PATH\b - relative pathnames (via the \bast\b \bpathpath\b(3) function); there + relative pathnames (via the \bAST\b \bpathpath\b(3) function); there are no embedded absolute pathnames. This means that binaries generated under \b$PACKAGEROOT\b may be copied to a different root; users need only change their \b$PATH\b variable to reference the new installation - root \bbin\b directory. \bpackage install\b installs binary packages in + root \bbin\b directory. \b'$command$' install\b installs binary packages in a new \b$INSTALLROOT\b.] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] [+SEE ALSO?\bautoconfig\b(1), \bcksum\b(1), \bexecrate\b(1), \bexpmake\b(1), - \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bnmake\b(1), \bpax\b(1), - \bpkgadd\b(1), \bpkgmk\b(1), \bproto\b(1), \bratz\b(1), \brpm\b(1), + \bgzip\b(1), \bmake\b(1), \bmamake\b(1), \bpax\b(1), + \bpkgadd\b(1), \bpkgmk\b(1), \brpm\b(1), \bsh\b(1), \btar\b(1), \boptget\b(3)] ' case $* in help) set -- --man ;; esac - while getopts -a $command "$USAGE" OPT + while getopts -a "$command" "$USAGE" OPT do : done - shift $OPTIND-1 + shift $((OPTIND-1)) ;; esac @@ -575,38 +302,28 @@ case $NM in esac action= -admin_all=1 -admin_on= -authorize= bit= exec= flat=0 force=0 global= hi= -html=0 ifs=${IFS-' '} lo= make= makeflags='-K' -nmakeflags= -nmakesep= nl=" " noexec= only=0 output= -package_src= -password= quiet=0 show=: tab=" " verbose=0 AUTHORIZE= DEBUG= -HURL= -PROTOROOT=- SHELLMAGIC=- unset FIGNORE BINDIR DLLDIR ETCDIR FUNDIR INCLUDEDIR LIBDIR LOCALEDIR MANDIR SHAREDIR 2>/dev/null || true @@ -616,20 +333,11 @@ do case $# in 0) set host type ;; esac case $1 in - admin|clean|clobber|contents|copyright|export|host|install|license|list|make|read|regress|release|remove|results|setup|test|update|use|verify|view|write|TEST) + clean|clobber|export|host|install|make|remove|results|test|use|view) action=$1 shift break ;; - authorize) - case $# in - 1) echo $command: $1: authorization user name argument expected >&2; exit 1 ;; - esac - shift - authorize=$1 - shift - continue - ;; debug|environment) exec=echo make=echo show=echo ;; @@ -641,15 +349,6 @@ do case $# in ;; only) only=1 ;; - password) - case $# in - 1) echo $command: $1: authorization password argument expected >&2; exit 1 ;; - esac - shift - password=$1 - shift - continue - ;; quiet) quiet=1 ;; show) exec=echo noexec=-n @@ -661,624 +360,191 @@ do case $# in set -x ;; help|HELP|html|man|--[?m]*) - case $1 in + case $1 in help) code=0 case $2 in '') exec 1>&2 ;; esac ;; - html) code=0 html=1 + html) code=0 html=1 + echo "$command help

    $command help

    "
     			;;
     		*)	code=2
     			exec 1>&2
     			;;
     		esac
    -		case $html in
    -		1)	bO="
    -
    -$2 package installation instructions
    -
    -"
    -			eO='
    -'
    -			bH="

    " - eH='

    ' - bP='

    ' - bL='

    ' - bL2='

    ' - eL='

    ' - bT='' - bD='' eD='' - bB='' eB='' - bI='' eI='' - bX='

    '			eX='
    ' - bF='' eF='' - Camp='&' - Mcurl='
    curl(1)' - Mdate='date(1)' - Mfile='file(1)' - Mgunzip='gunzip(1)' - Mhurl='hurl(1)' - Mlynx='lynx(1)' - Mnmake='nmake(1)' - Mpackage='package(1)' - Mproto='proto(1)' - Mratz='ratz' - Mtar='tar(1)' - Mwget='wget(1)' - ;; - *) bO='' eO='' - bH='' eH=':' - bP='' - bL='' eL='' - bL2='' - bT=' ' - bD=' ' eD='' - bB='' eB='' - bI='' eI='' - bX='' eX='' - bF='"' eF='"' - Camp='&' - Mcurl='curl(1)' - Mdate='date(1)' - Mfile='file(1)' - Mgunzip='gunzip(1)' - Mhurl='hurl(1)' - Mlynx='lynx(1)' - Mnmake='nmake(1)' - Mpackage='package(1)' - Mproto='proto(1)' - Mratz='ratz' - Mtar='tar(1)' - Mwget='wget(1)' - ;; - esac - case $2 in - binary) echo "${bO} -${bH}Binary Package Installation Instructions${eH} -${bL} -${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may - have setuid executables, few must be owned by ${bI}root${eI}. These are best - changed manually when the security implications are understood.${eD} -${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work - area for all packages.${eD} -${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the - download site. If you already clicked, or if your system does not have - ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions - for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} - script which works with ksh and modern bash. The top level URL is:${bX} - URL=http://www.research.att.com/sw/download${eX}${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} - test -d bin || mkdir bin - url=\$URL/package - (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package - chmod +x bin/package${eX}${eD} -${bT}(5)${bD}Determine the list of package names you want from the download site, then - use the ${Mpackage} command to do the actual download:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - setup binary \$URL ${bI}PACKAGE${eI} ...${eX} - (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for - ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest - binary package(s); covered and up-to-date packages are not downloaded again unless - ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. - If the package root will contain only one architecture then you can install in ${bB}bin${eB} and - ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this - instead:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - flat setup binary \$URL ${bB}PACKAGE${eB} ...${eX} - To update the same packages from the same URL run:${bX} - bin/package setup binary${eX}${eD} -${bT}(6)${bD}The packaged binaries are position independent, i.e., they do not - contain hard-coded paths. However, commands with related files, like - ${Mfile} and ${Mnmake}, require the path of the bin directory to be - exported in ${bB}PATH${eb}.${eD} -${bT}(7)${bD}You can run the binaries directly from the package root, or you can - install them in a public root (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} - bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} - This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to - preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the - ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a - flat install:${bX} - cd \$INSTALLROOT - cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} -${bT}(8)${bD}To summarize, after the first time, the download cycle for the latest - binary release is:${bX} - bin/package setup binary${eX}${eD}${eL} + # Plain-text fallback. Regenerate with: + # ksh -c 'COLUMNS=80 bin/package --man' 2>&1 | sed "s/'/'\\\\''/g; 1s/^/echo '/; \$s/\$/'/" + echo 'NAME + package - build, test and install ksh 93u+m -${bH}Binary Package Installation Instructions -- Plan B${eH} -${bL} -${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives - into that directory.${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} - binary package:${bX} - gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz | - ${TAR} ${TARFLAGS}f -${eX} - Note that some browsers automatically unzip downloaded without warning. - If the gunzip fails try: - ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD.HOSTTYPE${eI}.tgz - If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} - binary package:${bX} - mkdir bin - cp lib/package/tgz/ratz.${bI}YYYY-MM-DD.HOSTTYPE${eI}.exe bin/ratz - chmod +x bin/ratz - bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD/HOSTTYPE${eI}.tgz -${bT}(5)${bD}Read all unread package archive(s):${bX} - bin/package read${eX} - Both source and binary packages will be read by this step.${eD}${eL}${eO}" - ;; - intro) echo "${bO} -${bH}Package Hierarchy Details${eH} -${bP} -The package directory hierarchy is rooted at ${bB}\$PACKAGEROOT${eB}. All source and -binaries reside under this tree. A two level viewpath is used to separate -source and binaries. The top view is architecture specific, the bottom view -is shared source. All building is done in the architecture specific view; -no source view files are intentionally changed. This means that many -different binary architectures can be made from a single copy of the source. -${bP} -Each package contains one or more components. Component source for the ${bI}FOO${eI} -command is in ${bB}\$PACKAGEROOT/src/cmd/${eB}${bI}FOO${eI}, and source for the ${bI}BAR${eI} library is -in ${bB}\$PACKAGEROOT/src/lib/lib${eB}${bI}BAR${eI}. This naming is for convenience only; the -underlying makefiles handle inter-component build order. The ${bB}INIT${eB} component, -which contains generic package support files, is always made first, then the -components named ${bB}INIT${eB}*, then the order determined by the closure of component -makefile dependencies. -${bP} -${bB}\$PACKAGEROOT/lib/package${eB} contains package specific files. The package naming -convention is ${bI}GROUP${eI}[${bI}-PART${eI}]; e.g., ${bB}ast-base${eB}, ${bB}gnu-fileutils${eB}. The *${bB}.pkg${eB} files -are ${bB}ast${eB} ${Mnmake} makefiles that contain the package name, package components, -references to other packages, and a short package description. *${bB}.pkg${eB} files -are used by ${bF}package write${eF} to generate new source and binary packages. -${bP} -${bB}\$PACKAGEROOT/lib/package/${eB}${bI}GROUP${eI}${bB}.lic${eB} files contain license information that -is used by the ${bB}ast${eB} ${Mproto} and ${Mnmake} commands to generate source and -binary license strings. ${bI}GROUP${eI} is determined by the first ${bB}:PACKAGE:${eB} operator -name listed in the component ${bB}nmake${eB} makefile. ${bI}GROUP${eI}${bB}.lic${eB} files are part of the -licensing documentation. Each component may have its own ${bB}LICENSE${eB} file that -overrides the ${bI}GROUP${eI}${bB}.lic${eB} file. The full text of the licenses are in the -${bB}\$PACKAGEROOT/lib/package/LICENSES${eB} and ${bB}\$INSTALLROOT/lib/package/LICENSES${eB} -directories. -${bP} -A few files are generated in ${bB}\$PACKAGEROOT/lib/package/gen${eB} and -${bB}\$INSTALLROOT/lib/package/gen${eB}. ${bI}PACKAGE${eI}${bB}.ver${eB} contains one line consisting of${bX} - ${bI}PACKAGE VERSION RELEASE${eI} 1${eX} -for the most recent instance of ${bI}PACKAGE${eI} read into ${bB}\$PACKAGEROOT${eB}, where -${bI}PACKAGE${eI} is the package name, ${bI}VERSION${eI} is the ${bI}YYYY-MM-DD${eI} base version, -and ${bI}RELEASE${eI} is ${bI}VERSION${eI} for the base release or ${bI}YYYY-MM-DD${eI} for delta releases. -${bI}PACKAGE${eI}${bB}.req${eB} contains *${bB}.ver${eB} entries for the packages required by -${bI}PACKAGE${eI}, except that the fourth field is 0 instead of 1. All packages -except ${bB}INIT${eB} and ${Mratz} require the ${bB}INIT${eB} package. A simple sort of ${bI}PACKAGE${eI}${bB}.pkg${eB} -and *${bB}.ver${eB} determines if the required package have been read in. Finally, -${bI}PACKAGE${eI}${bB}.README${eB} contains the ${bB}README${eB} text for ${bI}PACKAGE${eI} and all its -components. Included are all changes added to the component ${bB}RELEASE${eB}, -${bB}CHANGES${eB} or ${bB}ChangeLog${eB} files dated since the two most recent base -releases. Component ${bB}RELEASE${eB} files contain tag lines of the form -[${bI}CC${eI}]${bI}YY-MM-DD${eI} [ ${bI}TEXT${eI} ] (or ${Mdate} format dates) followed by README -text, in reverse chronological order (newer entries at the top of the -file.) ${bF}package release${eF} generates this information, and -${bF}package contents ...${eF} lists the descriptions and components. -${bP} -${bB}\$HOSTYPE${eB} names the current binary architecture and is determined by the -output of ${bF}package${eF} (no arguments.) The ${bB}\$HOSTTYPE${eB} naming scheme is used -to separate incompatible executable and object formats. All architecture -specific binaries are placed under ${bB}\$INSTALLROOT${eB} (${bB}\$PACKAGEROOT/arch/\$HOSTTYPE${eB}.) -There are a few places that match against ${bB}\$HOSTTYPE${eB} when making binaries; these -are limited to makefile compiler workarounds, e.g., if ${bB}\$HOSTTYPE${eB} matches -'hp.*' then turn off the optimizer for these objects. All other architecture -dependent logic is handled either by ${bB}\$INSTALLROOT/bin/iffe${eB} or by component -specific configure scripts. Explicit ${bB}\$HOSTYPE${eB} values matching *,*cc*[,-*,...] -optionally set the default ${bB}CC${eB} and ${bB}CCFLAGS${eB}. This is handy for build -farms that support different compilers on the same architecture. -${bP} -Each component contains an ${bB}ast${eB} ${Mnmake} makefile (either ${bB}Nmakefile${eB} or ${bB}Makefile${eB}) -and a ${bI}MAM${eI} (make abstract machine) file (${bB}Mamfile${eB}.) A Mamfile contains a portable -makefile description that is used by ${bB}\$INSTALLROOT/bin/mamake${eB} to simulate -${bB}nmake${eB}. Currently there is no support for old-make/gnu-make makefiles; if -the binaries are just being built then ${bB}mamake${eB} will suffice; if source or -makefile modifications are anticipated then ${bB}nmake${eB} (from the ${bB}ast-open${eB} or -${bB}ast-base${eB} package) should be used. Mamfiles are automatically generated by -${bF}package write${eF}. -${bP} -Most component C source is prototyped. If ${bB}\$CC${eB} (default value ${bB}cc${eB}) is not a -prototyping C compiler then ${bF}package make${eF} runs ${Mproto} on portions of the -${bB}\$PACKAGEROOT/src${eB} tree and places the converted output files in the -${bB}\$PACKAGEROOT/proto/src${eB} tree. Converted files are then viewpathed over the -original source. The ${bB}ast${eB} ${Mproto} command converts an ANSI C subset to code -that is compatible with K&R, ANSI, and C++ dialects. -${bP} -All scripts and commands under ${bB}\$PACKAGEROOT${eB} use ${bB}\$PATH${eB} relative pathnames; -there are no embedded absolute pathnames. This means that binaries generated -under ${bB}\$PACKAGEROOT${eB} may be copied to a different root; users need only change -their ${bB}\$PATH${eB} variable to reference the new installation root bin directory. -${bF}package install${eF} installs binary packages in a new ${bB}\$INSTALLROOT${eB}. -${eO}" - ;; - source) echo "${bO} -${bH}Source Package Installation Instructions${eH} -${bL} -${bT}(1)${bD}Do not install packages as ${bI}root/super-user${eI}. Although some components may - have setuid executables, few must be owned by ${bI}root${eI}. These are best - changed manually when the security implications are understood.${eD} -${bT}(2)${bD}Choose a package root directory and cd to it. This will be a local work - area for all packages. -${bT}(3)${bD}These instructions bypass the ${bI}click to download${eI} package links on the - download site. If you already clicked, or if your system does not have - ${Mcurl}, ${Mhurl}, ${Mlynx} or ${Mwget} then use the alternate instructions - for (3),(4),(5) in plan ${bB}B${eB} below. Plan ${bB}B${eB} installs the ${Mhurl} - script which works with ksh and modern bash. The top level URL is:${bX} - URL=http://www.research.att.com/sw/download${eX}${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then run:${bX} - test -d bin || mkdir bin - url=\$URL/package - (wget -O - \$url||curl -L \$url||hurl \$url) > bin/package - chmod +x bin/package${eX}${eD} -${bT}(5)${bD}Determine the list of package names you want from the download site, then - use the ${Mpackage} command to do the actual download:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - setup source \$URL ${bB}PACKAGE${eB} ...${eX} - (Refer to the ${bB}AUTHORIZATION${eB} paragraph on the main download page for - ${bI}NAME${eI}/${bI}PASSWORD${eI} details.) This downloads the closure of the latest - source package(s); covered and up-to-date packages are not downloaded again unless - ${bB}package force ...${eB} is specified. Package content is verified using ${bB}${checksum}${eB}. - If the package root will contain only one architecture then you can install in ${bB}bin${eB} and - ${bB}lib${eB} instead of ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/bin${eB} and ${bB}arch/${eB}${bI}HOSTTYPE${eI}${bB}/lib${eB} by running this - instead:${bX} - bin/package authorize \"${bI}NAME${eI}\" password \"${bI}PASSWORD${eI}\" \\ - flat setup source \$URL ${bB}PACKAGE${eB} ...${eX} - To update the same packages from the same URL run:${bX} - bin/package setup source${eX}${eD} -${bT}(6)${bD}Build and install; all generated files are placed under ${bB}arch/${eB}${bI}HOSTTYPE${eI} - (${bB}\$INSTALLROOT${eB}), where ${bI}HOSTTYPE${eI} is the output of ${bB}bin/package${eB} (with no - arguments.) ${bI}name=value${eI} arguments are supported; ${bB}CC${eB} and ${bB}debug=1${eB} (compile - with -g instead of -O) are likely candidates. The output is written to - the terminal and captured in ${bB}\$INSTALLROOT/lib/package/gen/make.out${eB}:${bX} - bin/package make${eX}${eD} -${bT}(7)${bD}List make results and interesting errors:${bX} - bin/package results${eX} - Run the regression tests:${bX} - bin/package test${eX} - List test results and errors:${bX} - bin/package results test${eX}${eD} -${bT}(8)${bD}The generated binaries are position independent, i.e., they do not - contain hard-coded paths. However, commands with related files, like - ${Mfile} and ${Mnmake}, require the path of the bin directory to be - exported in ${bB}PATH${eb}.${eD} -${bT}(9)${bD}You can run the binaries directly from the package root, or you can - install them in a public root after you are satisfied with the make and - test actions (requires the ${bI}AT${Camp}T${eI} ${Mnmake} command):${bX} - bin/package flat install ${bI}DIRECTORY PACKAGE${eI}${eX} - This will install in ${bI}DIRECTORY${eI}${bB}/bin${eB} and ${bI}DIRECTORY${eI}${bB}/lib${eB}. If you want to - preserve the ${bB}arch/${eB}${bI}HOSTTYPE${eI} hierarchy under ${bI}DIRECTORY${eI} then omit the - ${bB}flat${eB} argument. If you don't have ${Mnmake} then the following will do a - flat install:${bX} - cd \$INSTALLROOT - cp -p -r bin lib include ${bI}DIRECTORY${eI}${eX}${eD} -${bT}(10)${bD}To summarize, after the first time the download, build, and test cycle - for the latest source release is:${bX} - bin/package setup source - bin/package make - bin/package test${eX}${eD}${eL} +SYNOPSIS + package [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] -${bH}Source Package Installation Instructions -- Plan B${eH} -${bL} -${bT}(3)${bD}Create the subdirectory ${bB}lib/package/tgz${eB} and download all package archives - into that directory.${eD} -${bT}(4)${bD}If the ${bB}bin/package${eB} script does not exist then manually read the ${bB}INIT${eB} - source package:${bX} - gunzip < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz | ${TAR} ${TARFLAGS}f -${eX} - Note that some browsers automatically unzip downloaded without warning. - If the gunzip fails try: - ${TAR} ${TARFLAGS}f -${eX} lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz - If your system does not have ${Mtar} or ${Mgunzip} then download the ${Mratz} - source package, compile it, and manually read the ${bB}INIT${eB} - source package:${bX} - mkdir bin - cp lib/package/tgz/ratz.${bI}YYYY-MM-DD${eI}.c lib/package/tgz/ratz.c - cc -o bin/ratz lib/package/tgz/ratz.c - bin/ratz -lm < lib/package/tgz/INIT.${bI}YYYY-MM-DD${eI}.tgz -${bT}(5)${bD}Read all unread package archive(s):${bX} - bin/package read${eX} - Both source and binary packages will be read by this step.${eD}${eL}${eO}" - ;; - *) echo "Usage: $command [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ] +DESCRIPTION + The package command is the main control script for building and installing + KornShell 93u+m. It is a POSIX sh(1) script coded for maximal portability. A + POSIX shell and C compiler installation are the only requirements. All + package files are in the $PACKAGEROOT directory tree. Binary package files + are in the $INSTALLROOT ($PACKAGEROOT/arch/hosttype) tree, where + hosttype=$(bin/package host type). See DETAILS for more information. - The $command command controls source and binary packages. It must be run - within the package root directory tree. See \"$command help intro\" for - details. In the following, PACKAGE names either a package or a component - within a package; if omitted, all packages are operated on. The default - action is \"host type\". + Note that no environment variables need be set by the user; package + determines the environment based on the current working directory. The use + action starts a sh(1) with the environment initialized. CC, CCFLAGS, HOSTTYPE + and SHELL may be set by explicit command argument assignments to override the + defaults. - qualifier: - authorize NAME Remote authorization name or license acceptance phrase. - debug|environment Show environment and actions; do not execute. - flat Collapse \$INSTALLROOT { bin fun include lib } onto \$PACKAGEROOT. - force Force the action to override saved state. - never Run make -N; otherwise show other actions. - only Only operate on the specified packages. - password PASSWORD Remote authorization or license acceptance password. - quiet Do not list captured make and test action output. - show Run make -n; otherwise show other actions. - DEBUG Trace the package script actions in detail for debugging. - action: - admin [ all ] [ db FILE ] [ on PATTERN ] [ action ... ] - Apply ACTION ... to the hosts listed in FILE. If FILE is - omitted then "admin.db" is assumed. The caller must have rcp(1) - and rsh(1) or scp(1) and ssh(1) access to the hosts. Output - for the action is saved per-host in ACTION.log/HOST. Logs - can be viewed by \"package admin [on HOST] results [ACTION]\". - By default only local PACKAGEROOT hosts are selected from FILE; - \"all\" selects all hosts. \"on PATTERN\" selects only - hosts matching the | separated PATTERN. FILE contains four - types of lines. Blank lines and lines beginning with # are - ignored. Lines starting with id=value are variable assignments. - Set admin_ping to local conventions if \"$admin_ping\" fails. - If a package list is not specified on the command line the - action applies to all packages; a variable assignment - package=list applies action to the packages in list for - subsequent hosts in FILE. The remaining line type is a host - description consisting of 6 tab separated fields. The first 3 - are mandatory; the remaining 3 are updated by the admin action: - hosttype - The host type as reported by package. - [user@]host - The host name and optionally user name for rcp(1) - and rsh(1) access. - [remote:[[master]:]]PACKAGEROOT - The absolute remote package root directory and - optionally the remote prorocol (rsh or ssh) if - the directory is on a different server than the - master package root directory. If - lib/package/admin/$admin_env exists under - this directory then it is sourced by sh(1) - before ACTION is done. If this field begins with - - then the host is ignored. If this field contains - : then ditto(1) is used to sync the remote src - directory hierarchy to the local one. If [master]: - is specified then the sync is deferred to the - master host. If master is omitted (two :) then - the sync is disabled. These directories must exist - on the remote side: lib/package, src/cmd, src/lib. - date YYMMDD of the last action. - date Elapsed wall time of the last action. - M T W The admin action make, test and write action error - counts. A non-numeric value in any of these fields - disables the corresponding action. - owner The owner contact information. - attributes - NAME=VALUE attributes. Should at least contain - cc=compiler-version. - clean | clobber - Delete the arch/HOSTTYPE hierarchy; this deletes all generated - files and directories for HOSTTYPE. The hierarchy can be rebuilt - by package make.] - contents [ package ... ] - List description and components for PACKAGE on the standard - output. - copyright [ package ... ] - List the general copyright notice(s) for PACKAGE on the - standard output. Note that individual components in PACKAGE - may contain additional or replacement notices. - export [ VARIABLE ... ] - List NAME=VALUE for each VARIABLE, one per line. If the - \"only\" attribute is specified then only the variable - values are listed. If no variables are specified then - $env are assumed. - help [ ACTION ] - Display help text on the standard error [ standard output - for ACTION ]. - host [ canon cpu name rating type ... ] - List architecture/implementation dependent host information - on the standard output. type is listed if no attributes are - specified. Information is listed on a single line in attributes - order. The attributes are: - canon The next argument is a host type name to be - converted to package syntax. - cpu The number of cpus; 1 if the host is not a - multiprocessor. - name The host name. - rating The cpu rating in pseudo mips; the value is useful - useful only in comparisons with rating values of - other hosts. Other than a vax rating fixed at 1, - ratings can vary wildly but consistently from - vendor mips ratings. cc(1) may be required to - determine the rating. - type The host type, usually of the form - vendor.architecture, with an optional trailing - -version. The main theme is that type names within - a family of architectures are named in a similar, - predictable style. Os point release information is - avoided as much as possible, but vendor resistance - to release incompatibilities has for the most part - been futile. - html [ ACTION ] - Display html help text on the standard error [ standard output - for ACTION ]. - install [ ARCHITECTURE ... ] DIR [ PACKAGE ... ] - Copy the package binary hierarchy to DIR. If ARCHITECTURE is - omitted then all architectures are installed. If the \"flat\" - attribute is specified then exactly one ARCHITECTURE must be - specified; this architecture will be installed in DIR without - the \"arch/HOSTTYPE\" directory prefixes. Otherwise each - architecture will be installed in a separate \"arch/HOSTTYPE\" - subdirectory of DIR. The ARCHITECTURE - names the current - architecture. DIR must be an existing directory. If PACKAGE - is omitted then all binary packages are installed. This action - requires nmake. - license [ package ... ] - List the source license(s) for PACKAGE on the standard output. - Note that individual components in PACKAGE may contain - additional or replacement licenses. - list [ PACKAGE ... ] - List the name, version and prerequisites for PACKAGE on the - standard output. - make [ PACKAGE ] [ OPTION ... ] [ TARGET ... ] - Build and install. The default TARGET is install, which - makes and installs all packages. If the standard output - is a terminal then the output is also captured in - \$INSTALLROOT/lib/package/gen/make.out. The build is done - in the \$INSTALLROOT directory tree viewpathed on top of - the \$PACKAGEROOT directory tree. If \"flat\" is specified then - the \$INSTALLROOT { bin fun include lib } directories are - linked to the same directories in the package root. Only - one architecture may be flat. Leaf directory names matching - the |-separated shell pattern \$MAKESKIP are ignored. The - view action is done before making. OPTION operands are - passed to the underlying make command. - read [ package ... | archive ... ] - Read the named package archive(s). Must be run from the - package root directory. Archives are searched for in . - and lib/package/tgz. Each package is read only once. The - file lib/package/tgz/package[.type].tim tracks the read time. - See the write action for archive naming conventions. Text - file archive member are assumed to be ASCII or UTF-8 encoded. - regress diff(1) the current and previous package test results. - release [ [CC]YY-MM-DD [ [cc]yy-mm-dd ] ] [ package ] - Display recent changes since [CC]YY-MM-DD (up to [cc]yy-mm-dd), - where - means lowest (or highest.) If no dates are specified - then changes for the last 4 months are listed. PACKAGE may - be a package or component name. - remove PACKAGE - Remove files installed for PACKAGE. - results [ path ] [ old ] [ make | test ] - List results and interesting messages captured by the most - recent make (default), test or write action. old specifies the - previous results, if any (current and previous results are - retained.) $HOME/.pkgresults, if it exists, must contain an - egrep(1) expression of result lines to be ignored. failed lists - failures only and path lists the results file path only. - setup [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] - The action initializes the current directory as a package root, - runs the update action to download new or out of date packages, - and runs the read action on those packages. If \"flat\" is - specified then the \$INSTALLROOT { bin fun include lib } - directories are linked to the same directories in the package - root. Only one architecture may be flat. See the update and - read actions for argument details. - test [ PACKAGE ] - Run the regression tests for PACKAGE. If the standard output - is a terminal then the output is also captured in - \$INSTALLROOT/lib/package/gen/test.out. In general a package - must be made before it can be tested. Components tested with - the \bregress\b(1) command require \bksh93\b. If only is - also specified then only the listed package components are - tested, otherwise the closure of the components is tested. - update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ] - Download the latest release of the selected and required - packages from URL (e.g., - http://www.research.att.com/sw/download) into the directory - \$PACKAGEROOT/lib/package/tgz. beta accesses beta packages; - download these at your own risk. If ARCHITECTURE is omitted - then only architectures already present in the tgz directory - will be downloaded. If ARCHITECTURE is - then all posted - architectures will be downloaded. If URL matches *.url then - it is interpreted as a file containing shell variable - assignments for url, authorize and password. If URL is - omitted then the definitions for url, authorize and password - in \$PACKAGEROOT/lib/package/tgz/$default_url, if it exists, - are used. If \$PACKAGEROOT/lib/package/tgz/$default_url does - not exist then it is initialized with the current url, - authorize and password values and read permission for the - current user only. If PACKAGE is omitted then only - packages already present in the tgz directory will be - downloaded. If PACKAGE is - then all posted packages will be - downloaded. If source and binary are omitted then both source - and binary packages will be downloaded. If \bonly\b is - specified then only the named packages are updated; otherwise - the closure of required packages is updated. This action - requires wget(1), lynx(1), curl(1) or a shell that supports - io to /dev/tcp/HOST/PORT. - use [ uid | PACKAGE | . [ 32 | 64 ] | 32 | 64 | - ] [ COMMAND ... ] - Run COMMAND or an interactive shell if COMMAND is omitted, with - the environment initialized for using the package (can you say - shared library without cussing?) If uid or PACKAGE or . is - specified then it is used to determine a \$PACKAGEROOT, - possibly different from the current directory. For example, to - try out bozo's package: \"package use bozo\". In this case the - command may be run from any directory. If the file - \$INSTALLROOT/lib/package/profile is readable then it is - sourced to initialize the environment. 32 or 64 implies - \$PACKAGEROOT of . and specifies the target architecture word - size (which may be silently ignored.) - verify [ PACKAGE ] - Verify installed binary files against the checksum files in - \$INSTALLROOT/lib/package/gen/*.sum. The checksum files contain - mode, user and group information. If the checksum matches - for a given file then the mode, user and group are changed - as necessary to match the checksum entry. A warning is printed - on the standard error for each mismatch. Requires the ast - package cksum(1) command. - view - Initialize the architecture specific viewpath hierarchy. The - make action implicitly calls this action. If \"flat\" is specified - then the \$INSTALLROOT { bin fun include lib } directories are - linked to the same directories in the package root. Only one - architecture may be flat. - write [closure] [cyg|exp|lcl|pkg|rpm|tgz|tst] [base|delta] - [binary|runtime|source] PACKAGE - Write a package archive for PACKAGE. All work is done in the - \$PACKAGEROOT/lib/package directory. FORMAT-specific files - are placed in the FORMAT subdirectory. A PACKAGE[.TYPE].tim - file in this directory tracksthe write time and prevents a - package from being read in the same root it was written. If - more than one file is generated for a particular FORMAT then - those files are placed in the FORMAT/PACKAGE subdirectory. - File names in the FORMAT subdirectory will contain the package - name, a YYYY-MM-DD date, and for binary packages, HOSTTYPE. - If PACKAGE is omitted then an ordered list of previously - written packages is generated. If \"only\" is specified then - only the named packages will be written; otherwise - prerequisite packages are written first. Package components - must be listed in PACKAGE.pkg. FORMAT may be one of: - cyg generate a cygwin package - exp generate an exptools(1) maintainer source archive - and NPD file in the exp subdirectory, suitable for - expmake(1); support files are placed in the - exp/PACKAGE subdirectory - lcl generate a package archive or delta in the lcl - subdirectory, suitable for restoration into the - primary source tree (no source licence annotation) - pkg generate a pkgmk(1) package, suitable for pkgadd(1) - rpm generate an rpm(1) package - tgz generate a gzip(1) tar(1) package archive; this is - the default - tst generate tgz FORMAT package archive in the tst - subdirectory; version state files are not updated - The package type must be one of source, binary or runtime. - A source package contains the source needed to build the - corresponding binary package. A binary package includes the - libraries and headers needed for compiling and linking - against the public interfaces. A runtime package contains - the commands and required dynamic libraries. A package may - be either a base or delta. A base package contains a - complete copy of all components. A delta package contains - only changes from a previous base package. Delta recipients - must have the ast pax(1) command (in the ast-base package.) - If neither base nor delta is specified, then the current - base is overwritten if there are no deltas referring to the - current base. Only the tgz and lcl formats support delta. - If base is specified then a new base and two delta archives - are generated: one delta to generate the new base from the - old, and one delta to generate the old base from the new; - the old base is then removed. If delta is specified then a - new delta referring to the current base is written. - package.pkg may reference other packages. By default a - pointer to those packages is written. The recipient package - read will then check that all required packages have been - downloaded. If closure is specified then the components for - all package references are included in the generated - package. This may be useful for lcl and versioning. All - formats but lcl annotate each source file (not already - annotated) with a license comment as it is written to the - package archive using proto(1). - name=value: - variable definition: typically CC=cc or CCFLAGS=-g." - ;; + The command arguments are composed of a sequence of words: zero or more + qualifiers, one action, and zero or more action-specific arguments, and zero + or more name=value definitions. optget(3) documentation options such as + --man, --html and --nroff are also supported. The default with no arguments + is host type. + + The qualifiers are: + debug|environment + Show environment and actions but do not execute. + flat With the make action, create a flat view by linking all files from + $INSTALLROOT, minus *.old files, onto their corresponding path under + $PACKAGEROOT. Only one architecture can have a flat view. If flat is + specified with the clean action, then only clean up this flat view + and do not delete $INSTALLROOT. + force Force the action to override saved state. + never Run make -N and show other actions. + only Only operate on the specified packages. + quiet Do not list captured action output. + show Run make -n and show other actions. + verbose + Provide detailed action output. + DEBUG Trace the package script actions in detail. + + The actions are: + clean | clobber + Clean up the flat view, if any. Then, unless flat was given, delete + the arch/HOSTTYPE hierarchy; this deletes all generated files and + directories for HOSTTYPE. The hierarchy can be rebuilt by package + make. + export [ variable ...] + List name=value for variable, one per line. If the only attribute is + specified then only the variable values are listed. If no variables + are specified then HOSTTYPE PACKAGEROOT INSTALLROOT PATH are assumed. + help [ action ] + Display help text on the standard error (standard output for action). + host [ attribute ... ] + List architecture/implementation dependent host information on the + standard output. type is listed if no attributes are specified. + Information is listed on a single line in attribute order. The + attributes are: + canon name + An external host type name to be converted to package syntax. + cpu The number of CPUs; 1 if the host is not a multiprocessor. + name The host name. + rating + The CPU rating in pseudo mips; the value is useful useful + only in comparisons with rating values of other hosts. Other + than a vax rating (mercifully) fixed at 1, ratings can vary + wildly but consistently from vendor mips ratings. cc(1) may + be required to determine the rating. + type The host type, usually in the form vendor.architecture, with + an optional trailing -version. The main theme is that type + names within a family of architectures are named in a + similar, predictable style. OS point release information is + avoided as much as possible, but vendor resistance to release + incompatibilities has for the most part been futile. + install To be reimplemented. + make [ package ] [ option ... ] [ target ... ] + Build and install. The default target is install, which makes and + installs package. If the standard output is a terminal then the + output is also captured in $INSTALLROOT/lib/package/gen/make.out. The + build is done in the $INSTALLROOT directory tree viewpathed on top of + the $PACKAGEROOT directory tree. Leaf directory names matching the + |-separated shell pattern $MAKESKIP are ignored. The view action is + done before making. option operands are passed to the underlying make + command. + results [ failed ] [ path ] [ old ] [make | test | write ] + List results and interesting messages captured by the most recent + make (default), test or write action. old specifies the previous + results, if any (current and previous results are retained). + $HOME/.pkgresults, if it exists, must contain an egrep(1) expression + of result lines to be ignored. failed lists failures only and path + lists the results file path name only. + test [ argument ... ] + Run the regression tests for ksh. If the standard output is a + terminal then the output is also captured in + $INSTALLROOT/lib/package/gen/test.out. ksh must be made before it can + be tested. All arguments following test are passed to bin/shtests. + See bin/shtests --man for more information. + use [ uid | package | . [ 32 | 64 ] | 32 | 64 | - ] [ command ...] + Run command, or an interactive shell if command is omitted, with the + environment initialized for using the package (can you say shared + library or dll without cussing?) If uid or package or . is specified + then it is used to determine a $PACKAGEROOT, possibly different from + the current directory. For example, to try out bozo'\''s package: + package use bozo. The use action may be run from any directory. If + the file $INSTALLROOT/lib/package/profile is readable then it is + sourced to initialize the environment. 32 or 64 implies $PACKAGEROOT + of . and specifies the target architecture word size (which may be + silently ignored). + view Initialize the architecture specific viewpath hierarchy. The make + action implicitly calls this action. + +DETAILS + The package directory hierarchy is rooted at $PACKAGEROOT. All source and + binaries reside under this tree. A two level viewpath is used to separate + source and binaries. The top view is architecture specific, the bottom view + is shared source. All building is done in the architecture specific view; no + source view files are intentionally changed. This means that many different + binary architectures can be made from a single copy of the source. + + Independent $PACKAGEROOT hierarchies can be combined by appending + $INSTALLROOT:$PACKAGEROOT pairs to VPATH. The VPATH viewing order is from + left to right. + + $HOSTYPE names the current binary architecture and is determined by the + output of package (no arguments). The $HOSTTYPE naming scheme is used to + separate incompatible executable and object formats. All architecture + specific binaries are placed under $INSTALLROOT + ($PACKAGEROOT/arch/$HOSTTYPE). There are a few places that match against + $HOSTTYPE when making binaries; these are limited to makefile compiler + workarounds, e.g., if $HOSTTYPE matches hp.* then turn off the optimizer for + these objects. All other architecture dependent logic is handled either by + the AST iffe(1) command or by component specific configure scripts. Explicit + $HOSTYPE values matching *,*cc*[,-*,...] optionally set the default CC and + CCFLAGS. This is handy for build farms that support different compilers on + the same architecture. + + Each component contains a MAM (make abstract machine) file (Mamfile). A + Mamfile contains a portable makefile description written in a simple + dependency tree language using indented make...done blocks. + + All scripts and commands under $PACKAGEROOT use $PATH relative pathnames (via + the AST pathpath(3) function); there are no embedded absolute pathnames. This + means that binaries generated under $PACKAGEROOT may be copied to a different + root; users need only change their $PATH variable to reference the new + installation root bin directory. package install installs binary packages in + a new $INSTALLROOT. + +SEE ALSO + autoconfig(1), cksum(1), execrate(1), expmake(1), gzip(1), make(1), + mamake(1), pax(1), pkgadd(1), pkgmk(1), rpm(1), sh(1), tar(1), optget(3) + +IMPLEMENTATION + version package (ksh 93u+m) 2021-12-31 + author Glenn Fowler + author Contributors to https://github.com/ksh93/ksh + copyright (c) 1994-2012 AT&T Intellectual Property + copyright (c) 2020-2021 Contributors to https://github.com/ksh93/ksh + license http://www.eclipse.org/org/documents/epl-v10.html' + case $1 in + html) echo "
    " ;; esac exit $code ;; *=*) set DEFAULT host type "$@" ;; - *) echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + *) # simulate AST getopt(3) usage output + echo "Usage: $command [ options ] [ qualifier ... ] [ action ] [ arg ... ] [ n=v ... ]" >&2 + echo " Help: $command [ --help | --man ] 2>&1" >&2 exit 2 ;; esac @@ -1343,7 +609,7 @@ do case $i in *:*=*) args="$args $i" continue ;; - *=*) eval `echo ' ' "$i" | sed 's,^[ ]*\([^=]*\)=\(.*\),n=\1 v='\''\2'\'','` + *=*) n=${i%%=*} v=${i#*=} ;; esac case $i in @@ -1363,8 +629,6 @@ do case $i in ?*) KEEP_HOSTTYPE=1 ;; esac ;; - HURL=*) eval $n='$'v - ;; PACKAGEROOT=*) eval $n='$'v case $PACKAGEROOT in @@ -1376,11 +640,6 @@ do case $i in ?*) KEEP_SHELL=1 ;; esac ;; - TAR=*) eval $n='$'v - ;; - TARFLAGS=*) - eval $n='$'v - ;; VPATH=*)eval USER_$n='$'v ;; 'debug=1') @@ -1409,13 +668,13 @@ esac # Add build type flags via KSH_RELFLAGS, which is used in src/cmd/ksh93/Mamfile. # (Avoid using CCFLAGS; setting it would overwrite autodetected optimization flags.) ksh_relflags= -case `git branch 2>/dev/null` in +case $(git branch 2>/dev/null) in '' | *\*\ [0-9]*.[0-9]*) # If we're not on a git branch (tarball) or on a branch that starts # with a number (release branch), then compile as a release version ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_ksh_release" ;; *) # Otherwise, add 8-character git commit hash if available, and if the working dir is clean - git_commit=`git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD` + git_commit=$(git status >/dev/null 2>&1 && git diff-index --quiet HEAD && git rev-parse --short=8 HEAD) case $git_commit in ????????) ksh_relflags="${ksh_relflags:+$ksh_relflags }-D_AST_git_commit=\\\"$git_commit\\\"" ;; @@ -1448,52 +707,6 @@ esac # grab action specific args case $action in -admin) while : - do case $# in - 0) set list - break - ;; - esac - case $1 in - all) admin_all=1 - ;; - db) case $# in - 1) echo $command: $action: $1: db file argument expected >&2 - exit 1 - ;; - esac - shift - admin_db=$1 - ;; - on) case $# in - 1) echo $command: $action: $1: host pattern argument expected >&2 - exit 1 - ;; - esac - shift - admin_on=$1 - ;; - *) break - ;; - esac - shift - done - admin_action=$1 - admin_args=$* - for i - do case $i in - debug|environment|force|never|only|quiet|show|DEBUG) - ;; - *) admin_action=$i - break - ;; - esac - done - ;; -setup) PACKAGEROOT=${PWD:-`pwd`} - export PACKAGEROOT - KEEP_PACKAGEROOT=1 - ;; use) case $1 in .|32|64)case $1 in 32|64) bit=$1 ;; @@ -1504,7 +717,7 @@ use) case $1 in case $HOSTTYPE in win32.*)sys=uwin - wow=`uname -i` + wow=$(uname -i) case $bit in 32) case $HOSTTYPE in *-64) HOSTTYPE=${HOSTTYPE%-64} ;; @@ -1515,7 +728,7 @@ use) case $1 in *) HOSTTYPE=$HOSTTYPE-64 ;; esac case $wow in - */32) echo $command: cannot build $bit-bit on $wow $sys >&2; exit 2 ;; + */32) err_out "cannot build $bit-bit on $wow $sys" ;; esac ;; esac @@ -1527,8 +740,8 @@ use) case $1 in $exec umask 002 $exec unset MAKESKIP - $exec export P=$PWD - $exec export A=$P/arch/$HOSTTYPE + P=$PWD + A=$P/arch/$HOSTTYPE $exec export CDPATH=:..:$A/src/cmd:$A/src/lib:$A/src/uwin:$P/lib/package $exec export INSTALLROOT=$A @@ -1557,7 +770,7 @@ use) case $1 in exit ;; esac - PACKAGEROOT=${PWD:-`pwd`} + PACKAGEROOT=$PWD $show export PACKAGEROOT esac ;; @@ -1581,7 +794,7 @@ executable() # [!] command } # initialize SHELLMAGIC -# tangible proof of cygwin's disdain for unix (well, this and execrate) +# tangible proof of Cygwin's disdain for Unix (well, this and execrate) shellmagic() { @@ -1626,17 +839,6 @@ onpath() # command return 1 } -# true if no nmake or nmake not from AT&T or nmake too old - -nonmake() # nmake -{ - _nonmake_version=`( $1 -n -f - 'print $(MAKEVERSION:@/.*AT&T.* //:/-//G:@/.* .*/19960101/)' . ) /dev/null || echo 19840919` - if test $_nonmake_version -lt 20001031 - then return 0 - fi - return 1 -} - # determine local host attributes hostinfo() # attribute ... @@ -1656,28 +858,8 @@ hostinfo() # attribute ... done PATH=$PATH:$i/bin done - # LD_LIBRARY_PATH may be out of sync with PATH here - case $SED in - '') SED=sed - $SED 1d < /dev/null > /dev/null 2>&1 || - for dir in /bin /usr/bin - do if test -x $dir/$SED - then SED=$dir/$SED - break - fi - done - TR=tr - $TR < /dev/null > /dev/null 2>&1 || - for dir in /bin /usr/bin - do if test -x $dir/$TR - then TR=$dir/$TR - break - fi - done - ;; - esac case $PACKAGE_PATH in - ?*) for i in `echo $PACKAGE_PATH | $SED 's,:, ,g'` + ?*) for i in $(echo "$PACKAGE_PATH" | sed 's,:, ,g') do PATH=$PATH:$i/bin done ;; @@ -1701,16 +883,14 @@ hostinfo() # attribute ... cpu|name|rating|type) something=1 ;; - *) echo "$command: $action: $info: unknown attribute" >&2 - exit 1 + *) err_out "$action: $info: unknown attribute" ;; esac ;; esac done case $canon in - -) echo "$command: $action: canon: host type name expected" >&2 - exit 1 + -) err_out "$action: canon: host type name expected" ;; esac case $something in @@ -1728,20 +908,14 @@ hostinfo() # attribute ... for info do case $info in - cpu) case $NPROC in - [123456789]*) - _hostinfo_="$_hostinfo_ $NPROC" - continue - ;; - esac - cpu=`sysctl -n hw.ncpu` + cpu) cpu=$(sysctl -n hw.ncpu) case $cpu in [123456789]*) _hostinfo_="$_hostinfo_ $cpu" continue ;; esac - cpu=`grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo` + cpu=$(grep -ic '^processor[ ][ ]*:[ ]*[0123456789]' /proc/cpuinfo) case $cpu in [123456789]*) _hostinfo_="$_hostinfo_ $cpu" @@ -1760,7 +934,7 @@ hostinfo() # attribute ... do case $# in 0) break ;; esac - i=`$1 2>/dev/null | grep -c "$2"` + i=$($1 2>/dev/null | grep -c "$2") case $i in [123456789]*) cpu=$i @@ -1778,8 +952,8 @@ hostinfo() # attribute ... 0) break ;; esac if executable $1 - then case `$1 | grep -ic '^cpu '` in - 1) cpu=`$1 | grep -ic '^ *[0123456789][0123456789]* '` + then case $($1 | grep -ic '^cpu ') in + 1) cpu=$($1 | grep -ic '^ *[0123456789][0123456789]* ') break ;; esac @@ -1801,9 +975,9 @@ hostinfo() # attribute ... do case $# in 0) break ;; esac - i=`$1 2>/dev/null | $TR ' ' ' + i=$($1 2>/dev/null | tr ' ' ' -' | grep -c "^$2"` +' | grep -c "^$2") case $i in [123456789]*) cpu=$i @@ -1830,7 +1004,7 @@ hostinfo() # attribute ... do case $# in 0) break ;; esac - i=`$1 2>/dev/null | $SED -e "${2}!d" -e "s${3}"` + i=$($1 2>/dev/null | sed -e "${2}!d" -e "s${3}") case $i in [123456789]*) cpu=$i @@ -1842,7 +1016,7 @@ hostinfo() # attribute ... ;; esac case $cpu in - 0|1) cpu=`( + 0|1) cpu=$( cd "$TMPDIR" tmp=hi$$ trap 'rm -f $tmp.*' 0 1 2 @@ -1862,7 +1036,7 @@ int main() break fi done - )` + ) case $cpu in [0123456789]*) ;; *) cpu=1 ;; @@ -1871,10 +1045,10 @@ int main() esac _hostinfo_="$_hostinfo_ $cpu" ;; - name) _name_=`hostname || uname -n || cat /etc/whoami || echo local` + name) _name_=$(hostname || uname -n || cat /etc/whoami || echo local) _hostinfo_="$_hostinfo_ $_name_" ;; - rating) for rating in `grep -i ^bogomips /proc/cpuinfo 2>/dev/null | $SED -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,'` + rating) for rating in $(grep -i ^bogomips /proc/cpuinfo 2>/dev/null | sed -e 's,.*:[ ]*,,' -e 's,\(...*\)\..*,\1,' -e 's,\(\..\).*,\1,') do case $rating in [0123456789]*) break ;; esac @@ -1963,7 +1137,7 @@ int main() for o in -DTZ -DTD '' do if $CC $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 || gcc $o -O -o $tmp.exe $tmp.c >/dev/null 2>&1 - then rating=`./$tmp.exe` + then rating=$(./$tmp.exe) break fi done @@ -1994,10 +1168,10 @@ int main() ;; esac case $cc in - /*) a=`$cc -dumpmachine $CCFLAGS 2>/dev/null` + /*) a=$($cc -dumpmachine $CCFLAGS 2>/dev/null) case $a in '') case $CCFLAGS in - ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + ?*) a=$($cc -dumpmachine 2>/dev/null) ;; esac ;; esac @@ -2030,10 +1204,10 @@ int main() '') case $cc in /*|cc) ;; *) if executable $i/$cc - then a=`$i/$cc -dumpmachine $CCFLAGS 2>/dev/null` + then a=$($i/$cc -dumpmachine $CCFLAGS 2>/dev/null) case $a in '') case $CCFLAGS in - ?*) a=`$cc -dumpmachine 2>/dev/null` ;; + ?*) a=$($cc -dumpmachine 2>/dev/null) ;; esac ;; esac @@ -2052,7 +1226,7 @@ int main() ;; esac if test -f "$i/$f" - then map="`grep -v '^#' $i/$f` $map" + then map="$(grep -v '^#' $i/$f) $map" fi done @@ -2060,25 +1234,25 @@ int main() case -${canon}- in --|*-powerpc-*) - h=`hostname || uname -n || cat /etc/whoami` + h=$(hostname || uname -n || cat /etc/whoami) case $h in '') h=local ;; esac - a=`arch || uname -m || att uname -m || uname -s || att uname -s` + a=$(arch || uname -m || att uname -m || uname -s || att uname -s) case $a in - *[\ \ ]*) a=`echo $a | $SED "s/[ ]/-/g"` ;; + *[\ \ ]*) a=$(echo $a | sed "s/[ ]/-/g") ;; esac case $a in '') a=unknown ;; esac - m=`mach || machine || uname -p || att uname -p` + m=$(mach || machine || uname -p || att uname -p) case $m in - *[\ \ ]*) m=`echo $m | $SED "s/[ ]/-/g"` ;; + *[\ \ ]*) m=$(echo $m | sed "s/[ ]/-/g") ;; esac case $m in '') m=unknown ;; esac - x=`uname -a || att uname -a` + x=$(uname -a || att uname -a) case $x in '') x="unknown $host unknown unknown unknown unknown unknown" ;; esac @@ -2096,7 +1270,7 @@ int main() esac case $os in [abcdefghijklmnopqrstuvwxyz]*[0123456789]) - eval `echo $os | $SED -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/'` + eval $(echo $os | sed -e 's/^\([^0123456789.]*\)\.*\(.*\)/os=\1 rel=\2/') ;; esac ;; @@ -2107,7 +1281,7 @@ int main() esac type=unknown case $host in - *.*) host=`echo $host | $SED -e 's/\..*//'` ;; + *.*) host=$(echo $host | sed -e 's/\..*//') ;; esac case $mach in unknown) @@ -2167,14 +1341,14 @@ int main() 9000/[78]*) type=hp.pa ;; - */*) type=hp.`echo $arch | $SED 's,/,_,g'` + */*) type=hp.$(echo $arch | sed 's,/,_,g') ;; *) type=hp.$arch ;; esac ;; [Ii][Rr][Ii][Xx]*) - set xx `hinv | $SED -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + set xx $(hinv | sed -e '/^CPU:/!d' -e 's/CPU:[ ]*\([^ ]*\)[ ]*\([^ ]*\).*/\1 \2/' -e q | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) shift type=$1 n= @@ -2219,12 +1393,12 @@ int main() fi split=' ' - a=`strings $a < /dev/null | $SED -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | $SED -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q` + a=$(strings $a < /dev/null | sed -e 's/[^abcdefghijklmnopqrstuvwxyz0123456789]/ /g' -e 's/[ ][ ]*/\'"$split"'/g' | sed -e "/^${type}[0123456789]$/!d" -e "s/^${type}//" -e q) case $a in [0123456789]) n=$a ;; esac case $n in - 4) a=`$cc -${type}3 2>&1` + 4) a=$($cc -${type}3 2>&1) case $a in *unknown*|*install*|*conflict*) ;; @@ -2233,7 +1407,7 @@ int main() esac ;; esac - a=`$cc -show F0oB@r.c 2>&1` + a=$($cc -show F0oB@r.c 2>&1) case $n:$a in [!2]:*mips2*) n=2 ;; [!23]:*mips3*) n=3 ;; @@ -2255,7 +1429,7 @@ int main() type=sco ;; [Ss]ol*) - v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + v=$(echo $rel | sed -e 's/^[25]\.//' -e 's/\.[^.]*$//') case $v in [6789]|[1-9][0-9]) ;; @@ -2274,7 +1448,7 @@ int main() esac type=sol$v.$arch ;; - [Ss]un*)type=`echo $arch | $SED -e 's/\(sun.\).*/\1/'` + [Ss]un*)type=$(echo $arch | sed -e 's/\(sun.\).*/\1/') case $type in sparc) type=sun4 ;; esac @@ -2295,7 +1469,7 @@ int main() esac ;; esac - v=`echo $rel | $SED -e 's/^[25]\.//' -e 's/\.[^.]*$//'` + v=$(echo $rel | sed -e 's/^[25]\.//' -e 's/\.[^.]*$//') case $v in [6789]|[1-9][0-9]) ;; @@ -2352,7 +1526,7 @@ int main() FTX*|ftx*) case $mach in *[0123456789][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*) - mach=`echo $mach | $SED -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//'` + mach=$(echo $mach | sed -e 's/[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ]*$//') ;; esac type=stratus.$mach @@ -2362,7 +1536,7 @@ int main() type=os2 arch=$rel ;; - *) type=`echo $os | $SED -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//'` + *) type=$(echo $os | sed -e 's/[0123456789].*//' -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_0123456789.].*//') ;; esac case $type in @@ -2371,7 +1545,7 @@ int main() ;; [Uu][Ww][Ii][Nn]*|[Ww]indows_[0123456789][0123456789]|[Ww]indows_[Nn][Tt]) type=win32 - arch=`echo $arch | $SED -e 's/_[^_]*$//'` + arch=$(echo $arch | sed -e 's/_[^_]*$//') ;; esac case $arch in @@ -2420,16 +1594,16 @@ int main() esac case $type in *[-_]32|*[-_]64|*[-_]128) - bits=`echo $type | $SED 's,.*[-_],,'` - type=`echo $type | $SED 's,[-_][0-9]*$,,'` + bits=$(echo $type | sed 's,.*[-_],,') + type=$(echo $type | sed 's,[-_][0-9]*$,,') ;; *) bits= ;; esac - type=`echo $type | $SED -e 's%[-+/].*%%' | $TR ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + type=$(echo $type | sed -e 's%[-+/].*%%' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) case $type in - *.*) lhs=`echo $type | $SED -e 's/\..*//'` - rhs=`echo $type | $SED -e 's/.*\.//'` + *.*) lhs=$(echo $type | sed -e 's/\..*//') + rhs=$(echo $type | sed -e 's/.*\.//') case $rhs in [x0123456789]*86) rhs=i$rhs ;; 68*) rhs=m$rhs ;; @@ -2439,7 +1613,7 @@ int main() rhs=i386 ;; powerpc) rhs=ppc ;; s[0123456789]*[0123456789]x) - rhs=`echo $rhs | $SED -e 's/x$/-64/'` ;; + rhs=$(echo $rhs | sed -e 's/x$/-64/') ;; esac case $rhs in arm[abcdefghijklmnopqrstuvwxyz_][0123456789]*) @@ -2453,12 +1627,12 @@ int main() ?*dwarf)x=coff ;; ?*elf) x=elf ;; esac - lhs=`echo ${lhs}XXX | $SED -e "s/${x}XXX//"` + lhs=$(echo ${lhs}XXX | sed -e "s/${x}XXX//") ;; esac case $lhs in bsdi) lhs=bsd ;; - darwin) case `/usr/bin/cc --version` in + darwin) case $(/usr/bin/cc --version) in *'(GCC)'*) case $rel in [0-9].*|10.*) lhs=darwin07 ;; *) lhs=darwin11 ;; @@ -2467,7 +1641,7 @@ int main() ;; freebsd) case $rel in [01234].*) lhs=${lhs}4 ;; - [123456789]*.*) lhs=${lhs}`echo $rel | $SED -e 's/\..*//'` ;; + [123456789]*.*) lhs=${lhs}$(echo $rel | sed -e 's/\..*//') ;; esac ;; hpux) lhs=hp ;; @@ -2496,7 +1670,7 @@ int main() *) abi=-64 ;; esac ;; - *) pwd=`pwd` + *) pwd=$PWD cd "$TMPDIR" tmp=hi$$ trap 'rm -f $tmp.*' 0 1 2 @@ -2521,7 +1695,7 @@ int b() { return 0; } esac if $cc $abi -mips$i -c $tmp.b.c && $cc -o $tmp.exe $tmp.a.o $tmp.b.o - then type=`echo $type | $SED -e 's/.$//'`$i + then type=$(echo $type | sed -e 's/.$//')$i break fi done @@ -2552,14 +1726,17 @@ int b() { return 0; } esac ;; *) case $bits in - '') bits=` cd "$TMPDIR" + '') bits=$( set -e + cd "$TMPDIR" tmp=hi$$ - trap 'rm -f $tmp.*' 0 1 2 + trap 'rm -rf "$tmp".*' 0 1 2 echo 'int main() { return 0; }' > $tmp.a.c + checkcc $cc $CCFLAGS -o $tmp.a.exe $tmp.a.c /dev/null 2>&1 - file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" ` + file $tmp.a.exe 2>/dev/null | sed "s/$tmp\.a\.exe//g" ) case $bits in - *64*) bits=64 ;; + *\ 64-bit* | *\ 64\ bit* | *\ 64bit*) + bits=64 ;; *) bits= ;; esac ;; @@ -2610,7 +1787,13 @@ int b() { return 0; } note() # message ... { - echo $command: "$@" >&2 + printf "$command: %s\\n" "$@" >&2 +} + +err_out() +{ + note "$@" + exit 1 } # cc checks @@ -2624,7 +1807,10 @@ checkcc() if onpath $CC then cc=$_onpath_ else case $CC in - cc) if onpath gcc + cc) if onpath clang + then CC=clang + cc=$_onpath_ + elif onpath gcc then CC=gcc cc=$_onpath_ fi @@ -2633,7 +1819,7 @@ checkcc() fi case $cc in '') case $action in - make|test) note "$CC: not found"; exit 1 ;; + make|test) err_out "$CC: not found" ;; *) note "warning: $CC: not found" ;; esac ;; @@ -2693,8 +1879,7 @@ case $x in OK=ok KSH=$EXECROOT/bin/ksh - MAKE=nmake - NMAKE=$EXECROOT/bin/$MAKE + MAKE=mamake SUM=$EXECROOT/bin/sum TEE=$EXECROOT/bin/tee INITROOT=$PACKAGEROOT/src/cmd/INIT @@ -2715,10 +1900,10 @@ case $x in -|.) ;; /*) PACKAGEROOT=$1 ;; - *) i=`echo ~$1` + *) i=$(echo ~$1) if packageroot $i then PACKAGEROOT=$i - else for i in `echo $HOME | sed -e 's,/[^/]*$,,'` $usr $use + else for i in $(echo $HOME | sed -e 's,/[^/]*$,,') $usr $use do if packageroot $i/$1 then PACKAGEROOT=$i/$1 break @@ -2737,7 +1922,7 @@ case $x in ;; esac case $PACKAGEROOT in - '') PACKAGEROOT=${PWD:-`pwd`} ;; + '') PACKAGEROOT=$PWD ;; esac # . must be within the PACKAGEROOT tree @@ -2804,7 +1989,7 @@ case $x in export HOSTTYPE INSTALLROOT=$PACKAGEROOT/arch/$HOSTTYPE case $action in - admin|install|make|read|remove|test|verify|view|write) + install|make|remove|test|view) ;; *) if test ! -d $INSTALLROOT then INSTALLROOT=$PACKAGEROOT @@ -2819,16 +2004,12 @@ case $x in case $action in export|use) - packageroot $PACKAGEROOT || { - echo "$command: $PACKAGEROOT: invalid package root directory" >&2 - exit 1 - } + packageroot $PACKAGEROOT || err_out "$PACKAGEROOT: invalid package root directory" case $KEEP_HOSTTYPE:$hosttype in 0:?*) if test -d ${PACKAGEROOT:-.}/arch/$hosttype then KEEP_HOSTTYPE=1 HOSTTYPE=$hosttype - else echo "$command: $hosttype: package root not found" >&2 - exit 1 + else err_out "$hosttype: package root not found" fi ;; esac @@ -2836,22 +2017,17 @@ case $x in *) packageroot $PACKAGEROOT || { case $KEEP_PACKAGEROOT in 1) ;; - *) echo "$command: $PACKAGEROOT: must be in the package root directory tree" >&2 - exit 1 + *) err_out "$PACKAGEROOT: must be in the package root directory tree" ;; esac } - case $action in - admin) ;; - *) for i in arch arch/$HOSTTYPE - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - for i in lib - do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit - done - ;; - esac + for i in arch arch/$HOSTTYPE + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit + done + for i in lib + do test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit + done # no $INITROOT means INIT already installed elsewhere @@ -2861,9 +2037,9 @@ case $x in for i in execrate ignore mamprobe silent do test -h $PACKAGEROOT/bin/$i 2>/dev/null || - case `ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null` in + case $(ls -t $INITROOT/$i.sh $PACKAGEROOT/bin/$i 2>/dev/null) in "$INITROOT/$i.sh"*) - note update $PACKAGEROOT/bin/$i + note "update $PACKAGEROOT/bin/$i" shellmagic case $SHELLMAGIC in '') $exec cp $INITROOT/$i.sh $PACKAGEROOT/bin/$i || exit @@ -2903,11 +2079,10 @@ cat $INITROOT/$i.sh cp $INITROOT/hello.c pkg$$.c || exit 3 $cc -o pkg$$.exe pkg$$.c > pkg$$.e 2>&1 || { if $cc -Dnew=old -o pkg$$.exe pkg$$.c > /dev/null 2>&1 - then echo "$command: ${warn}$CC: must be a C compiler (not C++)" >&2 + then err_out "${warn}$CC: must be a C compiler (not C++)" else cat pkg$$.e - echo "$command: ${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" >&2 + err_out "${warn}$CC: failed to compile and link $INITROOT/hello.c -- is it a C compiler?" fi - exit 2 } if ./pkg$$.exe >/dev/null 2>&1 then code=0 @@ -2935,7 +2110,7 @@ cat $INITROOT/$i.sh if executable /lib32/$x || executable /lib64/$x then case $INSTALLROOT in */sgi.mips[0123456789]*) - u=`echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,'` + u=$(echo $INSTALLROOT | sed -e 's,-[^-/]*$,,' -e 's,.$,,') ;; *) u= ;; @@ -3084,10 +2259,10 @@ cat $INITROOT/$i.sh $show export PATH export PATH ;; - *) for i in package proto nmake + *) for i in package do if onpath $i - then EXECROOT=`echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,'` - EXECTYPE=`echo $EXECROOT | sed -e 's,.*/,,'` + then EXECROOT=$(echo $_onpath_ | sed -e 's,//*[^/]*//*[^/]*$,,') + EXECTYPE=$(echo $EXECROOT | sed -e 's,.*/,,') break fi done @@ -3099,11 +2274,10 @@ cat $INITROOT/$i.sh EXECTYPE=$_hostinfo_ case $HOSTTYPE in $EXECTYPE) - echo "$command: $CC: seems to be a cross-compiler" >&2 - echo "$command: set HOSTTYPE to something other than the native $EXECTYPE" >&2 - echo "$command: If not, your $TMPDIR directory may be mounted without execute permission." >&2 - echo "$command: Try exporting TMPDIR as a directory where you can execute binary files." >&2 - exit 1 + err_out "$CC seems to be a cross-compiler." \ + "Set HOSTTYPE to something other than the native $EXECTYPE." \ + "If not, your $TMPDIR directory may be mounted without execute permission." \ + "Try exporting TMPDIR as a directory where you can execute binary files." ;; esac ;; @@ -3121,8 +2295,7 @@ cat $INITROOT/$i.sh OK=ok KSH=$EXECROOT/bin/ksh - MAKE=nmake - NMAKE=$EXECROOT/bin/$MAKE + MAKE=mamake SUM=$EXECROOT/bin/sum TEE=$EXECROOT/bin/tee @@ -3131,7 +2304,7 @@ cat $INITROOT/$i.sh checksh "$SHELL" || KEEP_SHELL=0 case $KEEP_SHELL in 0) save_PATH=$PATH - if PATH=`getconf PATH 2>/dev/null` + if PATH=$(getconf PATH 2>/dev/null) then PATH=$PATH:$path else PATH=/bin:/usr/bin:/sbin:/usr/sbin:$path fi @@ -3145,8 +2318,8 @@ cat $INITROOT/$i.sh PATH=$save_PATH unset save_PATH case $KEEP_SHELL in - 0) echo "Cannot find good default shell, please supply SHELL=/path/to/shell" >&2 - exit 1 ;; + 0) err_out "Cannot find a good default shell; please supply SHELL=/path/to/shell" + ;; esac ;; esac @@ -3204,9 +2377,6 @@ cat $INITROOT/$i.sh ?*) USER_VPATH=$USER_VPATH:$i USER_VPATH_CHAIN="$USER_VPATH_CHAIN $p $i" p=$i - case $PROTOROOT in - -) executable $i/bin/mamake && PROTOROOT= ;; - esac ;; esac done @@ -3215,7 +2385,6 @@ cat $INITROOT/$i.sh ;; esac -PACKAGESRC=$PACKAGEROOT/lib/package PACKAGEBIN=$INSTALLROOT/lib/package case $action:$run in use:-) set '' $args @@ -3234,7 +2403,7 @@ if test -r $INSTALLROOT/lib/package/profile then . $INSTALLROOT/lib/package/profile fi -# more cygwin hassles +# more Cygwin hassles case $HOSTTYPE in cygwin.*) @@ -3261,8 +2430,7 @@ cygwin.*) ;; esac case $lose in - ?*) echo "$command: $HOSTTYPE: export '$lose' in CYGWIN or languish in windows" >&2 - exit 1 + ?*) err_out "$HOSTTYPE: export '$lose' in CYGWIN or languish in Windows" ;; esac ;; @@ -3329,7 +2497,7 @@ view() # [test] [-|type] [src|bin|all] file esac _view_= case $_view_t_ in - ?*) echo $command: $1: $_view_t_ not found >&2 ;; + ?*) note "$1: $_view_t_ not found" ;; esac return 1 } @@ -3337,83 +2505,6 @@ view() # [test] [-|type] [src|bin|all] file # determine the package and targets case $action in -admin) case $admin_action in - results)action=$admin_action - set '' $admin_args - shift;shift - admin_args="admin $*" - case $admin_on in - '') target=$admin_args ;; - *) target="on $admin_on $admin_args" ;; - esac - ;; - esac - ;; -release)set '' $args - target= - while : - do shift - case $1 in - -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) - target="$target $1" - ;; - *) break - ;; - esac - done - package=$* - ;; -setup) # { update read } with optional (bin|fun|include|lib) symlinks - # flat option sets up { bin fun include lib } symlinks from - # $INSTALLROOT to $PACKAGEROOT - - # . is the package root - - set '' $args - shift - types= - url= - while : - do case $# in - 0) break ;; - esac - case $1 in - --) shift - break - ;; - flat) flat=1 # backwards compatibility -- documentation dropped - ;; - *://*|*.url) - url=$1 - shift - break - ;; - *) types="$types $1" - ;; - esac - shift - done - if test ! -d $PACKAGEROOT/lib/package/tgz - then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit - fi - case " $types " in - *" source "*) - case " $* " in - ' ') ;; - *" INIT "*) - ;; - *) view - all src/cmd/INIT || - set INIT "$@" - ;; - esac - ;; - esac - packages=`$0 $global authorize "$authorize" password "$password" update setup $types $url "$@" PACKAGEROOT=$PACKAGEROOT` - case $packages in - ?*) $0 $global read $packages PACKAGEROOT=$PACKAGEROOT - esac - exit - ;; *) package= target= set '' $args @@ -3437,127 +2528,22 @@ setup) # { update read } with optional (bin|fun|include|lib) symlinks ;; esac -# flatten -- assumes symlink support - -case $flat in -1) case $action in - make|read|setup|update|use|view) - if test ! -d $INSTALLROOT - then $exec mkdir -p $INSTALLROOT || exit - fi - for i in bin include lib fun man share - do if test ! -d $INSTALLROOT/../../$i - then $exec mkdir $INSTALLROOT/../../$i - fi - if test ! -d $INSTALLROOT/$i - then if test ! -h $INSTALLROOT/$i - then $exec ln -s ../../$i $INSTALLROOT/$i - fi - elif test ! -h $INSTALLROOT/$i - then for x in $INSTALLROOT/$i/.[a-z]* $INSTALLROOT/$i/* - do if test -f $x -o -d $x - then if test ! -d $INSTALLROOT/$i/$x || test ! -d $INSTALLROOT/../../$i/$x - then $exec mv $x $INSTALLROOT/../../$i - fi - fi - done - $exec rm -rf $INSTALLROOT/$i - $exec ln -s ../../$i $INSTALLROOT/$i - fi - done - ;; - esac - ;; -esac - # check that cmd args are up to date a.out's checkaout() # cmd ... { - case $PROTOROOT in - -) PROTOROOT= - case $* in - ratz) if test -f $INITROOT/ratz.c -a -w $PACKAGEROOT - then test -f $INITROOT/hello.c || { - cat > $INITROOT/hello.c <<'!' -#ifndef printf -#include -#endif -int main() { int new = 0; printf("hello world\n"); return new;} -! - } - test -f $INITROOT/p.c || { - cat > $INITROOT/p.c <<'!' -/* - * small test for prototyping cc - */ - -int main(int argc, char** argv) { return argc || argv; } -! - } - fi - ;; - esac - test -f $INITROOT/hello.c -a -f $INITROOT/p.c -a -w $PACKAGEROOT || { - for i - do onpath $i || { - echo "$command: $i: command not found" >&2 - return 1 - } - done - return 0 + case $cc in + '') _PACKAGE_cc=0 + ;; + *) _PACKAGE_cc=1 + test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { + note "$INITROOT: INIT package source not found" + return 1 } - case $cc in - '') _PACKAGE_cc=0 - ;; - *) _PACKAGE_cc=1 - test -f $INITROOT/hello.c -a -f $INITROOT/p.c || { - echo "$command: $INITROOT: INIT package source not found" >&2 - return 1 - } - executable $INSTALLROOT/bin/nmake || { - # check for prototyping cc - # NOTE: proto.c must be K&R compatible - $CC -c $INITROOT/p.c >/dev/null 2>&1 - c=$? - rm -f p.* - test 0 != "$c" && { - checkaout proto || return - PROTOROOT=$PACKAGEROOT/proto - $show PROTOROOT=$PACKAGEROOT/proto - export PROTOROOT - INITPROTO=$PROTOROOT/src/cmd/INIT - note proto convert $PACKAGEROOT/src into $PROTOROOT/src - if test -d $PACKAGEROOT/src/cmd/nmake - then dirs="src/cmd/INIT src/lib/libast src/lib/libardir src/lib/libpp src/cmd/probe src/cmd/cpp src/cmd/nmake" - else dirs="src" - fi - ( - if test -f $PROTOROOT/UPDATE - then newer="-newer $PROTOROOT/UPDATE" - else newer="" - fi - case $exec in - '') cd $PACKAGEROOT - find $dirs -name '*.[CcHh]' $newer -print | proto -v -L - -C proto - ;; - *) $exec cd $PACKAGEROOT - $exec "find $dirs -name '*.[CcHh]' $newer -print | proto -L - -C proto" - ;; - esac - $exec touch $PROTOROOT/UPDATE - ) - VPATH=$INSTALLROOT:$PROTOROOT:$PACKAGEROOT$USER_VPATH - $show VPATH=$VPATH - export VPATH - } - } - for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return - done - ;; - esac + for i in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || return + done ;; esac case $_PACKAGE_cc in @@ -3587,17 +2573,17 @@ int main(int argc, char** argv) { return argc || argv; } *00) view - bin/$i && continue ;; esac case $k in - 000) echo "$command: $i: not found: download the INIT package $HOSTTYPE binary to continue" >&2 + 000) note "$i: not found: download the INIT package $HOSTTYPE binary to continue" return 1 ;; - 010) echo "$command: $i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" >&2 + 010) note "$i: not found: set CC=C-compiler or download the INIT package $HOSTTYPE binary to continue" return 1 ;; - 100) echo "$command: $i: not found: download the INIT package source or $HOSTTYPE binary to continue" >&2 + 100) note "$i: not found: download the INIT package source or $HOSTTYPE binary to continue" return 1 ;; 110) case $CROSS in - 1) echo "$command: $i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" >&2 + 1) note "$i: not found: make the local $EXECTYPE binary package before $HOSTTYPE" return 1 ;; esac @@ -3613,33 +2599,15 @@ int main(int argc, char** argv) { return argc || argv; } esac ;; esac - case `ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null` in + case $(ls -t $INITROOT/$i.c $INSTALLROOT/bin/$i 2>/dev/null) in "$INITROOT/$i.c"*) - note update $INSTALLROOT/bin/$i - if test proto != "$i" && executable $INSTALLROOT/bin/proto - then case $exec in - '') $INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c || return ;; - *) $exec "$INSTALLROOT/bin/proto -p $INITROOT/$i.c > $i.c" ;; - esac - $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $i.c || return - $exec rm -f $i.c - else if test ! -d $INSTALLROOT/bin - then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin - do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return - done - fi - if test '' != "$PROTOROOT" -a -f $INITPROTO/$i.c - then $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITPROTO/$i.c || return - else $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return - fi - case $i:$exec in - proto:) test -d $INSTALLROOT/include || mkdir $INSTALLROOT/include - $INSTALLROOT/bin/proto -f /dev/null > $i.c - cmp -s $i.c $INSTALLROOT/include/prototyped.h 2>/dev/null || cp $i.c $INSTALLROOT/include/prototyped.h - rm $i.c - ;; - esac + note "update $INSTALLROOT/bin/$i" + if test ! -d $INSTALLROOT/bin + then for j in arch arch/$HOSTTYPE arch/$HOSTTYPE/bin + do test -d $PACKAGEROOT/$j || $exec mkdir $PACKAGEROOT/$j || return + done fi + $exec $CC $CCFLAGS -o $INSTALLROOT/bin/$i $INITROOT/$i.c || return test -f $i.o && $exec rm -f $i.o i=$PATH PATH=/bin @@ -3650,269 +2618,6 @@ int main(int argc, char** argv) { return argc || argv; } return 0 } -# check package requirements against received packages - -requirements() # source|binary [ package ] -{ - case $1 in - binary) r=$VIEW_BIN ;; - source) r=$VIEW_SRC ;; - *) r=$VIEW_ALL ;; - esac - shift - case $1 in - '') x= ;; - *) x=$* ;; - esac - set '' - for d in $r - do set "$@" $d/gen/*.ver - case $x in - '') set "$@" $d/gen/*.req - ;; - *) for p in $x - do set "$@" $d/gen/$p.req - done - ;; - esac - done - shift - e=0 - x=$* - y= - n= - set '' - for i in $x - do p=`echo $i | sed -e 's,.*/,,' -e 's,\....$,,'` - if test -f $i - then set "$@" $i - y="$y $p" - else case $p in - '*') ;; - *) n="$n $p" ;; - esac - fi - done - for i in $n - do case " $y " in - *" $i "*) - ;; - *) echo "$command: $i: must read or write package" >&2 - e=1 - ;; - esac - done - case $e in - 1) exit 1 ;; - esac - shift - test 0 != "$#" && release=`sort -r "$@" | { - q= - e=0 - o= - while read p v r s - do q="$q -$v $r" - case $p in - $o) continue ;; - esac - case $s in - 0) e=1 - case $r in - base) echo "$command: base package $p.$v or newer required" >&2 ;; - *) echo "$command: delta package $p.$v.$r or newer required" >&2 ;; - esac - ;; - esac - o=$p - done - case $e in - 0) echo "$q" | sort | { read v r; read v r; echo $v; } ;; - 1) echo ERROR ;; - esac - }` - case $release in - ERROR) case $force in - 0) exit 1 ;; - esac - ;; - ?*) eval `echo $release | sed -e 's,\(.*\)-\(.*\)-\(.*\),yy=\1 mm=\2 dd=\3,'` - # slide back 4 months - case $mm in - 01) mm=09 dd=1 ;; - 02) mm=10 dd=1 ;; - 03) mm=11 dd=1 ;; - 04) mm=12 dd=1 ;; - 05) mm=01 dd=0 ;; - 06) mm=02 dd=0 ;; - 07) mm=03 dd=0 ;; - 08) mm=04 dd=0 ;; - 09) mm=05 dd=0 ;; - 10) mm=06 dd=0 ;; - 11) mm=07 dd=0 ;; - 12) mm=08 dd=0 ;; - esac - case $dd in - 1) yy=`expr $yy - 1` ;; - esac - release=$yy-$mm-01 - count=1 - lo=$release - release="-f $release -r $count" - ;; - esac -} - -# write ordered package prerequisite list to the standard output - -order() # [ package ] -{ - _order_t_=lib/package/tgz - case $action in - binary) _order_a_=.$HOSTTYPE ;; - *) _order_a_= ;; - esac - _order_n_=$# - case $_order_n_ in - 0) _order_p_= - for _order_v_ in $VIEW_all - do for _order_f_ in $_order_v_/lib/package/*.pkg - do if test -f $_order_f_ - then _order_p_="$_order_p_ $_order_f_" - fi - done - done - set '' $_order_p_ - shift - esac - { - if test ratz != "$*" - then for _order_f_ in ratz INIT - do if view -s - src $_order_t_/$_order_f_$_order_a_.tim - then echo $_order_f_ $_order_f_ - fi - done - fi - for _order_f_ - do while : - do view - src $_order_f_ && break - case $_order_f_ in - *.pkg) ;; - *) _order_f_=$_order_f_.pkg; view - src $_order_f_ && break ;; - esac - case $_order_f_ in - */*) ;; - *) _order_f_=lib/package/$_order_f_; view - src $_order_f_ && break ;; - esac - echo "$command: $_order_f_: not a package" >&2 - continue 2 - done - _order_f_=$_view_ - _order_p_=`echo $_order_f_ | sed -e 's,.*/,,' -e 's,\.pkg$,,'` - case $_order_n_ in - 0) view -s - src $_order_t_/$_order_p_$_order_a_.tim || continue ;; - esac - echo $_order_p_ $_order_p_ - case $_order_p_ in - INIT|ratz) - ;; - *) echo INIT $_order_p_ - ;; - esac - { - req= req_sep= - op=:: - while read line - do IFS=' \\' - set '' $line - IFS=$ifs - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - :*:) op=$1 - ;; - INIT|'$('*|*')') - ;; - *) case $op in - :REQUIRES:) - req="$req$req_sep$1" - req_sep=" " - ;; - esac - ;; - esac - done - done - for _order_i_ in $req - do if view - src lib/package/$_order_i_.pkg - then case $_order_u_ in - 0) view -s - src $_order_t_/$_order_i_$_order_a_.tim || continue ;; - esac - echo $_order_i_ $_order_i_; echo INIT $_order_i_; echo $_order_i_ $_order_p_ - fi - done - } < $_order_f_ - done - } | tsort -} - -# generate the package component list in _components_ - -components() # [ package ] -{ - _components_= - for p - do case $p in - '') ;; - INIT) case " $_components_ " in - *" $p "*) ;; - *) _components_="$_components_ $p" ;; - esac - ;; - *) if view - src lib/package/$p.pkg - then p=$_view_ - op=:: - exec < $p - while read line - do IFS=' \\' - set '' $line - IFS=$ifs - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - :*:) op=$1 - ;; - INIT|'$('*|*')') - ;; - *) case $op in - :PACKAGE:) - case " $_components_ " in - *" $1 "*) ;; - *) _components_="$_components_ $1" ;; - esac - ;; - esac - ;; - esac - done - done - exec < /dev/null - elif test -d $PACKAGEROOT/src/cmd/$p -o -d $PACKAGEROOT/src/lib/$p - then _components_="$_components_ $p" - else echo "$command: $p: package or component not found" >&2 - exit 1 - fi - ;; - esac - done -} - # list main environment values showenv() @@ -3929,6 +2634,7 @@ showenv() capture() # file command ... { + tee_pid= case $make:$noexec in :) case $action in install|make|view) @@ -3943,10 +2649,7 @@ capture() # file command ... esac ;; esac - case $action in - write) d=$PACKAGESRC/gen ;; - *) d=$PACKAGEBIN/gen ;; - esac + d=$PACKAGEBIN/gen test -d $d || $exec mkdir $d o=$d/$o case $o in @@ -3960,7 +2663,7 @@ capture() # file command ... then mv $o.out $o.out.2 fi elif test -f $o.out - then for i in `ls -t $o.out.? 2>/dev/null` + then for i in $(ls -t $o.out.? 2>/dev/null) do break done case $i in @@ -3978,20 +2681,25 @@ capture() # file command ... fi o=$o.out : > $o - note $action output captured in $o - s="$command: $action start at `date` in $INSTALLROOT" + note "$action output captured in $o" + s="$command: $action start at $(date) in $INSTALLROOT" + cmd='case $error_status in 0) r=done;; *) r=failed;; esac;' + cmd=$cmd' echo "$command: $action $r at $(date) in $INSTALLROOT"' case $quiet in - 0) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT 2>&1 | \$TEE -a $o" 0 1 2 ;; - *) trap "echo \"$command: $action done at \`date\`\" in $INSTALLROOT >> $o" 0 1 2 ;; + 0) cmd="$cmd 2>&1 | \$TEE -a $o" ;; + *) cmd="$cmd >> $o" ;; esac + trap "$cmd" 0 + trap "error_status=1; $cmd; trap 1 0; kill -1 $$" 1 + trap "error_status=1; $cmd; trap 2 0; kill -2 $$" 2 ;; esac case $quiet in 0) if executable ! $TEE then TEE=tee fi - # Connect 'tee' to a FIFO instead of a pipe, so that the build is invoked from - # the main shell environment and its exit status can be used for $error_status + # Connect 'tee' to a FIFO instead of a pipe, so that we can obtain + # the build's exit status and use it for $error_status rm -f $o.fifo mkfifo -m 600 $o.fifo || exit ( @@ -4000,23 +2708,17 @@ capture() # file command ... exec rm $o.fifo ) & $TEE -a $o < $o.fifo & - { - case $s in - ?*) echo "$s" ;; - esac - showenv $action - "$@" - } < /dev/null > $o.fifo 2>&1 - ;; - *) { - case $s in - ?*) echo "$s" ;; - esac - showenv $action - "$@" - } < /dev/null > $o 2>&1 + tee_pid=$! + o=$o.fifo ;; esac + { + case $s in + ?*) echo "$s" ;; + esac + showenv $action + "$@" + } < /dev/null > $o 2>&1 ;; *) $make "$@" ;; @@ -4025,49 +2727,11 @@ capture() # file command ... if test "$exit_status" -gt "$error_status" then error_status=$exit_status fi -} - -package_install() # dest sum -{ - dest=$1 sum=$2 - ot= - code=0 - sed -e '/ /!d' -e 's,[^ ]* ,,' -e 's, \(arch/[^/]*\)/, \1 ,' -e '/ arch\//!s,^[^ ]* [^ ]* [^ ]*,& .,' -e 's,/\([^ /]*\)$, \1,' $sum | - while read mode user group arch dir file - do case $flat:$arch in - 1:*|?:.)t=$dest/$dir ;; - *) t=$dest/$arch/$dir ;; - esac - case $t in - $ot) ;; - *) if test ! -d "$t" - then $exec mkdir -p "$t" || exit - fi - ot=$t - ;; - esac - case $file in - ?*) case $arch in - .) f=$dir/$file ;; - *) f=$arch/$dir/$file ;; - esac - if test -f "$f" - then t=$t/$file - case $quiet in - 0) echo "$t" ;; - esac - $exec cp -f "$f" "$t" || code=1 - $exec chmod $mode "$t" || code=1 - fi - ;; - esac - done - return $code -} - -package_verify() # sum -{ - $exec $SUM -cp $1 + case $tee_pid in + ?*) # allow 'tee' to catch up before returning to prompt + wait "$tee_pid" + ;; + esac } make_recurse() # dir @@ -4079,310 +2743,14 @@ make_recurse() # dir done } -get() # host path [ file size ] -{ - case $HURL in - '') HURL=. - for i in wget lynx curl - do if onpath $i - then HURL=$i - break; - fi - done - AUTHORIZE="User-Agent: package AT&T Research\\r\\n" - case $HURL:$authorize in - .:?*) AUTHORIZE="${AUTHORIZE}Authorization: Basic `print -n -r -- $authorize:$password | uuencode -h -x base64`\\r\\n" ;; - esac - ;; - esac - getfd=8 - case $3 in - '') case $HURL in - .) host=$1 - path=$2 - while : - do eval "exec $getfd<> /dev/tcp/$host/80" || exit - case $path in - /*) ;; - *) path=/$path ;; - esac - print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd - cat <&8 > get.tmp - got=`sed -e 1q get.tmp` - case $got in - *" "200" "*) - got=`sed -e '1,/^.$/d' -e '/^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]/!d' get.tmp` - : > get.err - code=0 - break - ;; - *" "30[123]" "*) - got=`sed -e '/^Location: /!d' -e 's,^Location: \(.*\)://\([^/]*\)\(/.*\),prot='\''\1'\'' host='\''\2'\'' path='\''\3'\'',' get.tmp` - case $got in - '') rm get.tmp - echo "$command: $action: $url: redirect error" >&2 - exit 1 - ;; - esac - eval $got - ;; - *) rm get.tmp - echo "$command: $action: $url: $got" >&2 - echo '' "$got" > get.err - code=1 - break - ;; - esac - done - ;; - curl) case $authorize in - '') curl -s -L -o get.tmp http://$1/$2 2> get.err; code=$? ;; - *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2 2> get.err; code=$? ;; - esac - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` - case $code in - 0) if grep '^

    Authorization Required

    ' get.tmp > get.err - then code=1 - fi - ;; - esac - ;; - hurl) case $authorize in - '') hurl http://$1/$2 > get.tmp 2> get.err; code=$? ;; - *) hurl -a "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; - esac - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` - ;; - lynx) case $authorize in - '') lynx -source http://$1/$2 > get.tmp 2> get.err; code=$? ;; - *) lynx -source -auth "$authorize":"$password" http://$1/$2 > get.tmp 2> get.err; code=$? ;; - esac - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp` - ;; - wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2 2> get.err - code=$? - got=`grep '^[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ]' get.tmp 2>/dev/null` - ;; - *) echo $command: $action: $HURL: url get command not found >&2 - exit 1 - ;; - esac - if test 0 != "$code" - then case `cat get.err get.tmp 2>/dev/null` in - *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) - echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 - ;; - *) cat get.err - ;; - esac - rm -f get.tmp get.err - echo $command: $action: $2: download failed >&2 - exit 1 - fi - rm -f get.tmp get.err - ;; - *) case $exec in - '') echo "$3 ($4 bytes):" >&2 - case $HURL in - .) eval "exec $getfd<> /dev/tcp/$1/80" || exit - path=$2/$3 - case $path in - /*) ;; - *) path=/$path ;; - esac - print "GET $path HTTP/1.0\\r\\nHost: $host\\r\\n$AUTHORIZE\\r" >&$getfd - read got <&$getfd - case $got in - *" 200 "*) - code=0 - : > get.err - ;; - *) echo '' "$got" > get.err - code=1 - ;; - esac - while read got <&$getfd - do case $got in - ''|?) break ;; - esac - done - cat <&$getfd > get.tmp - ;; - curl) case $authorize in - '') curl -s -L -o get.tmp http://$1/$2/$3 2> get.err; code=$? ;; - *) curl -s -L -o get.tmp -u "$authorize":"$password" http://$1/$2/$3 2> get.err; code=$? - esac - case $code in - 0) if grep '^

    Authorization Required

    ' get.tmp > get.err - then code=1 - fi - ;; - esac - ;; - hurl) case $authorize in - '') ksh -x hurl http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - *) ksh -x hurl -a "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - esac - ;; - lynx) case $authorize in - '') lynx -source http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - *) lynx -source -auth "$authorize":"$password" http://$1/$2/$3 > get.tmp 2> get.err; code=$? ;; - esac - ;; - wget) wget -nv -O get.tmp ${authorize:+--http-user="$authorize"} ${password:+--http-passwd="$password"} http://$1/$2/$3 2> get.err - code=$? - ;; - *) echo $command: $action: $HURL: url get command not found >&2 - exit 1 - ;; - esac - if test 0 != "$code" - then case `cat get.err get.tmp` in - *[Aa][Uu][Tt][Hh][Oo][Rr][Ii][SsZz]*|*[Dd][Ee][Nn][Ii][Ee][Dd]*) - echo $command: $action: authorization required -- see $url for license acceptance authorization name and password >&2 - ;; - *) cat get.err - ;; - esac - rm get.tmp get.err - echo $command: $action: $3: download failed >&2 - exit 1 - fi - rm get.err - case $checksum:$5 in - :*|*:-) z=`wc -c < get.tmp` - case " $z " in - *" $4 "*) - ;; - *) rm -f get.tmp - echo $command: $3: download error: expected $4 bytes, got $z >&2 - exit 1 - ;; - esac - ;; - *) z=`$checksum < get.tmp | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` - case " $z " in - *" $5 "*) - ;; - *) rm -f get.tmp - echo $command: $3: download $checksum error: expected $5, got $z >&2 - exit 1 - ;; - esac - ;; - esac - mv get.tmp $3 || exit - ;; - *) echo "$3 ($4 bytes)" >&2 - ;; - esac - esac -} - -# generate copyright notice - -copyright() -{ - if test -f $1.lic - then echo $1 package general copyright notice - echo - proto -c'#' -p -s -l $1.lic -o type=verbose,author='*' /dev/null - return 0 - fi - case $1 in - *-*) eval `echo '' $1 | sed 's/\([^-]*\)-\(.*\)/__j__="\1" __i__="\2"/'` - if copyright $__i__ || copyright $__j__ - then return 0 - fi - ;; - esac - return 1 -} - -# run remote make on host - -remote() # host no-exec-background -{ - host=$1 - background=$2 - eval name=\$${host}_name user=\$${host}_user snarf=\$${host}_snarf type=\$${host}_type rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep log=\$${host}_log - case $keep in - 1*) ;; - *) return ;; - esac - case $host in - $main) ;; - *) case $exec in - '') exec > $admin_log/$log 2>&1 ;; - *) echo "exec > $admin_log/$log 2>&1" ;; - esac - ;; - esac - if $admin_ping $name >/dev/null 2>&1 || $admin_ping $name >/dev/null 2>&1 - then cmd=". ./.profile" - case $root in - .) root= - ;; - *) cmd="$cmd && cd $root" - root=$root/ - ;; - esac - cmd="$cmd && { test -f lib/package/admin/$admin_env && . ./lib/package/admin/$admin_env || true ;} && PATH=\${PWD:-\`pwd\`}/bin:\$PATH \${SHELL:-/bin/sh} -c 'package $admin_args PACKAGEROOT=\${PWD:-\`pwd\`} HOSTTYPE=$type VPATH='" - case $admin_binary in - '') snarf= ;; - esac - case $snarf in - '') $exec $rsh $user$name "$cmd" $background - ;; - *?) rcp=`echo $rsh | sed 's/\(.\).*/\1/'`cp - case $background in - ?*) $exec "{" ;; - esac - $exec $rsh $user$name "$cmd" - eval lst=$admin_list - case $admin_pkgs in - '') filter=cat ;; - *) filter="egrep lib/package/tgz/($admin_pkgs)\\." ;; - esac - if $exec $rcp $user$name:${root}lib/package/tgz/$lst $PACKAGESRC/tgz - then $exec $rcp `$filter $PACKAGESRC/tgz/$lst | sed "s,^,$user$name:,"` $PACKAGESRC/tgz - else echo "$command: $user$name:${root}lib/package/tgz/$lst: not found" >&2 - fi - case $background in - ?*) $exec "} $background" ;; - esac - ;; - esac - else echo "$command: $name: down" >&2 - fi -} - -# update package_src - -checksrc() -{ - case $package_src in - '') package_src=$src - for _i_ in `cd $PACKAGESRC; ls *.def *.lic *.pkg 2>/dev/null | sed 's/[-.].*//'` - do case " $package_src " in - *" $_i_ "*) - ;; - *) package_src="$package_src $_i_" - ;; - esac - done - ;; - esac -} - -# check for native ascii 0:yes 1:no +# check for native ASCII 0:yes 1:no __isascii__= isascii() { case $__isascii__ in - '') case `echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//'` in + '') case $(echo A | od -o | sed -e 's/[ ]*$//' -e '/[ ]/!d' -e 's/.*[ ]//') in 005101|040412) __isascii__=0 ;; *) __isascii__=1 ;; esac @@ -4394,866 +2762,31 @@ error_status=0 case $action in -admin) while test ! -f $admin_db - do case $admin_db in - /*) echo $command: $action: $admin_db: data file not found >&2 - exit 1 - ;; - esac - view file src lib/package/admin/$admin_db || exit 1 - admin_db=$_view_ - done - admin_components= - case $admin_action in - list) cat $admin_db - exit - ;; - test) set $admin_args - while : - do case $# in - 1) break ;; - esac - shift - case $1 in - *=*) ;; - *) admin_components=-$1 - break - ;; - esac - done - ;; - esac - : all work done in $PACKAGESRC/admin - cd $PACKAGESRC/admin || exit - checksrc - packages= - admin_log=${admin_action}${admin_components}.log - exec < $admin_db || exit - test -d $admin_log || $exec mkdir $admin_log || exit - case $admin_on in - '') admin_on="*" ;; - esac - hostname= - hosts= - logs= - local_hosts= - local_types= - pids= - remote_hosts= - sync_hosts= - admin_host=_admin_host_ - admin_out= - case " $admin_args " in - *" write binary "*|*" write "*" binary "*) - admin_binary=1 - ;; - *) admin_binary= - ;; - esac - case $only in - 1) admin_args="only $admin_args" ;; - esac - trap 'kill $pids >/dev/null 2>&1' 1 2 3 15 - index=0 - while read type host root date time make test write owner attributes - do case $type in - ''|'#'*);; - *=*) eval "$type $host $root $date $time $make $test $write $owner $attributes" - ;; - *) case $admin_action in - make|test|write) - eval f='$'$admin_action - case $f in - *[!0123456789]*) continue ;; - esac - ;; - esac - rsh=rsh - case $host in - *@*) IFS=@ - set '' $host - IFS=$ifs - user=${2}@ - host=$3 - ;; - *) user= - ;; - esac - : type=$type host=$host root=$root date=$date time=$time make=$make test=$test write=$write : - name=$host - host=`echo $name | sed 's,[^abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789],__,g'` - eval x='$'${host}_index - eval ${host}_index=1 - case $x in - 1) i=0 - while : - do case $i in - $index) h='' - break - ;; - esac - i=`expr $i + 1` - eval h='$'${admin_host}${i}_name - case $h in - $host) host=${admin_host}${i} - eval user='$'${host}_user root='$'${host}_rsh:$host:'$'${host}_root - break - ;; - esac - done - ;; - esac - case $root in - *:$name:*)root=`echo '' $root | sed 's,:.*,:,'` ;; - esac - case $root in - *:*:*) index=`expr $index + 1` - host=${admin_host}$index - ;; - *:*) case " $sync_hosts " in - *" $name ${admin_host}"*) - set '' '' $sync_hosts - while : - do shift - shift - case $1 in - $name) host=$2 - break - ;; - esac - done - ;; - *) index=`expr $index + 1` - host=${admin_host}$index - sync_hosts="$sync_hosts $name $host" - ;; - esac - ;; - *) index=`expr $index + 1` - host=${admin_host}$index - ;; - esac - case $root in - -*) continue - ;; - *:*) case $admin_all in - 0) continue ;; - esac - case $root in - *:) root=${root}. ;; - esac - IFS=: - set '' $root - IFS=$ifs - sync=$host - case $hostname in - '') hostinfo name - hostname=$_hostinfo_ - ;; - esac - shift - case $# in - 0) ;; - 1) root=$1 - ;; - 2) rsh=$1 root=$2 - ;; - *) rsh=$1 sync=$2 root=$3 - case $sync in - ${admin_host}*) - ;; - ?*) case " $sync_hosts " in - *" $sync ${admin_host}"*) - set '' '' $sync_hosts - while : - do shift - shift - case $1 in - $sync) sync=$2 - break - ;; - esac - done - ;; - *) index=`expr $index + 1` - x=${admin_host}$index - sync_hosts="$sync_hosts $sync $x" - sync=$x - ;; - esac - ;; - esac - ;; - esac - ;; - *) sync= - ;; - esac - case $name in - $admin_on) - keep=1 - ;; - *) case " $admin_on " in - *" $name "*) keep=1 ;; - *) keep=0 ;; - esac - ;; - esac - case " $admin_out " in - *" $name "*) - log=$name.$type - ;; - *) admin_out="$admin_out $name" - log=$name - ;; - esac - case $sync in - '') local_types="$local_types $type" ;; - esac - case $sync in - $host) remote_hosts="$remote_hosts $host" - ;; - ?*) eval ${sync}_share=\"\$${sync}_share $host\" - ;; - '') local_hosts="$local_hosts $host" - ;; - esac - eval ${host}_name='$'name ${host}_type='$'type ${host}_user='$'user ${host}_sync='$'sync ${host}_snarf='$'sync ${host}_rsh='$'rsh ${host}_root='$'root ${host}_keep='$'keep ${host}_log='$'log - ;; - esac - done - p= - for i in $admin_args - do p="$i $p" - done - admin_pkgs= - for i in $p - do if view - src "lib/package/$i.pkg" - then case $admin_pkgs in - '') admin_pkgs="$i" ;; - *) admin_pkgs="$admin_pkgs|$i" ;; - esac - fi - done - : "admin_binary :" $admin_binary - : "admin_args :" $admin_args - : "admin_pkgs :" $admin_pkgs - : "admin_on :" "$admin_on" - : "local_hosts :" $local_hosts - : "local_types :" $local_types - : "remote_hosts :" $remote_hosts - : "sync_hosts :" $sync_hosts - : "sync_share :" $sync_share - case $admin_binary in - 1) admin_bin_types= - admin_bin_main= - for main in $local_hosts $remote_hosts - do eval share=\$${main}_share keep=\$${main}_keep - case $keep in - 0*) continue ;; - esac - for host in $main $share - do case " $admin_bin_hosts " in - *" $host "*) - continue - ;; - esac - eval type=\$${host}_type - case " $admin_bin_types " in - *" $type "*) - continue - ;; - esac - case " $types " in - " ") ;; - *" $type "*) - ;; - *) continue - ;; - esac - admin_bin_hosts="$admin_bin_hosts $host" - admin_bin_types="$admin_bin_types $type" - case " $admin_bin_hosts " in - *" $main "*) - ;; - *) case " $admin_bin_main " in - *" $main "*) - ;; - *) admin_bin_main="$admin_bin_main $main" - ;; - esac - ;; - esac - done - done - local= - remote= - for host in $admin_bin_main $admin_bin_hosts - do case " $local_hosts " in - *" $host "*) - local="$local $host" - ;; - *) case " $remote_hosts " in - *" $host "*) - remote="$remote $host" - ;; - esac - ;; - esac - done - local_hosts=$local - remote_hosts=$remote - ;; - esac - for host in $remote_hosts $local_hosts - do eval share=\$${host}_share - case $share in - ?*) while : - do oshare=$share - for s in $share - do eval r='$'${s}_share - case $r in - ?*) case " $share " in - *" $r "*) ;; - *) share="$share $r" ;; - esac - ;; - esac - done - case $share in - $oshare) eval ${host}_share="'$share'" - break - ;; - esac - done - ;; - esac - done - for host in $remote_hosts - do eval type=\$${host}_type - case " $local_types " in - *" $type "*) - eval ${host}_snarf= - ;; - esac - eval name=\$${host}_name keep=\$${host}_keep share=\$${host}_share - for share in $share - do eval type=\$${share}_type keep=\$keep\$${share}_keep - case " $local_types " in - *" $type "*) - eval ${share}_snarf= - ;; - esac - done - case $keep in - 0*1*) keep=2$keep ;; - *1*) ;; - *) keep=0 ;; - esac - eval ${host}_keep=$keep - done - for host in $remote_hosts $local_hosts - do eval name=\$${host}_name user=\$${host}_user type=\$${host}_type sync=\$${host}_sync snarf=\$${host}_snarf share=\$${host}_share rsh=\$${host}_rsh root=\$${host}_root keep=\$${host}_keep - case $keep in - 0*) continue ;; - esac - case $sync in - '') case $admin_action in - ditto) continue ;; - esac - case $admin_binary in - 1) case $keep in - 1*|?*1*);; - *) continue ;; - esac - ;; - esac - ;; - esac - eval main_log='$'${host}_log - main= - share_keep= - for i in $host $share - do eval n='$'${i}_name t='$'${i}_type q='$'${i}_sync s='$'${i}_snarf l='$'${i}_log k='$'${i}_keep - case $main:$k in - :*) ;; - *:0) continue ;; - esac - case $admin_binary in - 1) case $s:$q in - :?*) continue ;; - esac - case " $admin_bin_hosts " in - *" $i "*) - ;; - *) continue - ;; - esac - ;; - esac - case $main in - '') main=$i ;; - *) share_keep="$share_keep $i" ;; - esac - echo package "$admin_args" "[ $n $t ]" - case $exec in - '') : > $admin_log/$l ;; - *) $exec ": > $admin_log/$l" ;; - esac - done - host=$main - share=$share_keep - case $force in - 0) admin_ditto_update=--update ;; - *) admin_ditto_update= ;; - esac - case $exec in - '') { - case $admin_binary:$sync in - :?*) eval syncname='$'${sync}_name - test -x $PACKAGEROOT/bin/package && $admin_ditto $admin_ditto_update --remote=$rsh --expr="name=='package'" $PACKAGEROOT/bin $user$syncname:$root/bin - test -d $PACKAGESRC && $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1&&path!='LICENSES/*')status=SKIP;path=='LICENSES*|*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package - for dir in $package_src - do case $MAKESKIP in - '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; - *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; - esac - test -d $PACKAGEROOT/src/$dir && $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir - done - ;; - esac - case $admin_action in - ditto) ;; - ?*) pids= - set '' $host $share - while : - do shift - case $# in - 0) break - ;; - 1) remote $1 - ;; - *) remote $1 & - pids="$pids $!" - ;; - esac - done - case $pids in - ?*) wait $pids ;; - esac - ;; - esac - } < /dev/null > $admin_log/$main_log 2>&1 & - pids="$pids $!" - ;; - *) echo "{" - case $admin_binary:$sync in - :?*) eval syncname='$'${sync}_name - test -d $PACKAGESRC && echo $admin_ditto $admin_ditto_update --remote=$rsh --expr="if(level>1)status=SKIP;name=='*.(pkg|lic|def)'" $PACKAGESRC $user$syncname:$root/lib/package - for dir in $package_src - do case $MAKESKIP in - '') expr="--expr=if(name=='$admin_ditto_skip')status=SKIP" ;; - *) expr="--expr=if(name=='$admin_ditto_skip'||level==1&&name=='$MAKESKIP')status=SKIP" ;; - esac - test -d $PACKAGEROOT/src/$dir && echo $admin_ditto $admin_ditto_update --remote=$rsh "$expr" $PACKAGEROOT/src/$dir $user$syncname:$root/src/$dir - done - ;; - esac - case $admin_action in - ditto) ;; - ?*) pids= - set '' $host $share - while : - do shift - case $# in - 0) break - ;; - 1) remote $1 - ;; - *) remote $1 "&" - pids=1 - ;; - esac - done - case $pids in - 1) echo wait ;; - esac - ;; - esac - echo "} < /dev/null > $admin_log/$main_log 2>&1 &" - ;; - esac - eval name='$'${main}_name - hosts="$hosts $name" - logs="$logs $main_log" - for share in $share - do eval keep=\$${share}_keep - case $keep in - 1) eval name='$'${share}_name log='$'${share}_log - hosts="$hosts $name" - logs="$logs $log" - ;; - esac - done - done - case $exec in - '') # track the progress - case $quiet in - 0) cd $admin_log - tail -t $PACKAGE_admin_tail_timeout -f $logs - cd .. - ;; - esac - # wait for the remote actions to complete - wait - trap - 1 2 3 15 - # update the db - exec < $admin_db || exit - exec 9>&1 - D=`date +%y%m%d` - while read line - do set -- $line - case $1 in - ''|'#'*|*=*) - ;; - *) case " $hosts " in - *" $2 "*) - : ast date command assumed : - E=`eval date -E \`egrep '[ ](start|done)[ ][ ]*at[ ]' $admin_log/$2 | sed -e 's/.*[ ][ ]*at[ ][ ]*//' -e 's/[ ][ ]*in[ ].*$//' -e 's/.*/"&"/'\`` - M=$6 T=$7 W=$8 - case $admin_action in - make|view) - M=`egrep -c ']:.* (\*\*\*.* code|don'\''t know) | \*\*\* termination code ' $admin_log/$2` ;; - test) T=`grep -ci 'fail[es]' $admin_log/$2` ;; - *) W=`grep '^[abcdefghijklmnopqrstuvwxyz][abcdefghijklmnopqrstuvwxyz]*:.' $admin_log/$2 | egrep -cv 'start at|done at|output captured|warning:|: package not found|whence: command not found'` ;; - esac - case $1 in - ?|??|???|????|?????|??????|???????) - t1=' ' - ;; - ????????|?????????|??????????|???????????|????????????|?????????????|??????????????|???????????????) - t1=' ' - ;; - *) t1='' - ;; - esac - case $2 in - ?|??|???|????|?????|??????|???????) - t2=' ' - ;; - *) t2='' - ;; - esac - case $3 in - ?|??|???|????|?????|??????|???????) - t3=' ' - ;; - *) t3='' - ;; - esac - case $E in - ?????) E=" $E" ;; - ????) E=" $E" ;; - ???) E=" $E" ;; - ??) E=" $E" ;; - ?) E=" $E" ;; - esac - case $M in - ???) M="$M" ;; - ??) M=" $M" ;; - ?) M=" $M" ;; - '') M=" 0" ;; - esac - case $T in - ???) T="$T" ;; - ??) T=" $T" ;; - ?) T=" $T" ;; - '') T=" 0" ;; - esac - case $W in - ???) W="$W" ;; - ??) W=" $W" ;; - ?) W=" $W" ;; - '') W=" 0" ;; - esac - A=$1$t1 - H=$2$t2 - R=$3$t3 - case $# in - [0-8]) O= - K= - ;; - *) shift 8 - O=$1 - K=$2 - case $O in - ''|?|??|???) K=" $K" ;; - esac - case $# in - [0-2]) ;; - *) K="$K $*" ;; - esac - ;; - esac - echo "$A $H $R $D $E $M $T $W $O $K" - echo "$A $H $R $D $E $M $T $W $O $K" >&9 - continue - ;; - esac - ;; - esac - echo "$line" - done > $admin_db.new - mv $admin_db $admin_db.old - mv $admin_db.new $admin_db - ;; - esac - ;; - clean|clobber) - cd $PACKAGEROOT - $exec rm -rf arch/$HOSTTYPE - if test "$flat" = 1 - then $exec rm -rf \ - bin/.paths \ - bin/ar \ - bin/cc \ - bin/crossexec \ - bin/ditto \ - bin/filter \ - bin/hurl \ - bin/iffe \ - bin/ksh \ - bin/mamake \ - bin/mktest \ - bin/ok/ \ - bin/proto \ - bin/pty \ - bin/ratz \ - bin/regress \ - bin/release \ - bin/rt \ - bin/shcomp \ - bin/suid_exec \ - bin/*.old \ - fun/ \ - include/ \ - lib/file/ \ - lib/lib/ \ - lib/libast.a \ - lib/libcmd.a \ - lib/libdll.a \ - lib/libshell.a \ - lib/libsum.a \ - lib/*.old \ - lib/make/ \ - lib/package/gen/ \ - lib/probe/ \ - man/ - fi - exit - ;; - -contents|list) - # all work in $PACKAGESRC - - cd $PACKAGESRC - - # generate the package list - - set '' $target $package - shift - argc=$# - case $# in - 0) set '' *.pkg - case $2 in - '*.pkg') - echo $command: $action: no packages >&2 - exit 1 - ;; - esac - set '' `echo $* | sed 's,\.pkg,,g'` - shift - ;; - esac - sep="$nl " - echo packages in $PACKAGEROOT - case $action in - list) echo - echo "NAME${nl}VERSION${nl}RELEASE${nl}TYPE${nl}STATUS${nl}REQUIRES${nl}----${nl}-------${nl}-------${nl}----${nl}------${nl}--------" | pr -6 -a -o4 -t - ;; - esac - { - omit=: - for pkg - do if test ! -f $pkg.pkg - then echo $command: $action: $pkg: not a package >&2 - else if test -f gen/$pkg.ver - then set '' `cat gen/$pkg.ver` - case $3 in - $2) ver=base ;; - *) ver=$3 ;; - esac - if test -s tgz/$pkg.tim - then sts=local - else sts= - fi - else ver= - sts=unwritten + cd "$PACKAGEROOT" || exit + note "cleaning up flat view" + # clean up all links with arch dir except bin/package + $exec find "arch/$HOSTTYPE" -path "arch/$HOSTTYPE/bin/package" -o -type f -exec "$SHELL" -c ' + first=y + for h # loop through the PPs + do case $first in + y) set -- # clear PPs ("for" uses a copy) + first=n ;; + esac + p=${h#"arch/$HOSTTYPE/"} # get flat view path + if test "$p" -ef "$h" # is it part of the flat view? + then set -- "$@" "$p" # add to new PPs fi - typ= - txt= - cmp= cmp_sep= - req= req_sep= - op=:: - exec < $pkg.pkg - while read line - do IFS=' \\' - set '' $line - IFS=$ifs - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - :*:) op=$1 - ;; - INIT|'$('*|*')') - ;; - *) case $op in - :DESCRIPTION:) - txt="$txt$sep$line" - break - ;; - :PACKAGE:) - cmp="$cmp$cmp_sep$1" - cmp_sep=$nl - ;; - :REQUIRES:) - req="$req$req_sep$1" - req_sep=" " - ;; - esac - ;; - esac - done - done - exec < /dev/null - case $txt in - ?*) txt="$nl$txt" ;; - esac - case :$ver: in - *::*) ;; - *) case $action in - list) case $sts in - '') case `ls -t "tgz/$pkg.$ver.base" "tgz/$pkg.tim" 2>/dev/null` in - "tgz/$pkg.tim"*) - sts=read - ;; - *) sts=unread - ;; - esac - ;; - esac - echo "$pkg${nl}$ver${nl}base${nl}$typ${nl}$sts${nl}$req" - case $typ in - '') omit=$omit$pkg.$ver.base: ;; - esac - ;; - *) case $req in - ?*) req=": $req" ;; - esac - echo - echo $pkg $ver $req "$txt" - case $cmp in - ?*) echo "${sep}Components in this package:$nl" - echo "$cmp" | pr -4 -o4 -t ;; - esac - ;; - esac - ;; - esac - fi - done - case $argc:$action in - 0:list) if test -d tgz - then cd tgz - # f:file p:package v:version r:release t:type u:update - for f in `find . -name '*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*' -print | sed 's,^\./,,' | sort -r` - do eval `echo "$f" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` - case $t in - '') case $omit in - *:$p.$v.$r:*) continue ;; - esac - u=$p.tim - ;; - *) u=$p.$t.tim - ;; - esac - if test -s "$u" - then s=local - elif test -f "$u" - then case `ls -t "$f" "$u" 2>/dev/null` in - "$u"*) s=read ;; - *) s=unread ;; - esac - else s=unread - fi - echo "$p$nl$v$nl$r$nl$t$nl$s$nl" - done - fi + done + exec rm -f "$@" # rm all at once: fast + ' "$0" {} + + case $flat in + 0) note "deleting arch/$HOSTTYPE" + $exec rm -rf arch/$HOSTTYPE ;; esac - } | - case $action in - list) pr -6 -a -o4 -t | sort -u ;; - *) cat ;; - esac - case $argc in - 0) if test -d $PACKAGEROOT/arch - then echo - echo architectures in $PACKAGEROOT - echo - for i in `ls $PACKAGEROOT/arch` - do if test -f $PACKAGEROOT/arch/$i/lib/package/gen/host - then h=`cat $PACKAGEROOT/arch/$i/lib/package/gen/host` - else h= - fi - echo $i - echo $h - echo - echo - done | pr -4 -a -o4 -t - fi - ;; - esac - ;; - -copyright) - # all work in $PACKAGESRC - - cd $PACKAGESRC - - # generate the package list - - set '' $target $package - shift - argc=$# - case $# in - 0) set '' `echo *.lic | sed 's,\.lic,,g'` - shift - case $1 in - '*') echo $command: $action: no packages >&2 - exit 1 - ;; - esac - ;; - esac - checkaout proto || exit - for i - do copyright $i - done + note "removing empty directories" + $exec find . -depth -type d -exec rmdir {} + 2>/dev/null ;; export) case $INSTALLROOT in @@ -5280,199 +2813,13 @@ export) case $INSTALLROOT in ;; install)cd $PACKAGEROOT - set '' $package - shift - case $only in - 0) set '' `order "$@"` - shift - ;; - esac - case $# in - 0) echo "$command: at least one package name expected" >&2 - exit 1 - ;; - esac - package=$* - requirements - $package - set '' $target - shift - case $1 in - flat) flat=1 # backwards compatibility -- documentation dropped - shift - ;; - esac - case $# in - 0) echo "$command: $action: target directory argument expected" >&2 - exit 1 - ;; - esac - target= - while : - do case $# in - 1) directory=$1 - break - ;; - esac - target="$target $1" - shift - done - if test ! -d $directory - then echo "$command: $action: $directory: target directory not found" >&2 - exit 1 - fi - case $target in - '') cd arch - set '' * - shift - target=$* - cd .. - ;; - esac - code=0 - makecheck=1 - for a in $target - do case $a in - -) a=$HOSTTYPE ;; - esac - case $flat:$a in - 1:*|?:.)dest=$directory - ;; - *) dest=$directory/arch/$a - if test "" = "$exec" -a ! -d $dest - then mkdir -p $dest || { - echo "$command: $dest: destination directory must exist" >&2 - exit 1 - } - fi - ;; - esac - for i in $package - do if test "ratz" = "$i" - then : skip - elif test -f arch/$a/lib/package/gen/$i.sum - then package_install $directory arch/$a/lib/package/gen/$i.sum || code=1 - elif test ! -d arch/$a/bin - then echo "$command: $a: invalid architecture" >&2 - elif test ! -d $dest - then echo "$command: $dest: destination directory must exist" >&2 - else if test "" != "$makecheck" - then if onpath $MAKE - then MAKE=$_onpath_ - else echo "$command: $MAKE: not found" >&2 - exit 1 - fi - makecheck= - fi - if test "" != "$exec" - then ( - trap - 0 1 2 15 - echo "=== $i installation manifest ===" - cd arch/$a - ( - cd lib/package - INSTALLROOT=$PACKAGEROOT/arch/$a - VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH - export INSTALLROOT VPATH - $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign - ) | sort -u - ) - else ( - set - - cd arch/$a - ( - cd lib/package - INSTALLROOT=$PACKAGEROOT/arch/$a - VPATH=$INSTALLROOT:$PACKAGEROOT:$VPATH - export INSTALLROOT VPATH - echo lib/$command - $MAKE -s $makeflags -f $i.pkg $qualifier list.installed $assign - ) | sort -u | pax -drw -ps $dest - ) - fi - fi - done - done - exit $code - ;; - -license)# all work in $PACKAGESRC/LICENSES - - cd $PACKAGESRC/LICENSES || exit - - # generate the package list - - set '' $target $package - shift - argc=$# - case $# in - 0) set '' * - shift - case $1 in - '*') echo $command: $action: no licenses >&2 - exit 1 - ;; - esac - ;; - *) checkaout proto || exit - a= - for i - do while : - do if test -f ../$i.lic - then j=`proto -df -l ../$i.lic -o query=type /dev/null 2>/dev/null` - case $j in - ?*) if test -f $j - then case " $a " in - *" $j "*) ;; - *) a="$a $j" ;; - esac - fi - break - ;; - esac - fi - case $i in - *-*) i=`echo $i | sed 's/-[^-]*$//'` - ;; - *) echo "$command: $i: package license not found" >&2 - break - ;; - esac - done - done - set '' $a - shift - ;; - esac - for i - do case $exec in - '') echo - echo " --- $i source license ---" - echo - cat $i - ;; - *) echo $PACKAGESRC/LICENSES/$i - ;; - esac - done + echo "A proper installation command is coming back soon, sorry." >&2 + echo "Meanwhile, copy ksh and shcomp from: $INSTALLROOT/arch/$HOSTTYPE/bin" >&2 + exit 1 ;; make|view) cd $PACKAGEROOT - case $package in - '') lic="lib/package/*.lic" - ;; - *) for i in $package - do lic="$lic lib/package/$i.lic" - case $i in - *-*) lic="$lic lib/package/"`echo $i | sed 's,-.*,,'`".lic" ;; - esac - done - ;; - esac - checksrc - requirements source $package - components $package - package=$_components_ # check for some required commands @@ -5515,10 +2862,9 @@ make|view) ;; *) case " $must " in *" $t "*) - echo "$command: $t: not found -- must be on PATH to $action" >&2 - exit 1 + err_out "$t: not found -- must be on PATH to $action" ;; - *) echo "$command: warning: $t: not found -- some $action actions may fail" >&2 + *) note "warning: $t: not found -- some $action actions may fail" ;; esac ;; @@ -5528,10 +2874,10 @@ make|view) # verify the top view if test ! -d $PACKAGEROOT/src - then note no source packages to make + then note "no source packages to make" exit 0 elif test ! -d $INSTALLROOT/src - then note initialize the $INSTALLROOT view + then note "initialize the $INSTALLROOT view" fi for i in arch arch/$HOSTTYPE do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit @@ -5549,12 +2895,12 @@ make|view) k="$k$i" done o="( $o ) -print" - for d in $package_src + for d in $src do i=src/$d if test -d $i then test -d $INSTALLROOT/$i || $exec mkdir $INSTALLROOT/$i || exit make_recurse $i - for j in `cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u` + for j in $(cd $i; find . $o 2>/dev/null | sed -e 's,^\./,,' -e '/\//!d' -e 's,/[^/]*$,,' | sort -u) do case $j in $k|$MAKESKIP) continue ;; esac @@ -5563,34 +2909,12 @@ make|view) done fi done - def= - for i in $lic - do test -f $i || continue - cmp -s $i $INSTALLROOT/$i 2>/dev/null || - $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i - for j in `grep '^. .*\.def$' $i` - do case $j in - .) ;; - *) case " $def " in - *" $i "*) ;; - *) def="$def $i" ;; - esac - ;; - esac - done - done - for i in $def - do i=lib/package/$i - test -f $i || continue - cmp -s $i $INSTALLROOT/$i 2>/dev/null || - $exec cp $PACKAGEROOT/$i $INSTALLROOT/$i - done # check $CC and { ar cc ld ldd } intercepts h="${HOSTTYPE} ${HOSTTYPE}.*" case $HOSTTYPE in - *.*) t=`echo $HOSTTYPE | sed 's/[.][^.]*//'` + *.*) t=$(echo $HOSTTYPE | sed 's/[.][^.]*//') h="$h $t" ;; *) t=$HOSTTYPE @@ -5598,7 +2922,7 @@ make|view) esac case $t in *[0123456789]) - t=`echo $t | sed 's/[0123456789]*$//'` + t=$(echo $t | sed 's/[0123456789]*$//') h="$h $t" ;; esac @@ -5614,13 +2938,13 @@ make|view) then intercept=1 break 2 fi - case `ls -t "$t" "$b" "$s" 2>/dev/null` in + case $(ls -t "$t" "$b" "$s" 2>/dev/null) in $t*) ;; $b*) cc=$b ;; - $s*) cd $INSTALLROOT/lib/package/gen + $s*) $exec cd $INSTALLROOT/lib/package/gen tmp=pkg$$ - eval '$'exec echo "'int main(){return 0;}' > $tmp.c" + $exec eval "echo 'int main(){return 0;}' > $tmp.c" if $exec $s -o $tmp.exe $tmp.c >/dev/null 2>&1 && test -x $tmp.exe then case $HOSTTYPE in @@ -5631,7 +2955,7 @@ make|view) $exec chmod +x "$b" || exit cc=$b intercept=1 - note update $b + note "update $b" ;; esac fi @@ -5649,10 +2973,10 @@ make|view) for k in $h do for s in $INITROOT/$c.$k do test -x "$s" || continue - case `ls -t "$b" "$s" 2>/dev/null` in + case $(ls -t "$b" "$s" 2>/dev/null) in $b*) ;; $s*) $exec cp "$s" "$b" - note update $b + note "update $b" ;; esac done @@ -5667,10 +2991,10 @@ make|view) do s=$INITROOT/$c.$t test -x "$s" || continue onpath $c || - case `ls -t "$b" "$s" 2>/dev/null` in + case $(ls -t "$b" "$s" 2>/dev/null) in $b*) ;; $s*) $exec cp "$s" "$b" - note update $b + note "update $b" ;; esac done @@ -5679,35 +3003,16 @@ make|view) for t in $h do s=$INITROOT/$c.$t test -x "$s" || continue - case `ls -t "$b" "$s" 2>/dev/null` in + case $(ls -t "$b" "$s" 2>/dev/null) in $b*) ;; $s*) $exec cp "$s" "$b" - note update $b + note "update $b" ;; esac done -# following code stubbed out just in case ar.ibm.risc is needed -# c=ar -# b=$INSTALLROOT/bin/$c -# for t in $h -# do s=$INITROOT/$c.$t -# test -x "$s" || continue -# onpath $c || -# case `ls -t "$b" "$s" 2>/dev/null` in -# $b*) ;; -# $s*) x=`$s -tv /foo/bar.a 2>&1 | egrep -i 'option|usage'` -# case $x in -# '') $exec cp "$s" "$b" -# note update $b -# ;; -# esac -# ;; -# esac -# done case $cc in /*) ;; - *) echo "$command: $CC: not found -- set CC=C-compiler" >&2 - exit 1 + *) err_out "$CC: not found -- set CC=C-compiler" ;; esac case $exec in @@ -5717,11 +3022,11 @@ make|view) if $CC -o $tmp.exe $tmp.c > /dev/null 2> $tmp.err && test -x $tmp.exe then : ok - else echo "$command: $CC: failed to compile this program:" >&2 + else note "$CC: failed to compile this program:" cat $tmp.c >&2 if test -s $tmp.err then cat $tmp.err >&2 - else echo "$command: $CC: not a C compiler" >&2 + else note "$CC: not a C compiler" fi rm -f $tmp.* exit 1 @@ -5736,7 +3041,7 @@ make|view) case $CC in cc) ;; *) if test -x $INSTALLROOT/bin/cc - then case `sed 1q $INSTALLROOT/bin/cc` in + then case $(sed 1q $INSTALLROOT/bin/cc) in ": $CC :") CC=cc export CC @@ -5754,7 +3059,7 @@ make|view) } > $INSTALLROOT/bin/cc chmod +x $INSTALLROOT/bin/cc ;; - *) note generate a $INSTALLROOT/bin/cc wrapper for $CC + *) note "generate a $INSTALLROOT/bin/cc wrapper for $CC" ;; esac CC=cc @@ -5777,10 +3082,10 @@ make|view) i=$INSTALLROOT/lib/probe/C/make/probe j=$INITROOT/C+probe k=$INITROOT/make.probe - case `ls -t $i $j $k 2>/dev/null` in + case $(ls -t $i $j $k 2>/dev/null) in $i*) ;; *) if test -f $j -a -f $k - then note update $i + then note "update $i" shellmagic case $exec in '') { @@ -5802,9 +3107,9 @@ cat $j $k esac fi - # initialize a few mamake related commands + # initialize mamake - checkaout mamake proto ratz release || exit + checkaout mamake || exit # execrate if necessary @@ -5832,43 +3137,59 @@ cat $j $k view) exit 0 ;; esac + # check against previous compiler and flags + + err= + for var in CC CCFLAGS CCLDFLAGS LDFLAGS KSH_RELFLAGS + do store=$INSTALLROOT/lib/package/gen/$var + eval "new=\$$var" + if test -f $store + then old=$(cat $store) + case $old in + "$new") ;; + *) case $old in + '') old="(none)" ;; + *) old="'$old'" ;; + esac + case $new in + '') new="(none)" ;; + *) new="'$new'" ;; + esac + note "$var changed from $old to $new" + err=y ;; + esac + else test -d $INSTALLROOT/lib/package/gen && case $new in + '') ;; + *) echo "$new" ;; + esac > $store + fi + done + case $err,${FORCE_FLAGS+f} in + y,) err_out "This would likely break the build. Restore the flag(s)," \ + "or delete the build directory and rebuild from scratch." + ;; + esac + unset err var store old new + # all work under $INSTALLROOT/src $make cd $INSTALLROOT/src # record the build host name - case $noexec in + case $exec in '') hostinfo name echo "$_hostinfo_" | sed 's,\..*,,' > $PACKAGEBIN/gen/host ;; esac - # make in parallel if possible - - case $NPROC in - '') hostinfo cpu - case $_hostinfo_ in - 0|1) ;; - *) NPROC=$_hostinfo_ - $show NPROC=$NPROC - $show export NPROC - export NPROC - ;; - esac - ;; - esac - # separate flags from target list case $target in *-*) a= for t in $target do case $t in - -[eiknFKNV]*|--*-symbols) - makeflags="$makeflags $t" - ;; - -*) nmakeflags="$nmakeflags $t" + -*) makeflags="$makeflags $t" ;; *) a="$a $t" ;; @@ -5878,76 +3199,6 @@ cat $j $k ;; esac - # generate nmake first if possible - - if executable ! $NMAKE && test -d $PACKAGEROOT/src/cmd/nmake - then if nonmake $MAKE - then note make $NMAKE with mamake - c=$CC - a=$assign - case $HOSTTYPE in - win32*|cygwin*) - CC="$CC -D_BLD_STATIC" - accept="libast" - case $assign in - *' CC='*) ;; - *) assign="$assign CC=\"\$CC\"" ;; - esac - ;; - *) accept=nmake - ;; - esac - eval capture mamake \$makeflags \$nmakeflags \$noexec install nmake $assign - assign=$a - CC=$c - case $make$noexec in - '') if executable ! $NMAKE - then echo "$command: $action: errors making $NMAKE" >&2 - exit 1 - fi - ;; - *) make=echo - ;; - esac - if test '' != "$PROTOROOT" - then VPATH=$INSTALLROOT:$PACKAGEROOT$USER_VPATH - $show VPATH=$VPATH - export VPATH - fi - note believe generated files for $accept - eval capture \$NMAKE \$makeflags \$nmakeflags \$noexec recurse believe \$nmakesep $accept $assign - $exec touch $INSTALLROOT/bin/.paths - note make the remaining targets with $NMAKE - else eval capture $MAKE \$makeflags \$nmakeflags \$noexec install nmake $assign - case $make$noexec in - '') if executable ! $NMAKE - then echo "$command: $action: errors making $NMAKE" >&2 - exit 1 - fi - ;; - *) make=echo - ;; - esac - fi - fi - - # generate ksh next if possible - - if nonmake $MAKE - then : no need to generate ksh next -- it could be the only package - elif test "$KEEP_SHELL" != 1 -a -d $PACKAGEROOT/src/cmd/ksh93 && executable ! $KSH - then eval capture nmake $nmakeflags \$makeflags \$noexec install ksh93 $assign - case $make$noexec in - '') if executable ! $KSH - then echo "$command: $action: errors making $KSH" >&2 - exit 1 - fi - ;; - *) make=echo - ;; - esac - fi - # mamprobe data should have been generated by this point case $exec in @@ -6022,7 +3273,7 @@ cat $j $k ;; esac - # run from separate copies since nmake and ksh may be rebuilt + # run from separate copies since ksh may be rebuilt case $EXECROOT in $INSTALLROOT) @@ -6040,7 +3291,7 @@ cat $j $k else rm=rm fi for i in \ - ksh nmake tee cp ln mv rm \ + ksh tee cp ln mv rm \ *ast*.dll *cmd*.dll *dll*.dll *shell*.dll do executable $i && { cmp -s $i $OK/$i 2>/dev/null || { @@ -6050,23 +3301,14 @@ cat $j $k $exec $execrate $mv $OK/$i $OK/$i.old &2 - exit 1 + :ksh) + err_out "$OK/$i: cannot update [may be in use by a running process] remove manually and try again" ;; esac $exec $execrate $cp $i $OK/$i } } done - if test -f ../lib/make/makerules.mo - then cmp -s ../lib/make/makerules.mo $OK/lib/makerules.mo || - $exec $execrate $cp -p ../lib/make/makerules.mo $OK/lib/makerules.mo || - $exec $execrate $cp ../lib/make/makerules.mo $OK/lib/makerules.mo - fi - if executable $OK/nmake - then MAKE="$INSTALLROOT/bin/$OK/nmake LOCALRULESPATH=$INSTALLROOT/bin/$OK/lib" - fi if executable $OK/tee then TEE=$INSTALLROOT/bin/$OK/tee fi @@ -6085,524 +3327,49 @@ cat $j $k ;; esac - # fall back to mamake if nmake not found or too old + # build with mamake - if nonmake $MAKE - then note make with mamake - case $target in - '') target="install" ;; - esac - eval capture mamake \$makeflags \$noexec \$target $assign - else case $target in - '') target="install cc-" ;; - esac - eval capture \$MAKE \$makeflags \$nmakeflags \$noexec recurse \$target \$nmakesep \$package $assign - fi - ;; + note "make with mamake" + case $target in + '') target="install" ;; + esac + eval capture mamake \$makeflags \$noexec \$target $assign -read) case ${PWD:-`pwd`} in - $PACKAGEROOT) - ;; - *) echo "$command: must be in package root directory" >&2 - exit 1 - ;; - esac - PAX= - if onpath pax - then case `$_onpath_ -rw --?meter 2>&1` in - *--meter*) PAX=pax ;; - esac - fi - code=0 - i= - x= - remove= - touch= - set '' $target - case $2 in - lcl|tgz)tgz=$2 - shift 2 - target=$* - ;; - *) tgz=tgz - ;; - esac - set '' $package $target - case $# in - 1) verbose=: - set '' `ls lib/package/$tgz/*?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` - ;; - *) verbose= - ;; - esac - shift - files= - for f - do if test -f "$f" - then : ok - elif test -f "lib/package/$tgz/$f" - then f=lib/package/$tgz/$f - else set '' `ls -r ${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` - if test '' != "$2" -a -f "$2" - then f=$2 - else set '' `ls -r lib/package/$tgz/${f}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]* 2>/dev/null` - if test '' != "$2" -a -f "$2" - then f=$2 - else echo "$command: $f: package archive not found" >&2 - continue + case $HOSTTYPE in + darwin.*) + # clean up macOS .dSYM bundles belonging to deleted temps + cd "$PACKAGEROOT" || exit + $exec find "arch/$HOSTTYPE" -type d -name '*.dSYM' -exec "$SHELL" -c ' + first=y + for d # loop through the PPs + do case $first in + y) set -- # clear PPs ("for" uses a copy) + first=n ;; + esac + e=${d%.dSYM} # get exe name + if ! test -f "$e" # nonexistent? + then set -- "$@" "$d" # add to new PPs fi - fi - fi - files="$files $f" - done - case $files in - '') echo "$command: lib/package/$tgz: no package archives" >&2 - exit 1 + done + exec rm -rf "$@" # rm all at once: fast + ' "$0" {} + ;; esac - set '' `ls -r $files 2>/dev/null` - shift - f1= f2= f3= f4= - for f - do case $f in - ratz.*|*/ratz.*) - f1="$f1 $f" - ;; - INIT.*|*/INIT.*) - f2="$f2 $f" - ;; - INIT*|*/INIT*) - f3="$f3 $f" - ;; - *) f4="$f4 $f" - ;; - esac - done - gen= - set '' $f1 $f2 $f3 $f4 - while : - do shift - case $# in - 0) break ;; - esac - f=$1 - case $f in - *.gz) : standalone packages unbundled manually - continue - ;; - *.md5) : tarball checksum - continue - ;; - *?[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]*) - ;; - *) echo "$command: $f: not a package archive" >&2 - code=1 - continue - ;; - esac - case $f in - */*) eval `echo "$f" | sed -e 's,\(.*/\)\(.*\),d=\1 a=\2,'` ;; - *) d= a=$f ;; - esac - # f:file d:dir a:base p:package v:version r:release t:type - eval `echo "$a" | sed -e 's,\.c$,,' -e 's,\.gz$,,' -e 's,\.exe$,,' -e 's,\.tgz$,,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]\([0123456789][0123456789][0123456789][0123456789][^_.]*\)[_.]*\(.*\),p=\1 v=\2 r=\3 t=\4,' -e 's,\([^_.]*\)[_.]\([0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]\)[_.]*\(.*\),p=\1 v=\2 r=base t=\3,'` - case $r in - base) y=$p.base ;; - *) y=$p.delta ;; - esac - case " $x " in - *" $y "*) - continue - ;; - esac - case $t in - '') w=$PACKAGESRC - q= - Q= - m= - ;; - *) w=$PACKAGEROOT/arch/$t/lib/package - q=".$t" - Q="_$t" - m="[_.]$t" - ;; - esac - u=$d$p$q.tim - if test -s "$u" - then continue - else case $force in - 0) case `ls -t "$f" "$u" 2>/dev/null` in - "$u"*) case $verbose in - 1) note $p already read ;; - esac - continue - ;; - esac - ;; - esac - fi - case $p in - INIT) if test -f $PACKAGEROOT/bin/package - then $exec mv $PACKAGEROOT/bin/package $PACKAGEROOT/bin/package.old - fi - ;; - esac - z= - case $r in - base) # base archive - if test ratz = "$p" - then # ratz packages are not archives - case $t in - '') for i in src src/cmd src/cmd/INIT - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - $exec cp $f $PACKAGEROOT/src/cmd/INIT/$p.c - ;; - *) for i in arch arch/$t arch/$t/bin - do test -d $PACKAGEROOT/$i || $exec mkdir $PACKAGEROOT/$i || exit - done - $exec cp $f $PACKAGEROOT/arch/$t/bin/$p && - $exec chmod +x $PACKAGEROOT/arch/$t/bin/$p - ;; - esac - elif test "" != "$PAX" - then $exec pax -L --from=ascii --local -m -ps -rvf "$f" || { - code=1 - continue - } - else if onpath gunzip && onpath $TAR && isascii - then case $TARPROBE in - ?*) for i in $TARPROBE - do if $TAR ${i}f - /dev/null > /dev/null 2>&1 - then TARFLAGS=$TARFLAGS$i - fi - done - TARPROBE= - ;; - esac - if gunzip -l < "$f" > /dev/null 2>&1 - then case $exec in - '') $exec gunzip < "$f" | $TAR ${TARFLAGS}f - ;; - *) $exec "gunzip < $f | $TAR ${TARFLAGS}f -" ;; - esac || { - code=1 - continue - } - else $exec $TAR ${TARFLAGS}f "$f" || { - code=1 - continue - } - fi - else checkaout ratz && onpath ratz || { - code=1 - continue - } - RATZ=$_onpath_ - case $exec in - '') echo $f: - $exec $RATZ -lm < "$f" - ;; - *) $exec "$RATZ -lm < $f" - ;; - esac || { - code=1 - continue - } - fi - if test -f $PACKAGEBIN/gen/$p.sum - then while read md5 mode usr grp file - do case $file in - -*) file=./$file ;; - esac - case $mode in - [01234567][01234567][01234567][01234567]) - case $grp in - -) ;; - *) $exec chgrp $grp "$file" ;; - esac - case $usr in - -) ;; - *) $exec chown $usr "$file" ;; - esac - $exec chmod $mode "$file" - ;; - esac - done < $PACKAGEBIN/gen/$p.sum - fi - fi - ;; - *) # delta archive - test "" != "$PAX" || { - echo "$command: $f: pax required to read delta archive" >&2 - code=1 - continue - } - case `echo "$v: -$r:" | sort` in - $r:*) y=$p.base - b=${d}${p}_${r}${Q}.tgz - test -f "$b" || b=${d}${p}.${r}${q}.tgz - test -f "$b" || { - case " $gen " in - *" $b "*) - ;; - *) case $# in - 1) echo "$command: $f: base archive $b required to read delta" >&2 - code=1 - ;; - *) shift - y=$1 - shift - set '' $y $f "$@" - esac - continue - ;; - esac - } - # -m with delta bug fixed 2005-02-08 - $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { - code=1 - continue - } - note $f: generate new base $d$p.$v$q.tgz - $exec pax -rf "$f" -z "$b" -wf $d$p.$v$q.tgz -x tgz || { - code=1 - continue - } - case $exec in - '') echo $p $v $v 1 > $w/gen/$p.ver - ;; - *) z=$d${p}[_.]$v$q.tgz - $exec "echo $p $v $v 1 > $w/gen/$p.ver" - gen="$gen $d$p.$v$q.tgz" - ;; - esac - case " $remove " in - *" $f "*) ;; - *) remove="$remove $f" ;; - esac - ;; - *) b=${d}${p}_${v}${Q}.tgz - test -f "$b" || b=${d}${p}.${v}${q}.tgz - test -f "$b" || { - case " $gen " in - *" $b "*) - ;; - *) case $# in - 1) echo "$command: $f: base archive $b required to read delta" >&2 - code=1 - ;; - *) shift - y=$1 - shift - set '' $y $f "$@" - esac - continue - ;; - esac - } - # -m with delta bug fixed 2005-02-08 - $exec pax -L --from=ascii --local -ps -rvf "$f" -z "$b" || { - code=1 - continue - } - ;; - esac - ;; - *) echo "$command: $f: unknown archive type" >&2 - code=1 - continue - ;; - esac - # check for ini files - - if executable $w/$p.ini - then $exec $w/$p.ini read || { - code=1 - continue - } - fi - - # add to the obsolete list - - k= - for i in `ls $d$p[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.]????$m* $z 2>/dev/null` - do case $i in - *.md5) continue - ;; - $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789][_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) - ;; - $d${p}[_.][0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]$m*) - continue - ;; - esac - case $k in - ?*) case " $remove " in - *" $k "*) ;; - *) remove="$remove $k" ;; - esac - ;; - esac - k=$i - done - x="$x $y" - case " $touch " in - *" $u "*) ;; - *) touch="$touch $u" ;; - esac - done - if test ! -f $PACKAGEROOT/bin/package -a -f $PACKAGEROOT/bin/package.old - then $exec cp $PACKAGEROOT/bin/package.old $PACKAGEROOT/bin/package - fi - - # drop obsolete archives - - case $remove in - ?*) $exec rm -f $remove ;; - esac - - # mark the updated archives - - case $touch in - ?*) sleep 1; $exec touch $touch ;; - esac - - # check the requirements - - case $code$exec in - 0) requirements - $x ;; - esac - exit $code - ;; - -regress)if test ! -d $PACKAGEBIN/gen - then echo "$command: 'package make' and 'package test' required for regression" >&2 - exit 1 - fi - dir=$PACKAGEBIN/gen - cd $dir - for s in out old - do case `ls -t regress.$s test.$s 2>/dev/null` in - regress*) - ;; - test*) if test -f regress.$s - then $exec mv regress.$s regress.old - fi - case $exec in - '') egrep -i '\*\*\*|FAIL|^TEST.* [123456789][0123456789]* error|core.*dump' test.$s | - sed -e '/\*\*\* [0123456789]/d' \ - -e '/^TEST.\//s,/[^ ]*/,,' \ - -e 's,[ ][ ]*$,,' \ - -e 's/[0123456789][0123456789]*:* \([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*([abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*[Cc][Oo][Rr][Ee][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789 ]*)\)/\1/' \ - -e 's/\.sh failed at .* with /.sh failed /' \ - > regress.$s - ;; - *) $exec filter test failures from $dir/test.$s to $dir/regress.$s - ;; - esac - ;; - esac - done - if test -f regress.out -a -f regress.old - then $exec diff -b regress.out regress.old - else echo "$command: at least 2 test runs required for regression" >&2 - exit 1 - fi - ;; - -release)count= lo= hi= - checksrc - checkaout release || exit - requirements source $package - components $package - package=$_components_ - set '' $target - shift - case $# in - 0) ;; - *) case $1 in - -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) - case $1 in - -) lo= release= ;; - *) lo=$1 release="-f $1" ;; - esac - shift - case $1 in - -|[0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]-[0123456789][0123456789]-[0123456789][0123456789]) - case $1 in - -) hi= ;; - *) hi=$1 release="$release -t $1" ;; - esac - shift - ;; - esac - ;; - [0123456789]|[0123456789][0123456789]|[0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789]|[0123456789][0123456789][0123456789][0123456789][0123456789]*) - count=$1 - release="-r $count" - shift - ;; - esac + case $flat in + 1) note "updating flat view" + cd "$PACKAGEROOT" || exit + $exec find "arch/$HOSTTYPE" -type f ! -name '*.old' -exec "$SHELL" -c ' + for h + do p=${h#"arch/$HOSTTYPE/"} + test "$h" -ef "$p" && continue # already created + d=${p%/*} + test -d "$d" || mkdir -p "$d" || exit + ln -f "$h" "$p" 2>/dev/null || ln -sf "$h" "$p" || exit + done + ' "$0" {} + ;; esac - case $# in - 0) case $package in - '') package=* ;; - esac - ;; - *) case $package in - '') package=$* - ;; - *) echo $command: $*: lo-date hi-date arguments expected >&2 - exit 1 - ;; - esac - ;; - esac - echo - case $count:$lo:$hi in - ::) echo "All recorded changes follow." ;; - 1::) echo "Changes since the last release follow." ;; - ?*::) echo "Changes since the last $count releases follow." ;; - 1:?*:) echo "Changes since $lo or the last release follow." ;; - *:?*:*) echo "Changes since $lo follow." ;; - *::?*) echo "Changes before $hi follow." ;; - *) echo "Changes between $lo and $hi follow." ;; - esac - x= - for r in $INSTALLROOT $PACKAGEROOT - do for s in $package_src - do d=$r/src/$s - if test -d $d - then cd $d - for i in $package - do if test -h $i 2>/dev/null - then continue - fi - case " $x " in - *" $i "*) continue ;; - esac - for f in RELEASE CHANGES ChangeLog - do if test -f $i/$f - then $exec release $release $i/$f - x="$x $i" - for f in $i/*/$f - do if test -f $f - then $exec release $release $f - fi - done - break - fi - done - done - fi - done - done - ;; - -remove) echo "$command: $action: not implemented yet" >&2 - exit 1 ;; results)set '' $target @@ -6624,12 +3391,10 @@ results)set '' $target --) shift break ;; - admin) dir=$PACKAGESRC/admin - ;; error*|fail*) filter=errors ;; - make|test|view|write) + make|test|view) def=$1 case $filter:$1:$SHELL in errors:*:*) ;; @@ -6639,8 +3404,7 @@ results)set '' $target old) suf=old ;; on) case $# in - 1) echo $command: $action: $1: host pattern argument expected >&2 - exit 1 + 1) err_out "$action: $1: host pattern argument expected" ;; esac shift @@ -6692,8 +3456,7 @@ results)set '' $target ;; esac done - echo "$command: $i action output not found" >&2 - exit 1 + err_out "$i action output not found" done sep= case $t in @@ -6724,7 +3487,7 @@ results)set '' $target cat) cat $m ;; *) if test -f $HOME/.pkgresults - then i="`cat $HOME/.pkgresults`" + then i=$(cat $HOME/.pkgresults) case $i in '|'*) ;; *) i="|$i" ;; @@ -6737,7 +3500,7 @@ results)set '' $target case $filter in errors) $exeg egrep '^pax:|\*\*\*' $j ;; - *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|pragma.*prototyped|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | + *) $exec egrep -iv '^($||[\+\[]|cc[^-:]|kill |make.*(file system time|has been replaced)|so|[0123456789]+ error|uncrate |[0123456789]+ block|ar: creat|iffe: test: |conf: (check|generate|test)|[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*=|gsf@research|ar:.*warning|cpio:|ld:.*(duplicate symbol|to obtain more information)|[0123456789]*$|(checking|creating|touch) [/abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789])| obsolete predefined symbol | is (almost always misused|dangerous|deprecated|not implemented)| trigraph| assigned to | cast .* different size| integer overflow .*<<| optimization may be attained | passed as |::__builtin|^creating.*\.a$|warning.*not optimized|exceeds size thresh|ld:.*preempts|is unchanged|with value >=|(-l|lib)\*|/(ast|sys)/(dir|limits|param|stropts)\.h.*redefined|usage|base registers|`\.\.\.` obsolete'"$i" $j | $exec grep : ;; esac @@ -6751,508 +3514,14 @@ results)set '' $target esac ;; -test) requirements source $package - components $package - package=$_components_ - case $only in - 0) only= ;; - 1) only=--recurse=only ;; - esac - - # must have nmake - - if nonmake $MAKE - then echo $command: $action: must have $MAKE to test >&2 - exit 1 - fi - - # all work under $INSTALLROOT/src - - $make cd $INSTALLROOT/src - - # disable core dumps (could be disastrous over nfs) - - (ulimit -c 0) > /dev/null 2>&1 && ulimit -c 0 - - # do the tests - - eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign - ;; - -update) # download the latest release.version for selected packages - - # all work in $PACKAGEROOT/lib/package/tgz - - if test ! -d $PACKAGEROOT/lib/package/tgz - then $exec mkdir -p $PACKAGEROOT/lib/package/tgz || exit - $exec cd $PACKAGEROOT/lib/package/tgz - else cd $PACKAGEROOT/lib/package/tgz - fi - - # get the architectures, update query url, and packages - - set '' $args - op=update - tgz=tgz - source= - binary= - setup= - types= - url= - urlfile=$default_url - while : - do shift - case $# in - 0) break ;; - esac - case $1 in - --) shift - break - ;; - beta) op=beta - tgz=beta - ;; - binary) binary=1 - ;; - setup) setup=1 - ;; - source) source=1 - ;; - *://*) url=$1 - shift - break - ;; - *.url) urlfile=$1 - if test ! -s $urlfile - then echo $command: $urlfile: not found >&2; exit 1 - fi - break - ;; - $all_types) - binary=1 - types="$types $1" - ;; - *) break - ;; - esac - done - case $source:$binary in - :) source=1 binary=1 - ;; - :1) case $types in - '') types=$HOSTTYPE ;; - esac - ;; - esac - case $url in - '') case $urlfile in - $default_url) - if test ! -s $urlfile - then echo $command: url argument expected >&2; exit 1 - fi - ;; - *) default_url= - ;; - esac - url= - if grep '^url=' $urlfile >/dev/null - then a=$authorize - p=$password - case $urlfile in - */*) ;; - *) urlfile=./$urlfile ;; - esac - . $urlfile - case $a:$p in - $authorize:$password) - default_url= - ;; - *) case $a in - ?*) authorize=$a ;; - esac - case $p in - ?*) password=$p ;; - esac - ;; - esac - else url=`cat $urlfile` - fi - ;; - esac - case $exec in - ?*) default_url= ;; - esac - - # get the update list - - eval `echo $url | sed 's,\(.*\)://\([^/]*\)/\(.*\),prot=\"\1\" host=\"\2\" dir=\"\3\",'` - get $host $dir/$op.html - - # get/check the package names - - case " $* " in - *" - "*)case $source in - 1) source_packages=$* ;; - *) source_packages= ;; - esac - case $binary in - 1) binary_packages=$* ;; - *) binary_packages= ;; - esac - package_hit=$* - ;; - " ") nl=" -" - case $source in - 1) p= - for f in `ls *.????-??-??.* 2>/dev/null` - do case $f in - *.????-??-??.????-??-??.*.*) - ;; - *.????-??-??.????-??-??.*) - p=$p$nl$f - ;; - *.????-??-??.*.*) - ;; - *.????-??-??.*) - p=$p$nl$f - ;; - esac - done - set '' `echo "$p" | sed 's,\..*,,' | sort -u` - shift - source_packages=$* - ;; - *) source_packages= - ;; - esac - case $binary in - 1) p= - for f in `ls *.????-??-??.* 2>/dev/null` - do case $f in - *.????-??-??.????-??-??.*.*) - p=$p$nl$f - ;; - *.????-??-??.????-??-??.*) - ;; - *.????-??-??.*.*) - p=$p$nl$f - ;; - *.????-??-??.*) - ;; - esac - done - set '' `echo "$p" | sed 's,\..*,,' | sort -u` - shift - binary_packages=$* - ;; - *) binary_packages= - ;; - esac - package_hit="$source_packages $binary_packages" - ;; - *) case $source in - 1) source_packages=$* ;; - *) source_packages= ;; - esac - case $binary in - 1) binary_packages=$* ;; - *) binary_packages= ;; - esac - package_hit= - ;; - esac - - # get the latest updates - - types_test= - types_local= - dir=$dir/$tgz - case $default_url in - ?*) echo "url='$url' authorize='$authorize' password='$password'" > $default_url - case $authorize in - ?*) chmod go-rwx $default_url ;; - esac - ;; - esac - echo "$got" > got.tmp - case $only in - 0) exec < got.tmp - covered= - while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment - do case $requires in - ''|-*) continue ;; - esac - IFS=: - set '' $requires - IFS=$ifs - case $type in - -) case " $source_packages " in - *" $name "*|*" - "*) - for name - do case " $source_packages " in - *" $name "*) - ;; - *) source_packages="$source_packages $name" - covered=$covered:$covers - ;; - esac - done - ;; - esac - ;; - *) case " $binary_packages " in - *" $name "*|*" - "*) - for name - do case " $binary_packages " in - *" $name "*) - ;; - *) binary_packages="$binary_packages $name" - covered=$covered:$covers - ;; - esac - done - ;; - esac - ;; - esac - done - case $covered in - ?*) x=$source_packages - source_packages= - for name in $x - do case :$covered: in - *:$name:*) ;; - *) source_packages="$source_packages $name" ;; - esac - done - x=$binary_packages - binary_packages= - for name in $x - do case :$covered: in - *:$name:*) ;; - *) binary_packages="$binary_packages $name" ;; - esac - done - ;; - esac - ;; - esac - checksum= - for i in $checksum_commands - do case `( $i ) < /dev/null 2> /dev/null` in - ${checksum_empty}|${checksum_empty}[\ \ ]*) - checksum=$i - break - ;; - esac - done - case $checksum in - '') echo $command: warning: '{' $checksum_commands '}' command not found -- only download sizes will be checked >&2 ;; - esac - exec < got.tmp - while read name suffix type base base_size delta delta_size sync sync_size requires covers base_sum delta_sum sync_sum comment - do case $verbose in - 1) case $type in - -) i= ;; - *) i=.$type ;; - esac - j="$name.$base$i.$suffix" - case $delta in - -) j="$j -" ;; - *) j="$j $name.$base.$delta$i.$suffix" ;; - esac - case $sync in - -) j="$j -" ;; - *) j="$j $name.$base.$sync$i.$suffix" ;; - esac - echo $command: $j $base_size:$base_sum $delta_size:$delta_sum $sync_size:$sync_sum $requires >&2 - esac - case " $package_hit " in - *" $name "*|*" - "*) - ;; - *) package_hit="$package_hit $name" - ;; - esac - case $type in - -) case " $source_packages " in - *" $name "*|*" - "*) - if test -s $name.tim - then continue - fi - lcl=$name.$base.$suffix - if test -f $lcl - then case $checksum:$base_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" - then rmt= - case $sync:$sync_size in - -*|*[-:]) - ;; - *) lcl=$name.$base.$sync.$suffix - if test -f $lcl - then rmt=1 - get $host $dir $lcl $sync_size $sync_sum - fi - ;; - esac - case $base:$base_size in - -*|*[-:]) - ;; - *) case $rmt in - '') lcl=$name.$base.$suffix - get $host $dir $lcl $base_size $base_sum - ;; - esac - ;; - esac - fi - case $delta:$delta_size in - -*|*[-:]) - ;; - *) lcl=$name.$delta.$base.$suffix - if test -f $lcl - then case $checksum:$delta_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" - then get $host $dir $lcl $delta_size $delta_sum - fi - ;; - esac - ;; - esac - ;; - *) case " $binary_packages " in - *" $name "*|*" - "*) - if test -s $name.$type.tim - then continue - fi - case " $types " in - *" - "*);; - " ") case " $types_test " in - *" $type "*) - ;; - *) types_test="$types_test $type" - for i in *.????-??-??.$type.* *.????-??-??.????-??-??.$type.* - do if test -f $i - then types_local="$types_local $type" - fi - break - done - ;; - esac - case " $types_local " in - *" $type "*) - ;; - *) continue - ;; - esac - ;; - *) case " $types " in - *" $type "*) - ;; - *) continue - ;; - esac - ;; - esac - lcl=$name.$base.$type.$suffix - if test -f $lcl - then case $checksum:$base_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$base_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -a "X-" = "X$delta" -o "$base_size" != "$size" -o "$base_sum" != "$sum" - then rmt= - case $sync:$sync_size in - -*|*[-:]) - ;; - *) lcl=$name.$base.$sync.$type.$suffix - if test -f $lcl - then rmt=1 - get $host $dir $lcl $sync_size $sync_sum - fi - ;; - esac - case $base:$base_size in - -*|*[-:]) - ;; - *) case $rmt in - '') lcl=$name.$base.$type.$suffix - get $host $dir $lcl $base_size $base_sum - ;; - esac - ;; - esac - fi - case $delta:$delta_size in - -*|*[-:]) - ;; - *) lcl=$name.$delta.$base.$type.$suffix - if test -f $lcl - then sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` - else sum=X - fi - if test -f $lcl - then case $checksum:$delta_sum in - :*|*:-) size=`wc -c < $lcl | sed 's, ,,g'` sum=$delta_sum ;; - *) size=$base_size sum=`$checksum < $lcl | sed -e 's,^[ ][ ]*,,' -e 's,[ ].*,,'` ;; - esac - else size=X sum=X - fi - if test "0" != "$force" -o "$delta_size" != "$size" -o "$delta_sum" != "$sum" - then get $host $dir $lcl $delta_size $delta_sum - fi - ;; - esac - ;; - esac - ;; - esac - done - closure= - for name in $source_packages $binary_packages - do case $name in - -) ;; - *) case " $package_hit " in - *" $name "*) - case $setup in - 1) case " $closure " in - *" $name "*) - ;; - *) closure="$closure $name" - ;; - esac - ;; - esac - ;; - *) echo $command: $name: unknown package >&2 - ;; - esac - ;; - esac - done - exec <&- - rm -f got.tmp - case $closure in - ?*) echo $closure ;; - esac +test) # pass control to ksh 93u+m test script + capture "$PACKAGEROOT/bin/shtests" $args ;; use) # finalize the environment x=:.. - for d in `( cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u )` + for d in $( cd $PACKAGEROOT; ls src/*/Mamfile 2>/dev/null | sed 's,/[^/]*$,,' | sort -u ) do x=$x:$INSTALLROOT/$d done x=$x:$INSTALLROOT @@ -7264,33 +3533,19 @@ use) # finalize the environment export CDPATH ;; esac - P=$PACKAGEROOT - $show P=$P - $show export P - export P - A=$INSTALLROOT - $show A=$A - $show export A - export A - case $NPROC in - '') hostinfo cpu - case $_hostinfo_ in - 0|1) ;; - *) NPROC=$_hostinfo_ - $show NPROC=$NPROC - $show export NPROC - export NPROC - ;; - esac - ;; - esac eval PACKAGE_USE=$package_use export PACKAGE_USE + unset LC_ALL # respect the user's locale again; avoids multibyte corruption # run the command case $run in - '') case $show in + '') note "You are now entering a new environment set up to use the package in:" \ + " $INSTALLROOT" \ + "You're using the shell:" \ + " $SHELL" \ + "Type 'exit' to leave and go back to normal." + case $show in ':') $exec exec $SHELL ;; esac ;; @@ -7299,128 +3554,7 @@ use) # finalize the environment esac ;; -verify) cd $PACKAGEROOT - requirements binary $package - if executable ! $SUM - then echo "$command: $action: $SUM command required" >&2 - exit 1 - fi - case $target in - '') cd arch - set '' * - shift - target=$* - cd .. - ;; - esac - code=0 - for a in $target - do case $package in - '') set '' arch/$a/lib/package/gen/*.sum - shift - if test -f $1 - then for i - do package_verify $i || code=1 - done - else echo "$command: warning: $a: no binary packages" >&2 - fi - ;; - *) for i in $package - do if test -f arch/$a/lib/package/gen/$i.sum - then package_verify arch/$a/lib/package/gen/$i.sum || code=1 - else echo "$command: warning: $a: no binary package for $i" >&2 - fi - done - ;; - esac - done - exit $code - ;; - -write) set '' $target - shift - action= - list= - qualifier= - while : - do case $1 in - base|closure|delta|exp|lcl|pkg|rpm|tgz) - qualifier="$qualifier $1" - ;; - binary) action=$1 - type=$HOSTTYPE - eval list=$PACKAGESRC/tgz/$admin_list - ;; - cyg) qualifier="$qualifier $1" - assign="$assign closure=1" - only=1 - ;; - runtime|source) - action=$1 - ;; - tst) qualifier="$qualifier tgz" - assign="$assign copyright=0 'PACKAGEDIR=\$(PACKAGESRC)/tst'" - ;; - nocopyright) - assign="$assign copyright=0" - ;; - *) break - ;; - esac - shift - done - case $action in - '') echo "$command: binary or source operand expected" >&2 - exit 1 - ;; - esac - set '' "$@" $package - shift - case $only in - 0) set '' `order "$@"` - shift - ;; - esac - case $# in - 0) echo "$command: at least one package name expected" >&2 - exit 1 - ;; - esac - if nonmake $MAKE - then echo "$command: must have $MAKE to generate archives" >&2 - exit 1 - fi - - # all work under $PACKAGEBIN - - $make cd $PACKAGEBIN - case $list in - ?*) $exec rm -f $list ;; - esac - - # go for it - - for package - do if view - all $package.pkg || view - all lib/package/$package.pkg - then eval capture \$MAKE \$makeflags -X ignore \$noexec -f \$package.pkg \$qualifier \$action $assign - else echo "$command: $package: not a package" >&2 - fi - done - ;; - -TEST) set '' $target $package - shift - case $1 in - binary|source) - action=$1 - shift - ;; - esac - order "$@" - ;; - -*) echo "$command: $action: internal error" >&2 - exit 1 +*) err_out "$action: internal error" ;; esac diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/probe.win32 b/cde/programs/dtksh/ksh93/src/cmd/INIT/probe.win32 index 7939fccad..2774bb34c 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/probe.win32 +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/probe.win32 @@ -1,8 +1,8 @@ : # @(#)probe.win32 (AT&T Research) 2010-01-01 # -# win32 specific make C probe initialization -# wrapped cc's are easy on uwin +# Win32 specific make C probe initialization +# wrapped cc's are easy on UWIN # # 2> easy.err to avoid mysterious hang with bcc @@ -37,9 +37,6 @@ done for i in $probe_header do echo "#include <$i>" done -echo '#ifdef __cplusplus' -echo "int _Pr0b3_cplus=__cplusplus;" -echo '#endif' echo '#ifdef _UWIN' echo "int _Pr0b3_uwin=_UWIN;" echo '#endif' @@ -71,7 +68,6 @@ echo '#endif' include= uwin= -cplus= $cc -E easy.c 2>&1 | egrep -i '^(#(line)? 1 .*\.[hH]| *int +_Pr0b3_[a-zA-Z_]* *= *[0-9])' | @@ -133,11 +129,6 @@ then : the payoff set -- $(whence $cmd) "$@" typ=$(package) dialect="ANSI CLOSURE DYNAMIC EXPORT=DLL LIBPP -I-" - case ${cc##*/} in - *CC*) dialect="$dialect C++" - cplus=1 - ;; - esac ld=${cc%cc}ld if [[ ! -x $ld ]] then ld=${cc%/*}/ld diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/proto.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/proto.c deleted file mode 100644 index cc3b067df..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/proto.c +++ /dev/null @@ -1,5289 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2012 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 * -* * -***********************************************************************/ -#pragma clang diagnostic ignored "-Wparentheses" -#pragma clang diagnostic ignored "-Wunused-value" -#pragma clang diagnostic ignored "-Wstring-plus-int" - -/* : : generated by proto : : */ - -#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 -#line 1 "proto.c" - - -#line 151 -# ifndef __STDC__ -# ifndef creat -# define creat _huh_creat -# endif -# if 1 -# ifndef access -# define access _huh_access -# endif -# ifndef ctime -# define ctime _huh_ctime -# endif -# ifndef mkdir -# define mkdir _huh_mkdir -# endif -# endif -# endif - -# include -# include -# include -# if 1 -# include -# else -# include -# endif - -# ifndef __STDC__ -# undef access -# undef ctime -# undef creat -# undef mkdir -# endif - -# ifndef O_RDONLY -# define O_RDONLY 0 -# endif - -# ifndef S_IRUSR -# define S_IRUSR 0400 -# endif -# ifndef S_IWUSR -# define S_IWUSR 0200 -# endif -# ifndef S_IXUSR -# define S_IXUSR 0100 -# endif -# ifndef S_IRGRP -# define S_IRGRP 0040 -# endif -# ifndef S_IWGRP -# define S_IWGRP 0020 -# endif -# ifndef S_IXGRP -# define S_IXGRP 0010 -# endif -# ifndef S_IROTH -# define S_IROTH 0004 -# endif -# ifndef S_IWOTH -# define S_IWOTH 0002 -# endif -# ifndef S_IXOTH -# define S_IXOTH 0001 -# endif - -# ifndef __STDC__ -# if !_WIN32 && !_WINIX -# define remove(x) unlink(x) -# define rename(x,y) ((link(x,y)||remove(x))?-1:0) -# endif - -# if 1 -extern __MANGLE__ int access __PROTO__((const char*, int)); -extern __MANGLE__ int mkdir __PROTO__((const char*, int)); -# endif - -# endif - -# if 1 -extern __MANGLE__ int utime __PROTO__((const char*, time_t*)); -# endif - - - - - - -int -replace __PARAM__((const char* newfile, const char* oldfile, int preserve), (newfile, oldfile, preserve)) __OTORP__(const char* newfile; const char* oldfile; int preserve;){ - struct stat st; - time_t ut[2]; - - if (stat(oldfile, &st)) - { - if (preserve) - return -1; - st.st_mode = 0; - } - if (remove(oldfile) || rename(newfile, oldfile)) - return -1; - if (st.st_mode &= (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH)) - chmod(oldfile, st.st_mode); - if (preserve) - { - ut[0] = st.st_atime; - ut[1] = st.st_mtime; - preserve = utime(oldfile, ut); - } - return preserve; -} - -# undef utime -# define utime ______utime - -#line 1 "../../lib/libpp/ppproto.c" - -#line 13 -static const char id[] = "\n@(#)$Id: proto (AT&T Research) 2012-04-14 $\000\n"; - -#line 1 "../../lib/libpp/ppfsm.c" - -#line 1 "../../lib/libpp/pplib.h" - -#line 108 -struct ppsymbol; -struct ppindex; - -typedef char* (*PPBUILTIN) __PROTO__((char*, const char*, const char*)); -typedef void (*PPCOMMENT) __PROTO__((const char*, const char*, const char*, int)); -typedef void (*PPINCREF) __PROTO__((const char*, const char*, int, int)); -typedef void (*PPLINESYNC) __PROTO__((int, const char*)); -typedef void (*PPMACREF) __PROTO__((struct ppsymbol*, const char*, int, int, unsigned long)); -typedef int (*PPOPTARG) __PROTO__((int, int, const char*)); -typedef void (*PPPRAGMA) __PROTO__((const char*, const char*, const char*, const char*, int)); - -struct ppinstk -{ - char* nextchr; - struct ppinstk* next; - struct ppinstk* prev; - long* control; - char* buffer; - char* file; - char* prefix; - struct ppsymbol* symbol; - - struct ppindex* index; - int buflen; - - int line; - int vendor; - short fd; - short hide; - short flags; - char type; -}; - - - - - - - - - -struct pplist -{ - char* value; - struct pplist* next; -}; - -struct oplist -{ - int op; - char* value; - struct oplist* next; -}; - -struct pphide -{ - struct ppmacro* macro; - unsigned long flags; - int level; -}; - -struct ppmacstk -{ - struct ppmacstk* next; - struct ppmacstk* prev; - int line; - char* arg[1]; -}; - -struct ppmember -{ - struct ppdirs* archive; - unsigned long offset; - unsigned long size; -}; - -struct counter -{ - int candidate; - int function; - int macro; - int pplex; - int push; - int terminal; - int token; -}; - -struct pptuple -{ - struct pptuple* nomatch; - struct pptuple* match; - char token[1]; -}; - -struct ppfileid -{ - unsigned long st_dev; - unsigned long st_ino; -}; - -struct pathid -{ - char* path; - struct ppfileid id; -}; - -#line 1 "../../lib/libpp/pp.h" - -#line 206 - -#line 217 - -#line 329 -struct ppdirs -{ - char* name; - struct ppdirs* next; - - - unsigned char c; unsigned char index; unsigned char type; union { char* buffer; char* sp; struct ppdirs* subdir; } info; struct ppfileid id; - - -}; - -struct ppkeyword -{ - char* name; - int value; -}; - -struct ppmacro -{ - int arity; - char* value; - - - struct pptuple* tuple; char* formals; int size; - - -}; - -struct ppsymbol -{ - int hash_header; - unsigned long flags; - struct ppmacro* macro; - __V_* value; - - - struct pphide* hidden; - - -}; - -#line 378 -struct ppglobals -{ - const char* version; - char* lineid; - char* outfile; - char* pass; - char* token; - struct ppsymbol* symbol; - - - - char* outb; - char* outbuf; - char* outp; - char* oute; - unsigned long offset; - - - struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; - - - - struct ppcontext* context; long state; long mode; long option; long test; struct { char* sp; long flags; } filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; long ro_op[2]; struct pathid cdir; struct pathid hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; - - - - char* checkpoint; int constack; struct ppinstk* in; char* addp; char* args; char* addbuf; char* catbuf; char* hdrbuf; char* hidebuf; char* path; char* tmpbuf; char* valbuf; char* optflags; int lastout; char* include; char* prefix; struct ppmember* member; int hidden; int hiding; int level; struct { int input; int output; } pool; struct { long ro_state; long ro_mode; long ro_option; long ro_op[2]; int on; char* symtab; } reset; int truncate; struct ppmacstk* macp; char* maxmac; char* mactop; char* toknxt; long* control; long* maxcon; struct oplist* chop; struct ppfile* insert; struct ppfile* original; struct ppdirs* found; int vendor; char* dirtab; char* strtab; PPBUILTIN builtin; PPCOMMENT comment; PPINCREF incref; PPLINESYNC linesync; PPLINESYNC olinesync; PPMACREF macref; PPOPTARG optarg; PPPRAGMA pragma; struct counter counter; char funbuf[256]; - - -}; - - - - - - - -extern __MANGLE__ struct ppglobals pp; -extern __MANGLE__ char _pp_ctype[]; - -extern __MANGLE__ int ppargs __PROTO__((char**, int)); -extern __MANGLE__ void ppcpp __PROTO__((void)); -extern __MANGLE__ void ppcomment __PROTO__((char*, char*, char*, int)); -extern __MANGLE__ __V_* ppcontext __PROTO__((__V_*, int)); -extern __MANGLE__ void pperror __PROTO__((int, ...)); -extern __MANGLE__ void ppincref __PROTO__((char*, char*, int, int)); -extern __MANGLE__ void ppinput __PROTO__((char*, char*, int)); -extern __MANGLE__ int pplex __PROTO__((void)); -extern __MANGLE__ void ppline __PROTO__((int, char*)); -extern __MANGLE__ void ppmacref __PROTO__((struct ppsymbol*, char*, int, int, unsigned long)); -extern __MANGLE__ void ppop __PROTO__((int, ...)); -extern __MANGLE__ void pppragma __PROTO__((char*, char*, char*, char*, int)); -extern __MANGLE__ int ppprintf __PROTO__((char*, ...)); -extern __MANGLE__ int ppsync __PROTO__((void)); - -#line 368 "../../lib/libpp/pplib.h" - -#line 1 "../../lib/libpp/ppdef.h" - -#line 369 "../../lib/libpp/pplib.h" - -#line 1 "../../lib/libpp/ppkey.h" - -#line 16 - -#line 125 -extern __MANGLE__ struct ppkeyword ppkey[]; - -#line 370 "../../lib/libpp/pplib.h" - -#line 683 -struct ppcontext -{ - struct ppdirs* lcldirs; struct ppdirs* stddirs; int flags; char* symtab; - struct ppcontext* context; long state; long mode; long option; long test; struct { char* sp; long flags; } filedeps; struct ppdirs* firstdir; struct ppdirs* lastdir; int hide; int column; int pending; char* firstfile; char* lastfile; char* ignore; char* probe; char* filtab; char* prdtab; char* date; char* time; char* maps; long ro_state; long ro_mode; long ro_option; long ro_op[2]; struct pathid cdir; struct pathid hostdir; char* ppdefault; struct ppindex* firstindex; struct ppindex* lastindex; struct oplist* firstop; struct oplist* lastop; struct oplist* firsttx; struct oplist* lasttx; unsigned char arg_file; unsigned char arg_mode; unsigned char arg_style; unsigned char c; unsigned char hosted; unsigned char ignoresrc; unsigned char initialized; unsigned char standalone; unsigned char spare_1; -}; - -struct ppfile -{ - int hash_header; - struct ppsymbol* guard; - struct ppfile* bound[4]; - int flags; -}; - - - -struct ppindex -{ - struct ppindex* next; - struct ppfile* file; - unsigned long begin; - unsigned long end; -}; - - - -struct ppsymkey -{ - struct ppsymbol sym; - int lex; -}; - -#line 729 -# ifdef __STDC__ - -# include -# include -# include -# include - -# else - -# define size_t int - -extern __MANGLE__ __V_* realloc __PROTO__((__V_*, size_t)); -extern __MANGLE__ __V_* calloc __PROTO__((size_t, size_t)); -extern __MANGLE__ char* ctime __PROTO__((time_t*)); -extern __MANGLE__ void free __PROTO__((__V_*)); - -# ifndef O_RDONLY - -extern __MANGLE__ int access __PROTO__((const char*, int)); -extern __MANGLE__ int close __PROTO__((int)); -extern __MANGLE__ int creat __PROTO__((const char*, int)); -extern __MANGLE__ void exit __PROTO__((int)); -extern __MANGLE__ int link __PROTO__((const char*, const char*)); -extern __MANGLE__ int open __PROTO__((const char*, int, ...)); -extern __MANGLE__ int read __PROTO__((int, __V_*, int)); -extern __MANGLE__ time_t time __PROTO__((time_t*)); -extern __MANGLE__ int unlink __PROTO__((const char*)); -extern __MANGLE__ int write __PROTO__((int, const __V_*, int)); - -# endif - -# endif - -#line 802 -extern __MANGLE__ void ppassert __PROTO__((int, char*, char*)); -extern __MANGLE__ void ppbuiltin __PROTO__((void)); -extern __MANGLE__ int ppcall __PROTO__((struct ppsymbol*, int)); -extern __MANGLE__ int ppcontrol __PROTO__((void)); -extern __MANGLE__ void ppdump __PROTO__((void)); -extern __MANGLE__ char* ppexpand __PROTO__((char*)); -extern __MANGLE__ long ppexpr __PROTO__((int*)); -extern __MANGLE__ void ppfsm __PROTO__((int, char*)); -extern __MANGLE__ char* ppinstr __PROTO__((struct ppinstk*)); -extern __MANGLE__ char* ppkeyname __PROTO__((int, int)); -extern __MANGLE__ char* pplexstr __PROTO__((int)); -extern __MANGLE__ void ppload __PROTO__((char*)); -extern __MANGLE__ void ppmapinclude __PROTO__((char*, char*)); -extern __MANGLE__ char* ppmodestr __PROTO__((long)); -extern __MANGLE__ int ppmultiple __PROTO__((struct ppfile*, struct ppsymbol*)); -extern __MANGLE__ void ppnest __PROTO__((void)); -extern __MANGLE__ int ppoption __PROTO__((char*)); -extern __MANGLE__ char* ppoptionstr __PROTO__((long)); -extern __MANGLE__ void pppclose __PROTO__((char*)); -extern __MANGLE__ int pppdrop __PROTO__((char*)); -extern __MANGLE__ char* pppopen __PROTO__((char*, int, char*, char*, char*, char*, int)); -extern __MANGLE__ int pppread __PROTO__((char*)); -extern __MANGLE__ int pppredargs __PROTO__((void)); -extern __MANGLE__ void pppush __PROTO__((int, char*, char*, int)); -extern __MANGLE__ struct ppsymbol* pprefmac __PROTO__((char*, int)); -extern __MANGLE__ int ppsearch __PROTO__((char*, int, int)); -extern __MANGLE__ int ppset __PROTO__((long*, long, int)); -extern __MANGLE__ char* ppstatestr __PROTO__((long)); -extern __MANGLE__ char* pptokstr __PROTO__((char*, int)); -extern __MANGLE__ void pptrace __PROTO__((int)); - -#line 11 "../../lib/libpp/ppfsm.c" - -#line 1 "../../lib/libpp/ppfsm.h" - -#line 185 - -#line 249 -extern __MANGLE__ short _pp_fsmtab[(0+28)+1][255+1]; - - - - - -extern __MANGLE__ char _pp_trigraph[255+1]; - -extern __MANGLE__ void _pp_refill __PROTO__((int)); - -#line 12 "../../lib/libpp/ppfsm.c" - - -#line 67 -struct fsminit -{ - int state; - unsigned char ch[4]; - int nextstate; -}; - -static struct fsminit fsminit[] = -{ - - { 0, { 023 }, ((0+28)+11), }, - { 0, { 002 }, (0), }, - { 0, { 001 }, (0+23), }, - { 0, { '.' }, (0+25), }, - { 0, { 021 }, (0+19), }, - { 0, { 'L' }, (0+20), }, - { 0, { 'd', 'e', 'f', 'i' }, (0+1), }, - { 0, { 'r', 's', 't', 'v' }, (0+1), }, - { 0, { 'w', 'N' }, (0+1), }, - { 0, { '"', '\'' }, ((0+28)+3), }, - { 0, { '/' }, (0+12), }, - { 0, { '\n' }, ((0+28)+7), }, - { 0, { ' ','\t','\f','\013' }, (0+27), }, - - - { (0+1), { 023 }, ((0+28)+6), }, - { (0+1), { 021, 001 }, (0+19), }, - { (0+1), { 'a' }, (0+2), }, - { (0+1), { 'e' }, (0+3), }, - { (0+1), { 'f' }, (0+4), }, - { (0+1), { 'h' }, (0+5), }, - { (0+1), { 'l' }, (0+6), }, - { (0+1), { 'n' }, (0+7), }, - { (0+1), { 'o' }, (0+8), }, - { (0+1), { 't' }, (0+9), }, - { (0+1), { 'x' }, (0+10), }, - { (0+1), { 'y' }, (0+11), }, - - - { (0+2), { 023 }, (((0+28)+12)), }, - { (0+2), { 021, 001 }, (0+19), }, - { (0+2), { '_','s','t','a' }, (0+2), }, - { (0+2), { 'r' }, (0+2), }, - - - { (0+3), { 023 }, (((0+28)+12)), }, - { (0+3), { 021, 001 }, (0+19), }, - { (0+3), { 't','u','r','n' }, (0+3), }, - - - { (0+4), { 023 }, (((0+28)+12)), }, - { (0+4), { 021, 001 }, (0+19), }, - - - { (0+5), { 023 }, (((0+28)+12)), }, - { (0+5), { 021, 001 }, (0+19), }, - { (0+5), { 'i','l','e' }, (0+5), }, - - - { (0+6), { 023 }, (((0+28)+12)), }, - { (0+6), { 021, 001 }, (0+19), }, - { (0+6), { 's','e' }, (0+6), }, - - - { (0+7), { 023 }, (((0+28)+12)), }, - { (0+7), { 021, 001 }, (0+19), }, - { (0+7), { 'l','i','n','e' }, (0+7), }, - - - { (0+8), { 023 }, (((0+28)+12)), }, - { (0+8), { 021, 001 }, (0+19), }, - { (0+8), { 'r','i','d','N' }, (0+8), }, - - - { (0+9), { 023 }, (((0+28)+12)), }, - { (0+9), { 021, 001 }, (0+19), }, - { (0+9), { 'a','t','i','c' }, (0+9), }, - - - { (0+10), { 023 }, (((0+28)+12)), }, - { (0+10), { 021, 001 }, (0+19), }, - { (0+10), { 't','e','r','n' }, (0+10), }, - - - { (0+11), { 023 }, (((0+28)+12)), }, - { (0+11), { 021, 001 }, (0+19), }, - { (0+11), { 'p','e','d','f' }, (0+11), }, - - - { (0+12), { 023 }, ((0+28)+0), }, - { (0+12), { '*' }, (0+13), }, - - { (0+12), { '/' }, (0+16), }, - - - - { (0+13), { 023 }, (0+13), }, - { (0+13), { '\n', 002 }, ((0+28)+1), }, - { (0+13), { '/' }, (0+15), }, - { (0+13), { '*' }, (0+14), }, - { (0+13), { '#', ';', ')' }, ((( (0+13))<<(7+1))|(((0+28)+8))), }, - - - { (0+14), { 023 }, (0+13), }, - { (0+14), { '\n', 002 }, ((0+28)+1), }, - { (0+14), { '#', ';', ')' }, ((( (0+13))<<(7+1))|(((0+28)+8))), }, - { (0+14), { '*' }, (0+14), }, - { (0+14), { '/' }, ((0+28)+1), }, - - - { (0+15), { 023 }, (0+13), }, - { (0+15), { '*', '\n', 002 }, ((0+28)+1), }, - { (0+15), { '/' }, (0+15), }, - - - { (0+16), { 023 }, (0+16), }, - { (0+16), { '\n', 002 }, ((0+28)+1), }, - { (0+16), { '/' }, (0+17), }, - { (0+16), { '*' }, (0+18), }, - - - { (0+17), { 023 }, (0+16), }, - { (0+17), { '*', '\n', 002 }, ((0+28)+1), }, - { (0+17), { '/' }, (0+17), }, - - - { (0+18), { 023 }, (0+16), }, - { (0+18), { '\n', 002 }, ((0+28)+1), }, - { (0+18), { '*' }, (0+18), }, - { (0+18), { '/' }, ((0+28)+1), }, - - - { (0+19), { 023 }, ((0+28)+6), }, - { (0+19), { 021, 001 }, (0+19), }, - - - { (0+25), { 023 }, ((0+28)+0), }, - { (0+25), { '.' }, (0+26), }, - { (0+25), { 001 }, (0+23), }, - - - { (0+26), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, - { (0+26), { '.' }, (((( (0401+29))-0401)<<(7+1))|( ((0+28)+13))), }, - - - { (0+20), { 023 }, ((0+28)+6), }, - { (0+20), { 021, 001 }, (0+19), }, - { (0+20), { '"', '\'' }, ((( (0+21))<<(7+1))|(((0+28)+8))), }, - - - { (0+21), { 023 }, (0+21), }, - { (0+21), { '"', '\'' }, ((0+28)+4), }, - { (0+21), { '\n', 002 }, ((0+28)+4), }, - { (0+21), { '\\' }, (0+22), }, - - - { (0+22), { 023 }, ((0+28)+5), }, - { (0+22), { '\n', 002 }, ((0+28)+4), }, - - - { (0+23), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, - { (0+23), { 021, 001, '.' }, (0+23), }, - { (0+23), { 'e', 'E' }, (0+24), }, - - - { (0+24), { 023 }, (((( (0401+1))-0401)<<(7+1))|( ((0+28)+14))), }, - { (0+24), { 021, 001, '.' }, (0+23), }, - { (0+24), { '+', '-' }, (0+23), }, - - - { (0+27), { 023 }, ((0+28)+15), }, - { (0+27), { ' ', '\t' }, (0+27), }, - { (0+27), { '\f', '\013' }, ((0+28)+10), }, - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 528 - { (-1), { 0 }, 0, } -}; - -short _pp_fsmtab[(0+28)+1][255+1]; - -char _pp_trigraph[255+1]; - - -static char spl[] = { '\\', '\r', 0 }; -static char aln[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$@"; - - - - -static char* let = &aln[10]; -static char hex[] = "fedcbaFEDCBA9876543210"; -static char* dec = &hex[12]; -static char* oct = &hex[14]; - - - - - - -void -ppfsm __PARAM__((int op, register char* s), (op, s)) __OTORP__(int op; register char* s;){ - register int c; - register int n; - register int i; - register short* rp; - register struct fsminit* fp; - - - - - - switch (op) - { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - case 4: - for (fp = fsminit;; fp++) - { - if ((n = fp->nextstate) >= (0+28)) n = ~n; - if (fp->state == (-1)) - { - - - - - - - - - - - - - - break; - } - rp = _pp_fsmtab[fp->state]; - for (i = 0; i < sizeof(fp->ch) && (c = fp->ch[i]); i++) - { - switch (c) - { - case 023: - for (c = 0; c <= 255; c++) - rp[c] = n; - - - case 002: - _pp_fsmtab[(0+28)][fp->state+1] = n < 0 ? ~n : n; - continue; - - case 021: - s = let; - break; - - case 003: - s = hex; - break; - - case 001: - s = dec; - break; - - case 022: - s = oct; - break; - - default: - rp[c] = n; - continue; - } - while (c = *s++) - rp[c] = n; - } - } - - - - - - - for (i = 0; i < (0+28); i++) - { - rp = _pp_fsmtab[i]; - s = spl; - while (c = *s++) - if (c != '@' || !(( rp)>=_pp_fsmtab[(0+13)]&&( rp)<=_pp_fsmtab[(0+18)])) - { - if (rp[c] >= 0) rp[c] = ~rp[c]; - rp[c] &= ~(1<<7); - } - rp[0] = ~((0+28)+2); - for (c = 0; c <= 255; c++) - if (rp[c] == i) - rp[c] = 0; - } - _pp_fsmtab[(0+28)][0] = ~((0+28)+2); - - - - - - - - - - - - - - - - - - -#line 707 - break; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 860 - } -} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#line 18 "../../lib/libpp/ppproto.c" - -#line 1 "../../../include/ast/hashkey.h" - -#line 24 - - -#line 68 -extern __MANGLE__ long strkey __PROTO__((const char*)); - -#line 20 "../../lib/libpp/ppproto.c" - -#line 41 -typedef struct Key_s -{ - const char* name; - size_t size; - int hit; - int val; -} Key_t; - -typedef struct Proto_s -{ - int brace; - int call; - int fd; - char* file; - long flags; - long options; - char* package; - int line; - int test; - - char* tp; - - int iz; - char* ib; - char* ip; - - int oz; - char* ob; - char* op; - char* ox; - - char cc[3]; - char pushback[4]; - - char variadic[256]; - - - - -} Proto_t; - - -#line 171 -static const Key_t pragmas[] = -{ - { "prototyped",sizeof( "prototyped")-1, 0x01, 1}, - { "noprototyped",sizeof( "noprototyped")-1, 0x01, 0}, - { "noticed",sizeof( "noticed")-1, 0x02, 1}, - { "nonoticed",sizeof( "nonoticed")-1, 0x02, 0}, -}; - -static const Key_t notices[] = -{ - { "Copyright",sizeof( "Copyright")-1, 0x02, 1}, - { "COPYRIGHT",sizeof( "COPYRIGHT")-1, 0x02, 1}, - { "copyright",sizeof( "copyright")-1, 0x02, 1}, - { "Public Domain",sizeof( "Public Domain")-1, 0x02, 0}, - { "PUBLIC DOMAIN",sizeof( "PUBLIC DOMAIN")-1, 0x02, 0}, -}; - - - - - - -static char* -number __PARAM__((register char* p, register long n), (p, n)) __OTORP__(register char* p; register long n;){ - register long d; - - for (d = 1000000; d > 1; d /= 10) - if (n >= d) *p++ = '0' + (n / d) % 10; - *p++ = '0' + n % 10; - return p; -} - - - -static int errors; - - -#line 224 - - - - -static int -sstrlen __PARAM__((register const char* s), (s)) __OTORP__(register const char* s;){ - register const char* b; - - for (b = s; *s; s++); - return s - b; -} - - - - - -static int -sstrncmp __PARAM__((register const char* s, register const char* t, register int n), (s, t, n)) __OTORP__(register const char* s; register const char* t; register int n;){ - register const char* e = s + n; - - while (s < e) - { - if (*s != *t || !*s) - return *s - *t; - s++; - t++; - } - return 0; -} - - - - - -static char* -strcopy __PARAM__((register char* s, register const char* t), (s, t)) __OTORP__(register char* s; register const char* t;){ - while (*s++ = *t++); - return s - 1; -} - - - -static void -proto_error __PARAM__((char* iob, int level, char* msg, char* arg), (iob, level, msg, arg)) __OTORP__(char* iob; int level; char* msg; char* arg;){ - register char* p; - char buf[1024]; - - p = strcopy(buf, "proto: "); - if (iob) - { - register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); - - if (proto->line) - { - if (proto->file) - { - *p++ = '"'; - p = strcopy(p, proto->file); - *p++ = '"'; - *p++ = ','; - *p++ = ' '; - } - p = strcopy(p, "line "); - p = number(p, proto->line); - } - else if (proto->file) - p = strcopy(p, proto->file); - } - else - { - p = strcopy(p, msg); - msg = arg; - arg = 0; - } - if (*(p - 1) != ' ') - { - *p++ = ':'; - *p++ = ' '; - } - if (level == 1) - p = strcopy(p, "warning: "); - p = strcopy(p, msg); - if (arg) - { - *p++ = ' '; - p = strcopy(p, arg); - } - *p++ = '\n'; - write(2, buf, p - buf); - if (level >= 3) - exit(level - 2); - if (level >= 2) - errors++; -} - - - - - -static char* -memcopy __PARAM__((register char* s, register char* t, int n), (s, t, n)) __OTORP__(register char* s; register char* t; int n;){ - register char* e = t + n; - - while (t < e) *s++ = *t++; - return s; -} - -#line 1 "../../lib/libast/port/astlicense.c" - - - -#line 92 -typedef struct Buffer_s -{ - char* buf; - char* nxt; - char* end; - int siz; -} Buffer_t; - -typedef struct Item_s -{ - char* data; - int size; - int quote; -} Item_t; - -typedef struct Id_s -{ - Item_t name; - Item_t value; -} Id_t; - - - - - - - -static const Item_t key[] = -{ - { "author",sizeof( "author")-1,0}, - { "class",sizeof( "class")-1,0}, - { "company",sizeof( "company")-1,0}, - { "component",sizeof( "component")-1,0}, - { "contributor",sizeof( "contributor")-1,0}, - { "corporation",sizeof( "corporation")-1,0}, - { "domain",sizeof( "domain")-1,0}, - { "id",sizeof( "id")-1,0}, - { "incorporation",sizeof( "incorporation")-1,0}, - { "license",sizeof( "license")-1,0}, - { "location",sizeof( "location")-1,0}, - { "name",sizeof( "name")-1,0}, - { "notice",sizeof( "notice")-1,0}, - { "organization",sizeof( "organization")-1,0}, - { "package",sizeof( "package")-1,0}, - { "parent",sizeof( "parent")-1,0}, - { "query",sizeof( "query")-1,0}, - { "since",sizeof( "since")-1,0}, - { "source",sizeof( "source")-1,0}, - { "start",sizeof( "start")-1,0}, - { "type",sizeof( "type")-1,0}, - { "url",sizeof( "url")-1,0}, - { "urlmd5",sizeof( "urlmd5")-1,0}, - { "version",sizeof( "version")-1,0}, - {0} -}; - - - - - -static const Item_t lic[] = -{ - { "none",sizeof( "none")-1, 0}, - { "inline",sizeof( "inline")-1, 12}, - { "test",sizeof( "test")-1, 2}, - { "verbose",sizeof( "verbose")-1, 3}, - { "usage",sizeof( "usage")-1, 4}, - { "open",sizeof( "open")-1, 5}, - { "cpl",sizeof( "cpl")-1, 5}, - { "epl",sizeof( "epl")-1, 5}, - { "bsd",sizeof( "bsd")-1, 5}, - { "zlib",sizeof( "zlib")-1, 5}, - { "mit",sizeof( "mit")-1, 5}, - { "gpl",sizeof( "gpl")-1, 11}, - { "special",sizeof( "special")-1, 12}, - { "nonexclusive",sizeof( "nonexclusive")-1, 12}, - { "noncommercial",sizeof( "noncommercial")-1, 12}, - { "proprietary",sizeof( "proprietary")-1, 15}, - {0} -}; - -typedef struct Notice_s -{ - int test; - int type; - int verbose; - int ids; - Item_t item[(sizeof(key)/sizeof(key[0])-1)]; - Id_t id[64]; - char cc[3]; -} Notice_t; - - - - - -static int -lookup __PARAM__((register const Item_t* item, const char* name, int size), (item, name, size)) __OTORP__(register const Item_t* item; const char* name; int size;){ - register int c; - register int i; - - c = name[0]; - for (i = 0; item[i].data; i++) - if (c == item[i].data[0] && size == item[i].size && !sstrncmp( name, item[i].data, size)) - return i; - return -1; -} - - - - - - -static void -copy __PARAM__((register Buffer_t* b, register char* s, int n), (b, s, n)) __OTORP__(register Buffer_t* b; register char* s; int n;){ - if (n < 0) - n = sstrlen( s); - while (n--) - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( *s++)):(( *s++),(-1))); -} - - -#line 225 -static void -comment __PARAM__((Notice_t* notice, register Buffer_t* b, register char* s, register int n, int u), (notice, b, s, n, u)) __OTORP__(Notice_t* notice; register Buffer_t* b; register char* s; register int n; int u;){ - register int i; - register int m; - register int x; - int cc; - - cc = notice->cc[1]; - if (!s) - { - if (n) - { - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( notice->cc[n > 0 ? 0 : 1])):(( notice->cc[n > 0 ? 0 : 1]),(-1))); - for (i = 0; i < 70; i++) - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( notice->cc[n > 0 ? 1 : 2])):(( notice->cc[n > 0 ? 1 : 2]),(-1))); - } - else - s = ""; - } - if (s) - { - if (n > 70) - n = 70; - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); - m = (u < 0) ? 1 : (70 - n) / 2; - if ((x = 70 - m - n) < 0) - n--; - while (m-- > 0) - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); - while (n-- > 0) - { - i = *s++; - if (u > 0 && i >= 'a' && i <= 'z') - i = i - 'a' + 'A'; - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( i)):(( i),(-1))); - } - while (x-- > 0) - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( cc)):(( cc),(-1))); - } - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( '\n')):(( '\n'),(-1))); -} - - - - - -static void -expand __PARAM__((Notice_t* notice, register Buffer_t* b, const Item_t* item), (notice, b, item)) __OTORP__(Notice_t* notice; register Buffer_t* b; const Item_t* item;){ - register char* t; - register char* e; - register int q; - register char* x; - register char* z; - register int c; - int m; - int i; - int k; - - if (t = item->data) - { - q = item->quote; - e = t + item->size; - i = 0; - while (t < e) - { - if (*t == '$' && t < (e + 2) && *(t + 1) == '{') - { - k = m = 0; - x = t += 2; - while (t < e && (c = *t++) != '}') - if (c == '.') - x = t; - else if (c == '-') - { - k = 1; - break; - } - else if (c == '/') - { - m = 1; - break; - } - if ((c = lookup(key, x, t - x - 1)) >= 0 && (x = notice->item[c].data)) - { - z = x + notice->item[c].size; - while (x < z) - { - c = *x++; - if (!m || c >= '0' && c <= '9') - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( c)):(( c),(-1))); - } - } - else if (k) - { - k = 0; - i++; - } - if (k || m) - { - k = 1; - while (t < e) - if ((c = *t++) == '{') - k++; - else if (c == '}' && !--k) - break; - } - } - else if (q > 0 && *t == '\\' && (*(t + 1) == q || *(t + 1) == '\\')) - t++; - else if (*t == '}' && i) - { - t++; - i--; - } - else - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( *t++)):(( *t++),(-1))); - } - } -} - - - - - -static void -copyright __PARAM__((Notice_t* notice, register Buffer_t* b), (notice, b)) __OTORP__(Notice_t* notice; register Buffer_t* b;){ - register char* x; - register char* t; - time_t clock; - - copy(b, "Copyright (c) ", -1); - if (notice->test) - { - clock = (time_t)1000212300; - t = ctime(&clock) + 20; - } - else if (!(t = notice->item[18].data)) - { - time(&clock); - t = ctime(&clock) + 20; - } - if ((x = notice->item[19].data) && sstrncmp( t, x, 4) < 0) - t = x; - if ((x = notice->item[17].data) && sstrncmp( x, t, 4) < 0) - { - expand(notice, b, ¬ice->item[17]); - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( '-')):(( '-'),(-1))); - } - copy(b, t, 4); - if (notice->item[15].data) - { - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); - expand(notice, b, ¬ice->item[15]); - } - if (notice->item[5].data) - { - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); - expand(notice, b, ¬ice->item[5]); - if (notice->item[8].data) - { - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); - expand(notice, b, ¬ice->item[8]); - } - } - else if (notice->item[2].data) - { - ((( b)->nxt<( b)->end)?(*( b)->nxt++=( ' ')):(( ' '),(-1))); - expand(notice, b, ¬ice->item[2]); - } -} - -typedef struct Stack_s -{ - char* info; - char* file; - int line; - int size; -} Stack_t; - -static int -push __PARAM__((Stack_t* sp, char* file, char* parent, char* info, int size, Buffer_t* buf), (sp, file, parent, info, size, buf)) __OTORP__(Stack_t* sp; char* file; char* parent; char* info; int size; Buffer_t* buf;){ - char* s; - char* t; - int i; - int n; - char path[1024]; - - if (size <= 8) - { - copy(buf, file, -1); - copy(buf, ": no space", -1); - ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); - return -1; - } - if (*file != '/' && parent && (s = strrchr(parent, '/'))) - { - n = s - parent + 1; - if ((sstrlen( file) + n + 1) <= sizeof(path)) - { - memcopy( path, parent, n); - strcopy( path + n, file); - file = path; - } - } - if ((i = open(file, O_RDONLY|0)) < 0) - { - - if (file == path) - for (s = path; *s; s++) - if (s[0] == '/' && s[1] == 'a' && s[2] == 'r' && s[3] == 'c' && s[4] == 'h' && s[5] == '/') - { - t = s; - for (s += 6; *s && *s != '/'; s++); - while (*t++ = *s++); - i = open(file, O_RDONLY|0); - } - if (i < 0) - { - copy(buf, file, -1); - copy(buf, ": cannot open", -1); - ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); - return -1; - } - } - n = read(i, info, size - 1); - close(i); - if (n < 0) - { - copy(buf, file, -1); - copy(buf, ": cannot read", -1); - ((( buf)->nxt<( buf)->end)?(*( buf)->nxt++=( 0)):(( 0),(-1))); - return -1; - } - info[n++] = 0; - sp->file = file; - sp->info = info; - sp->line = 0; - sp->size = n; - return 0; -} - - - - - - - -int -astlicense __PARAM__((char* p, int size, char* file, char* options, int cc1, int cc2, int cc3), (p, size, file, options, cc1, cc2, cc3)) __OTORP__(char* p; int size; char* file; char* options; int cc1; int cc2; int cc3;){ - register char* s; - register char* v; - register char* x; - register int c; - int i; - int h; - int k; - int n; - int q; - int contributor; - int first; - int level; - int quote; - char* data; - char tmpbuf[(70+4)]; - char info[8 * 1024]; - Stack_t input[4]; - Notice_t notice; - Item_t item; - Buffer_t buf; - Buffer_t tmp; - - buf.end = (buf.buf = buf.nxt = p) + size; - tmp.end = (tmp.buf = tmp.nxt = tmpbuf) + sizeof(tmpbuf); - level = 0; - data = info; - level = -1; - if (options) - { - level++; - input[level].file = ""; - input[level].info = options; - input[level].line = 0; - } - if (file && *file) - { - if (push(&input[++level], file, 0, data, &info[sizeof(info)] - data, &buf)) - return -1; - data += input[level].size; - } - if (level < 0) - return 0; - s = input[level].info; - notice.test = 0; - notice.type = 0; - notice.verbose = 0; - notice.ids = 0; - notice.cc[0] = cc1; - notice.cc[1] = cc2; - notice.cc[2] = cc3; - for (i = 0; i < (sizeof(key)/sizeof(key[0])-1); i++) - notice.item[i].data = 0; - notice.item[20] = notice.item[1] = lic[notice.type]; - notice.item[20].quote = notice.item[1].quote = 0; - contributor = i = k = 0; - for (;;) - { - first = 1; - while (c = *s) - { - while (c == ' ' || c == '\t' || c == '\n' && ++input[level].line || c == '\r' || c == ',' || c == ';' || c == ')') - c = *++s; - if (!c) - break; - if (c == '#') - { - while (*++s && *s != '\n'); - if (*s) - s++; - input[level].line++; - continue; - } - if (c == '.') - { - while ((c = *++s) && (c == ' ' || c == '\t')); - file = s; - while (c && c != ' ' && c != '\t' && c != '\r' && c != '\n') - c = *++s; - *s = 0; - while (c && c != '\n') - c = *++s; - if (*file) - { - input[level].info = s + (c != 0); - if (++level >= (sizeof(input) / sizeof(input[0])) || push(&input[level], file, input[level-1].file, data, &info[sizeof(info)] - data, &buf)) - return -1; - data += input[level].size; - s = input[level].info; - } - continue; - } - if (c == '\n') - { - s++; - input[level].line++; - continue; - } - if (c == '[') - c = *++s; - x = s; - n = 0; - while (c && c != '+' && c != '=' && c != ']' && c != ')' && c != ',' && c != ' ' && c != '\t' && c != '\n' && c != '\r') - c = *++s; - n = s - x; - h = lookup(key, x, n); - if (c == '+' || c == ']') - c = *++s; - quote = 0; - if (c == '=' || first) - { - if (c == '=') - { - q = ((c = *++s) == '"' || c == '\'') ? *s++ : 0; - if (c == '(') - { - s++; - if (h == 9) - contributor = 0; - else if (h == 4) - contributor = 1; - else - { - q = 1; - i = 0; - for (;;) - { - switch (*s++) - { - case 0: - s--; - break; - case '(': - if (!i) - q++; - continue; - case ')': - if (!i && !--q) - break; - continue; - case '"': - case '\'': - if (!i) - i = *(s - 1); - else if (i == *(s - 1)) - i = 0; - continue; - case '\\': - if (*s == i && i == '"') - i++; - continue; - case '\n': - input[level].line++; - continue; - default: - continue; - } - break; - } - } - continue; - } - v = s; - while ((c = *s) && (q == '"' && (c == '\\' && (*(s + 1) == '"' || *(s + 1) == '\\') && s++ && (quote = q)) || q && c != q || !q && c != ' ' && c != '\t' && c != '\n' && c != '\r' && c != ',' && c != ';')) - { - if (c == '\n') - input[level].line++; - s++; - } - } - else - { - h = 20; - v = x; - } - if (c == '\n') - input[level].line++; - if (contributor) - { - for (i = 0; i < notice.ids; i++) - if (n == notice.id[i].name.size && !sstrncmp( x, notice.id[i].name.data, n)) - break; - if (i < 64) - { - notice.id[i].name.data = x; - notice.id[i].name.size = n; - notice.id[i].name.quote = 0; - notice.id[i].value.data = v; - notice.id[i].value.size = s - v; - notice.id[i].value.quote = quote; - if (notice.ids <= i) - notice.ids = i + 1; - } - } - else if (h == 16) - { - if ((s - v) == 3 && v[0] == 'a' && v[1] == 'l' && v[2] == 'l') - { - for (i = 0; i < (sizeof(key)/sizeof(key[0])-1); i++) - if (notice.item[i].size) - { - expand(¬ice, &buf, &key[i]); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '=')):(( '='),(-1))); - for (h = 0;; h++) - if (h >= notice.item[i].size) - { - h = 0; - break; - } - else if (notice.item[i].data[h] == ' ' || notice.item[i].data[h] == '\t') - break; - if (h) - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\'')):(( '\''),(-1))); - expand(¬ice, &buf, ¬ice.item[i]); - if (h) - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\'')):(( '\''),(-1))); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); - } - } - else - { - if ((h = lookup(key, v, s - v)) < 0) - { - item.data = v; - item.size = s - v; - item.quote = 0; - expand(¬ice, &buf, &item); - } - else - expand(¬ice, &buf, ¬ice.item[h]); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); - } - return (*(( &buf)->nxt>=( &buf)->end?(( &buf)->nxt=( &buf)->end-1):( &buf)->nxt)=0,( &buf)->nxt-( &buf)->buf); - } - else - { - if (h == 20) - switch (c = lookup(lic, v, s - v)) - { - case 0: - return 0; - case 2: - notice.test = 1; - h = -1; - break; - case 3: - notice.verbose = 1; - h = -1; - break; - case 4: - notice.type = c; - h = -1; - break; - case -1: - c = 12; - - default: - notice.type = c; - notice.item[1].data = lic[lic[c].quote].data; - notice.item[1].size = lic[lic[c].quote].size; - if (notice.item[20].data != lic[0].data) - h = -1; - break; - } - if (h >= 0) - { - notice.item[h].data = (notice.item[h].size = s - v) ? v : (char*)0; - notice.item[h].quote = quote; - k = 1; - } - } - } - else - { - if (input[level].file) - { - copy(&buf, "\"", -1); - copy(&buf, input[level].file, -1); - copy(&buf, "\", line ", -1); - x = &tmpbuf[sizeof(tmpbuf)]; - *--x = 0; - n = ++input[level].line; - do *--x = ("0123456789")[n % 10]; while (n /= 10); - copy(&buf, x, -1); - copy(&buf, ": ", -1); - } - copy(&buf, "option error: assignment expected", -1); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( 0)):(( 0),(-1))); - return -1; - } - if (*s) - s++; - first = 0; - } - if (!level--) - break; - s = input[level].info; - } - if (!k) - return 0; - if (notice.type == 1 && (!notice.verbose || !notice.item[12].data)) - return 0; - if (notice.type != 4) - { - if (!notice.type) - notice.type = 12; - comment(¬ice, &buf, ((char*)0), 1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - if (notice.item[14].data) - { - copy(&tmp, "This software is part of the ", -1); - expand(¬ice, &tmp, ¬ice.item[14]); - copy(&tmp, " package", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - if (notice.type >= 5) - { - copyright(¬ice, &tmp); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.type >= 12) - comment( ¬ice, &buf, "All Rights Reserved",sizeof( "All Rights Reserved")-1, 0); - } - if (notice.type == 6 || notice.type == 7) - { - copy(&tmp, notice.item[14].data ? "and": "This software", -1); - copy(&tmp, " is licensed under the", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.type == 7) - copy(&tmp, "Eclipse Public License", -1); - else - copy(&tmp, "Common Public License", -1); - if (notice.item[23].data) - { - copy(&tmp, ", Version ", -1); - expand(¬ice, &tmp, ¬ice.item[23]); - } - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.item[5].data || notice.item[2].data) - { - copy(&tmp, "by ", -1); - if (notice.item[15].data) - { - expand(¬ice, &tmp, ¬ice.item[15]); - copy(&tmp, " ", -1); - } - if (notice.item[5].data) - { - expand(¬ice, &tmp, ¬ice.item[5]); - if (notice.item[8].data) - { - copy(&tmp, " ", -1); - expand(¬ice, &tmp, ¬ice.item[8]); - } - } - else if (notice.item[2].data) - expand(¬ice, &tmp, ¬ice.item[2]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "A copy of the License is available at",sizeof( "A copy of the License is available at")-1, 0); - if (notice.item[21].data) - { - expand(¬ice, &tmp, ¬ice.item[21]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.item[22].data) - { - copy(&tmp, "(with md5 checksum ", -1); - expand(¬ice, &tmp, ¬ice.item[22]); - copy(&tmp, ")", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - } - else if (notice.type == 7) - comment( ¬ice, &buf, "http://www.eclipse.org/org/documents/epl-v10.html",sizeof( "http://www.eclipse.org/org/documents/epl-v10.html")-1, 0); - else - comment( ¬ice, &buf, "http://www.opensource.org/licenses/cpl",sizeof( "http://www.opensource.org/licenses/cpl")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 5) - { - copy(&tmp, notice.item[14].data ? "and it": "This software", -1); - copy(&tmp, " may only be used by you under license from", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.item[i = 5].data) - { - if (notice.item[15].data) - { - expand(¬ice, &tmp, ¬ice.item[i = 15]); - copy(&tmp, " ", -1); - } - expand(¬ice, &tmp, ¬ice.item[5]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - else if (notice.item[i = 2].data) - { - if (notice.item[15].data) - { - expand(¬ice, &tmp, ¬ice.item[i = 15]); - copy(&tmp, " ", -1); - } - expand(¬ice, &tmp, ¬ice.item[2]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - else - i = -1; - if (notice.item[21].data) - { - comment( ¬ice, &buf, "A copy of the Source Code Agreement is available",sizeof( "A copy of the Source Code Agreement is available")-1, 0); - copy(&tmp, "at the ", -1); - if (i >= 0) - expand(¬ice, &tmp, ¬ice.item[i]); - copy(&tmp, " Internet web site URL", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - expand(¬ice, &tmp, ¬ice.item[21]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.item[22].data) - { - copy(&tmp, "(with an md5 checksum of ", -1); - expand(¬ice, &tmp, ¬ice.item[22]); - copy(&tmp, ")", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - comment(¬ice, &buf, ((char*)0), 0, 0); - } - comment( ¬ice, &buf, "If you have copied or used this software without agreeing",sizeof( "If you have copied or used this software without agreeing")-1, 0); - comment( ¬ice, &buf, "to the terms of the license you are infringing on",sizeof( "to the terms of the license you are infringing on")-1, 0); - comment( ¬ice, &buf, "the license and copyright and are violating",sizeof( "the license and copyright and are violating")-1, 0); - if (i >= 0) - expand(¬ice, &tmp, ¬ice.item[i]); - copy(&tmp, "'s", -1); - if (n >= (70-32)) - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - else - ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); - copy(&tmp, "intellectual property rights.", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 11) - { - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "This is free software; you can redistribute it and/or",sizeof( "This is free software; you can redistribute it and/or")-1, 0); - comment( ¬ice, &buf, "modify it under the terms of the GNU General Public License",sizeof( "modify it under the terms of the GNU General Public License")-1, 0); - comment( ¬ice, &buf, "as published by the Free Software Foundation;",sizeof( "as published by the Free Software Foundation;")-1, 0); - comment( ¬ice, &buf, "either version 2, or (at your option) any later version.",sizeof( "either version 2, or (at your option) any later version.")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "This software is distributed in the hope that it",sizeof( "This software is distributed in the hope that it")-1, 0); - comment( ¬ice, &buf, "will be useful, but WITHOUT ANY WARRANTY;",sizeof( "will be useful, but WITHOUT ANY WARRANTY;")-1, 0); - comment( ¬ice, &buf, "without even the implied warranty of MERCHANTABILITY",sizeof( "without even the implied warranty of MERCHANTABILITY")-1, 0); - comment( ¬ice, &buf, "or FITNESS FOR A PARTICULAR PURPOSE.",sizeof( "or FITNESS FOR A PARTICULAR PURPOSE.")-1, 0); - comment( ¬ice, &buf, "See the GNU General Public License for more details.",sizeof( "See the GNU General Public License for more details.")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "You should have received a copy of the",sizeof( "You should have received a copy of the")-1, 0); - comment( ¬ice, &buf, "GNU General Public License",sizeof( "GNU General Public License")-1, 0); - comment( ¬ice, &buf, "along with this software (see the file COPYING.)",sizeof( "along with this software (see the file COPYING.)")-1, 0); - comment( ¬ice, &buf, "If not, a copy is available at",sizeof( "If not, a copy is available at")-1, 0); - comment( ¬ice, &buf, "http://www.gnu.org/copyleft/gpl.html",sizeof( "http://www.gnu.org/copyleft/gpl.html")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 8) - { - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "Redistribution and use in source and binary forms, with or",sizeof( "Redistribution and use in source and binary forms, with or")-1, -1); - comment( ¬ice, &buf, "without modification, are permitted provided that the following",sizeof( "without modification, are permitted provided that the following")-1, -1); - comment( ¬ice, &buf, "conditions are met:",sizeof( "conditions are met:")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, " 1. Redistributions of source code must retain the above",sizeof( " 1. Redistributions of source code must retain the above")-1, -1); - comment( ¬ice, &buf, " copyright notice, this list of conditions and the",sizeof( " copyright notice, this list of conditions and the")-1, -1); - comment( ¬ice, &buf, " following disclaimer.",sizeof( " following disclaimer.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, " 2. Redistributions in binary form must reproduce the above",sizeof( " 2. Redistributions in binary form must reproduce the above")-1, -1); - comment( ¬ice, &buf, " copyright notice, this list of conditions and the",sizeof( " copyright notice, this list of conditions and the")-1, -1); - comment( ¬ice, &buf, " following disclaimer in the documentation and/or other",sizeof( " following disclaimer in the documentation and/or other")-1, -1); - comment( ¬ice, &buf, " materials provided with the distribution.",sizeof( " materials provided with the distribution.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - copy(&tmp, " 3. Neither the name of ", -1); - if (notice.item[i = 15].data || notice.item[i = 5].data || notice.item[i = 2].data) - expand(¬ice, &tmp, ¬ice.item[i]); - else - copy(&tmp, "the copyright holder", -1); - copy(&tmp, " nor the", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), -1); - comment( ¬ice, &buf, " names of its contributors may be used to endorse or",sizeof( " names of its contributors may be used to endorse or")-1, -1); - comment( ¬ice, &buf, " promote products derived from this software without",sizeof( " promote products derived from this software without")-1, -1); - comment( ¬ice, &buf, " specific prior written permission.",sizeof( " specific prior written permission.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND",sizeof( "THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND")-1, -1); - comment( ¬ice, &buf, "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,",sizeof( "CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,")-1, -1); - comment( ¬ice, &buf, "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF",sizeof( "INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF")-1, -1); - comment( ¬ice, &buf, "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE",sizeof( "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE")-1, -1); - comment( ¬ice, &buf, "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS",sizeof( "DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS")-1, -1); - comment( ¬ice, &buf, "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,",sizeof( "BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,")-1, -1); - comment( ¬ice, &buf, "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED",sizeof( "EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED")-1, -1); - comment( ¬ice, &buf, "TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,",sizeof( "TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,")-1, -1); - comment( ¬ice, &buf, "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON",sizeof( "DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON")-1, -1); - comment( ¬ice, &buf, "ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,",sizeof( "ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,")-1, -1); - comment( ¬ice, &buf, "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY",sizeof( "OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY")-1, -1); - comment( ¬ice, &buf, "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE",sizeof( "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE")-1, -1); - comment( ¬ice, &buf, "POSSIBILITY OF SUCH DAMAGE.",sizeof( "POSSIBILITY OF SUCH DAMAGE.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 9) - { - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "This software is provided 'as-is', without any express or implied",sizeof( "This software is provided 'as-is', without any express or implied")-1, -1); - comment( ¬ice, &buf, "warranty. In no event will the authors be held liable for any",sizeof( "warranty. In no event will the authors be held liable for any")-1, -1); - comment( ¬ice, &buf, "damages arising from the use of this software.",sizeof( "damages arising from the use of this software.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "Permission is granted to anyone to use this software for any",sizeof( "Permission is granted to anyone to use this software for any")-1, -1); - comment( ¬ice, &buf, "purpose, including commercial applications, and to alter it and",sizeof( "purpose, including commercial applications, and to alter it and")-1, -1); - comment( ¬ice, &buf, "redistribute it freely, subject to the following restrictions:",sizeof( "redistribute it freely, subject to the following restrictions:")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, " 1. The origin of this software must not be misrepresented;",sizeof( " 1. The origin of this software must not be misrepresented;")-1, -1); - comment( ¬ice, &buf, " you must not claim that you wrote the original software. If",sizeof( " you must not claim that you wrote the original software. If")-1, -1); - comment( ¬ice, &buf, " you use this software in a product, an acknowledgment in the",sizeof( " you use this software in a product, an acknowledgment in the")-1, -1); - comment( ¬ice, &buf, " product documentation would be appreciated but is not",sizeof( " product documentation would be appreciated but is not")-1, -1); - comment( ¬ice, &buf, " required.",sizeof( " required.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, " 2. Altered source versions must be plainly marked as such,",sizeof( " 2. Altered source versions must be plainly marked as such,")-1, -1); - comment( ¬ice, &buf, " and must not be misrepresented as being the original",sizeof( " and must not be misrepresented as being the original")-1, -1); - comment( ¬ice, &buf, " software.",sizeof( " software.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, " 3. This notice may not be removed or altered from any source",sizeof( " 3. This notice may not be removed or altered from any source")-1, -1); - comment( ¬ice, &buf, " distribution.",sizeof( " distribution.")-1, -1); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 10) - { - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "Permission is hereby granted, free of charge, to any person",sizeof( "Permission is hereby granted, free of charge, to any person")-1, 0); - comment( ¬ice, &buf, "obtaining a copy of this software and associated",sizeof( "obtaining a copy of this software and associated")-1, 0); - comment( ¬ice, &buf, "documentation files (the \"Software\"), to deal in the",sizeof( "documentation files (the \"Software\"), to deal in the")-1, 0); - comment( ¬ice, &buf, "Software without restriction, including without limitation",sizeof( "Software without restriction, including without limitation")-1, 0); - comment( ¬ice, &buf, "the rights to use, copy, modify, merge, publish, distribute,",sizeof( "the rights to use, copy, modify, merge, publish, distribute,")-1, 0); - comment( ¬ice, &buf, "sublicense, and/or sell copies of the Software, and to",sizeof( "sublicense, and/or sell copies of the Software, and to")-1, 0); - comment( ¬ice, &buf, "permit persons to whom the Software is furnished to do so,",sizeof( "permit persons to whom the Software is furnished to do so,")-1, 0); - comment( ¬ice, &buf, "subject to the following conditions:",sizeof( "subject to the following conditions:")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "The above copyright notice and this permission notice shall",sizeof( "The above copyright notice and this permission notice shall")-1, 0); - comment( ¬ice, &buf, "be included in all copies or substantial portions of the",sizeof( "be included in all copies or substantial portions of the")-1, 0); - comment( ¬ice, &buf, "Software.",sizeof( "Software.")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - comment( ¬ice, &buf, "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY",sizeof( "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY")-1, 0); - comment( ¬ice, &buf, "KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE",sizeof( "KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE")-1, 0); - comment( ¬ice, &buf, "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR",sizeof( "WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR")-1, 0); - comment( ¬ice, &buf, "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS",sizeof( "PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS")-1, 0); - comment( ¬ice, &buf, "OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR",sizeof( "OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR")-1, 0); - comment( ¬ice, &buf, "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR",sizeof( "OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR")-1, 0); - comment( ¬ice, &buf, "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE",sizeof( "OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE")-1, 0); - comment( ¬ice, &buf, "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",sizeof( "SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else - { - if (notice.type == 15) - { - if (notice.item[i = 15].data || notice.item[i = 5].data || notice.item[i = 2].data) - { - expand(¬ice, &tmp, ¬ice.item[i]); - copy(&tmp, " - ", -1); - } - else - i = -1; - copy(&tmp, "Proprietary", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); - comment(¬ice, &buf, ((char*)0), 0, 0); - if (notice.item[21].data) - { - copy(&tmp, "This is proprietary source code", -1); - if (i >= 0) - copy(&tmp, " licensed by", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); - if (notice.item[15].data) - { - expand(¬ice, &tmp, ¬ice.item[15]); - copy(&tmp, " ", -1); - } - if (notice.item[5].data) - { - expand(¬ice, &tmp, ¬ice.item[5]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); - } - else if (notice.item[2].data) - { - expand(¬ice, &tmp, ¬ice.item[2]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); - } - } - else - { - copy(&tmp, "This is unpublished proprietary source code", -1); - if (i >= 0) - copy(&tmp, " of", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); - if (notice.item[i = 15].data || notice.item[i = 5].data) - expand(¬ice, &tmp, ¬ice.item[i]); - if (notice.item[2].data) - { - if ((( &tmp)->nxt-( &tmp)->buf)) - ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); - expand(¬ice, &tmp, ¬ice.item[2]); - } - if ((( &tmp)->nxt-( &tmp)->buf)) - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 1); - comment( ¬ice, &buf, "and is not to be disclosed or used except in",sizeof( "and is not to be disclosed or used except in")-1, 1); - comment( ¬ice, &buf, "accordance with applicable agreements",sizeof( "accordance with applicable agreements")-1, 1); - } - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 13) - { - comment( ¬ice, &buf, "For nonexclusive individual use",sizeof( "For nonexclusive individual use")-1, 1); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 14) - { - comment( ¬ice, &buf, "For noncommercial use",sizeof( "For noncommercial use")-1, 1); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - if (notice.type >= 15 && !notice.item[21].data) - { - comment( ¬ice, &buf, "Unpublished & Not for Publication",sizeof( "Unpublished & Not for Publication")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - if (notice.item[21].data) - { - copy(&tmp, "This software is licensed", -1); - if (notice.item[5].data || notice.item[2].data) - { - copy(&tmp, " by", -1); - if ((notice.item[15].size + (notice.item[5].data ? (notice.item[5].size + notice.item[8].size) : notice.item[2].size)) >= ((70-32) - 6)) - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - else - ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); - if (notice.item[15].data) - { - expand(¬ice, &tmp, ¬ice.item[15]); - copy(&tmp, " ", -1); - } - if (notice.item[5].data) - { - expand(¬ice, &tmp, ¬ice.item[5]); - if (notice.item[8].data) - { - copy(&tmp, " ", -1); - expand(¬ice, &tmp, ¬ice.item[8]); - } - } - else if (notice.item[2].data) - expand(¬ice, &tmp, ¬ice.item[2]); - } - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - comment( ¬ice, &buf, "under the terms and conditions of the license in",sizeof( "under the terms and conditions of the license in")-1, 0); - expand(¬ice, &tmp, ¬ice.item[21]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.item[22].data) - { - copy(&tmp, "(with an md5 checksum of ", -1); - expand(¬ice, &tmp, ¬ice.item[22]); - copy(&tmp, ")", -1); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - comment(¬ice, &buf, ((char*)0), 0, 0); - } - else if (notice.type == 15) - { - comment( ¬ice, &buf, "The copyright notice above does not evidence any",sizeof( "The copyright notice above does not evidence any")-1, 0); - comment( ¬ice, &buf, "actual or intended publication of such source code",sizeof( "actual or intended publication of such source code")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - } - if (v = notice.item[12].data) - { - x = v + notice.item[12].size; - if (*v == '\n') - v++; - item.quote = notice.item[12].quote; - do - { - for (item.data = v; v < x && *v != '\n'; v++); - if ((item.size = v - item.data) && *item.data == '\t') - { - item.data++; - item.size--; - h = 0; - } - else - h = -1; - expand(¬ice, &tmp, &item); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), h); - } while (v++ < x); - if (item.size) - comment(¬ice, &buf, ((char*)0), 0, 0); - } - if (notice.item[13].data) - { - expand(¬ice, &tmp, ¬ice.item[13]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.item[i = 15].data || notice.item[i = 5].data) - expand(¬ice, &tmp, ¬ice.item[i]); - if (notice.item[2].data) - { - if ((( &tmp)->nxt-( &tmp)->buf)) - ((( &tmp)->nxt<( &tmp)->end)?(*( &tmp)->nxt++=( ' ')):(( ' '),(-1))); - expand(¬ice, &tmp, ¬ice.item[2]); - } - if ((( &tmp)->nxt-( &tmp)->buf)) - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - if (notice.item[10].data) - { - expand(¬ice, &tmp, ¬ice.item[10]); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - comment(¬ice, &buf, ((char*)0), 0, 0); - } - } - if (v = notice.item[0].data) - { - x = v + notice.item[0].size; - q = (x - v) == 1 && (*v == '*' || *v == '-'); - k = q && notice.type != 4 ? -1 : 0; - for (;;) - { - if (!q) - { - while (v < x && (*v == ' ' || *v == '\t' || *v == '\r' || *v == '\n' || *v == ',' || *v == '+')) - v++; - if (v >= x) - break; - item.data = v; - while (v < x && *v != ',' && *v != '+' && *v++ != '>'); - item.size = v - item.data; - item.quote = notice.item[0].quote; - } - h = 0; - for (i = 0; i < notice.ids; i++) - if (q || item.size == notice.id[i].name.size && !sstrncmp( item.data, notice.id[i].name.data, item.size)) - { - h = 1; - if (notice.type == 4) - { - copy(&buf, "[-author?", -1); - expand(¬ice, &buf, ¬ice.id[i].value); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); - } - else - { - if (k < 0) - { - comment( ¬ice, &buf, "CONTRIBUTORS",sizeof( "CONTRIBUTORS")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - k = 1; - expand(¬ice, &tmp, ¬ice.id[i].value); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - if (!q) - break; - } - if (q) - break; - if (!h) - { - if (notice.type == 4) - { - copy(&buf, "[-author?", -1); - expand(¬ice, &buf, &item); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); - } - else - { - if (k < 0) - { - comment( ¬ice, &buf, "CONTRIBUTORS",sizeof( "CONTRIBUTORS")-1, 0); - comment(¬ice, &buf, ((char*)0), 0, 0); - } - k = 1; - expand(¬ice, &tmp, &item); - comment(¬ice, &buf, (( &tmp)->buf), (( &tmp)->siz=( &tmp)->nxt-( &tmp)->buf,( &tmp)->nxt=( &tmp)->buf,( &tmp)->siz), 0); - } - } - } - if (k > 0) - comment(¬ice, &buf, ((char*)0), 0, 0); - } - if (notice.type == 4) - { - copy(&buf, "[-copyright?", -1); - copyright(¬ice, &buf); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); - if (notice.item[21].data) - { - copy(&buf, "[-license?", -1); - expand(¬ice, &buf, ¬ice.item[21]); - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( ']')):(( ']'),(-1))); - } - ((( &buf)->nxt<( &buf)->end)?(*( &buf)->nxt++=( '\n')):(( '\n'),(-1))); - } - else - comment(¬ice, &buf, ((char*)0), -1, 0); - return (*(( &buf)->nxt>=( &buf)->end?(( &buf)->nxt=( &buf)->end-1):( &buf)->nxt)=0,( &buf)->nxt-( &buf)->buf); -} -#line 336 "../../lib/libpp/ppproto.c" - -#line 348 -static char* -linesync __PARAM__((register Proto_t* proto, register char* p, register long n), (proto, p, n)) __OTORP__(register Proto_t* proto; register char* p; register long n;){ - - if (proto->flags & (1L<<13)) - - { - - p = strcopy(p, "\n#line "); - - - - p = number(p, n); - *p++ = '\n'; - } - return p; -} - - - - - - -static char* -init __PARAM__((Proto_t* proto, char* op, int flags), (proto, op, flags)) __OTORP__(Proto_t* proto; char* op; int flags;){ - register char* s; - - if (flags & (1L<<10)) - { - op = strcopy(op, "\ -\n\ -#if !defined(__PROTO__)\n\ -# if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)\n\ -# if defined(__cplusplus)\n\ -# define __LINKAGE__ \"C\"\n\ -# else\n\ -# define __LINKAGE__\n\ -# endif\n\ -# define __STDARG__\n\ -# define __PROTO__(x) x\n\ -# define __OTORP__(x)\n\ -# define __PARAM__(n,o) n\n\ -# if !defined(__STDC__) && !defined(__cplusplus)\n\ -# if !defined(c_plusplus)\n\ -# define const\n\ -# endif\n\ -# define signed\n\ -# define void int\n\ -# define volatile\n\ -# define __V_ char\n\ -# else\n\ -# define __V_ void\n\ -# endif\n\ -# else\n\ -# define __PROTO__(x) ()\n\ -# define __OTORP__(x) x\n\ -# define __PARAM__(n,o) o\n\ -# define __LINKAGE__\n\ -# define __V_ char\n\ -# define const\n\ -# define signed\n\ -# define void int\n\ -# define volatile\n\ -# endif\n\ -# define __MANGLE__ __LINKAGE__\n\ -# if defined(__cplusplus) || defined(c_plusplus)\n\ -# define __VARARG__ ...\n\ -# else\n\ -# define __VARARG__\n\ -# endif\n\ -# if defined(__STDARG__)\n\ -# define __VA_START__(p,a) va_start(p,a)\n\ -# else\n\ -# define __VA_START__(p,a) va_start(p)\n\ -# endif\n\ -# if !defined(__INLINE__)\n\ -# if defined(__cplusplus)\n\ -# define __INLINE__ extern __MANGLE__ inline\n\ -# else\n\ -# if defined(_WIN32) && !defined(__GNUC__)\n\ -# define __INLINE__ __inline\n\ -# endif\n\ -# endif\n\ -# endif\n\ -#endif\n\ -#if !defined(__LINKAGE__)\n\ -#define __LINKAGE__ /* 2004-08-11 transition */\n\ -#endif\n\ -"); - } - else - op = strcopy(op, "\ -\n\ -#if !defined(__PROTO__)\n\ -#include \n\ -#endif\n\ -#if !defined(__LINKAGE__)\n\ -#define __LINKAGE__ /* 2004-08-11 transition */\n\ -#endif\n\ -"); - if (proto->package) - { - s = "\ -#ifndef __MANGLE_%_DATA__\n\ -# ifdef _BLD_%\n\ -# ifdef __EXPORT__\n\ -# define __MANGLE_%_DATA__ __MANGLE__ __EXPORT__\n\ -# else\n\ -# define __MANGLE_%_DATA__ __MANGLE__\n\ -# endif\n\ -# define __MANGLE_%_FUNC__ __MANGLE__\n\ -# else\n\ -# ifdef __IMPORT__\n\ -# define __MANGLE_%_DATA__ __MANGLE__ __IMPORT__\n\ -# else\n\ -# define __MANGLE_%_DATA__ __MANGLE__\n\ -# endif\n\ -# define __MANGLE_%_FUNC__ __MANGLE__\n\ -# endif\n\ -#endif\n\ -"; - for (;;) - { - switch (*op++ = *s++) - { - case 0: - op--; - break; - case '%': - op = strcopy(op - 1, proto->package); - continue; - default: - continue; - } - break; - } - } - return op; -} - - -#line 422 -static char* -nns __PARAM__((register char* s), (s)) __OTORP__(register char* s;){ - while (*s == ' ' || *s == '\t' || *s == '\n') - s++; - return s; -} - - -#line 439 -static int -directive __PARAM__((register char* s, int dir), (s, dir)) __OTORP__(register char* s; int dir;){ - switch (*(s = nns(s))) - { - case 'e': - case 'i': - dir <<= 2; - switch (*++s) - { - case 'f': - dir |= 01; - break; - case 'l': - dir |= 02; - break; - case 'n': - dir |= 03; - break; - } - break; - } - return dir; -} - - - - - - - -static int -lex __PARAM__((register Proto_t* proto, register long flags), (proto, flags)) __OTORP__(register Proto_t* proto; register long flags;){ - register char* ip; - register char* op; - register int c; - register int state; - register short* rp; - char* m; - char* e; - char* t; - char* bp; - char* v; - char* im; - char* ko; - char* aom; - int n; - int line; - int quot; - int brack; - int sub; - int x; - int vc; - - char* ie = 0; - char* om = 0; - char* aim = 0; - char* aie = 0; - char* func = 0; - int call = 0; - int dir = 0; - int group = 0; - int last = 0; - int paren = 0; - - char* qe = 0; - int qn = 0; - int args = 0; - - - do{(ip=proto->ip);(op=proto->op);call=proto->call;}while(0); - - if (flags & (1L<<5)) (ko=op); - - fsm_start: - proto->tp = ip; - state = 0; - bp = ip; - do - { - rp = _pp_fsmtab[state]; - fsm_get: - while (!(state = rp[c = (*(unsigned char*)ip++)])); - fsm_next: - ; - } while (state > 0); - if ((n = ip - bp - 1) > 0) - { - ip = bp; - do switch( n) { default : memcopy( op, ip, n); op += n; ip += n; break; case 7 : * op++ = * ip++; case 6 : * op++ = * ip++; case 5 : * op++ = * ip++; case 4 : * op++ = * ip++; case 3 : * op++ = * ip++; case 2 : * op++ = * ip++; case 1 : * op++ = * ip++; case 0 : break; } while (0); - ip++; - } - state = ~state; - fsm_terminal: - switch ((( state)&((1<<(7+1))-1))) - { - case ((0+28)+11): - if (op > proto->ob && *(op - 1) == '=' && (op == proto->ob + 1 || *(op - 2) != '=')) switch (c) - { - case '+': - case '-': - case '*': - case '&': - (*op++=( ' ')); - break; - } - (*op++=( c)); - break; - - case ((0+28)+0): - (ip--); - c = (*(op-1)); - break; - - case ((0+28)+1): - switch (c) - { - case '\n': - if ((( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)])) goto fsm_newline; - (*op++=( c)); - proto->line++; - rp = _pp_fsmtab[(0+13)]; - break; - case '/': - - if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) (op=ko); - else - - (*op++=( c)); - if ((( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)])) - { - rp = _pp_fsmtab[(0+16)]; - break; - } - goto fsm_start; - case (255+1): - break; - default: - - if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) (op=ko); - else - - (*op++=( c)); - rp = _pp_fsmtab[(( rp)>=_pp_fsmtab[(0+16)]&&( rp)<=_pp_fsmtab[(0+18)]) ? (0+16) : (0+14)]; - break; - } - bp = ip; - goto fsm_get; - - case ((0+28)+2): - if (c) - { - if (state = _pp_fsmtab[(0+28)][((( rp)-_pp_fsmtab[0])/(255+1))+1]) - goto fsm_terminal; - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - return 0; - } - (ip--); - fsm_eob: - if ((flags & ((1L<<1)|((1L<<16))|(1L<<21))) == ((1L<<16)) && (proto->flags & (1L<<16))) - { - - if (!(flags & (1L<<5))) - - flags |= (1L<<24); - c = ip - proto->ib; - if (!(flags & (1L<<15))) - im = proto->tp; - if (ip > proto->ib) - { - n = ip - im; - if (ip - n < proto->ib) - proto->flags |= (1L<<4); - memcopy(proto->ib - n, ip - n, n); - ip = proto->ib; - } - proto->tp -= c; - if (flags & (1L<<15)) - { - im -= c; - ie -= c; - } - if (aim) - aim -= c; - if (aie) - aie -= c; - if ((n = read(proto->fd, ip, proto->iz)) > 0) - { - if ((proto->options & (1L<<0)) && n < proto->iz) - { - proto->flags &= ~(1L<<16); - close(proto->fd); - } - *(ip + n) = 0; - if (state & (1<<7)) - goto fsm_splice; - bp = ip; - goto fsm_get; - } - *ip = 0; - proto->flags &= ~(1L<<16); - close(proto->fd); - } - if (state & (1<<7)) - goto fsm_splice; - - if (!(flags & (1L<<21)) && (state = rp[c = (255+1)])) - { - bp = ip; - goto fsm_next; - } - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - return 0; - - case ((0+28)+3): - quot = c; - - if (c == '"' && qe) - { - for (n = 0, t = qe + 1; t < op && (*t == ' ' || *t == '\t' || *t == '\n' && ++n || *t >= 'A' && *t <= 'Z' || *t == '_'); t++); - if (t == op) - { - op = qe; - qe = 0; - qn = n; - } - else (*op++=( c)); - } - else - - (*op++=( c)); - rp = _pp_fsmtab[(0+21)]; - bp = ip; - goto fsm_get; - - case ((0+28)+4): - if (c == quot) - { - - if (!(flags & (1L<<3))) - qe = (c == '"') ? op : (char*)0; - - (*op++=( c)); - - while (qn > 0) - { - qn--; - (*op++=( '\n')); - } - - } - else if (c != '\n' && c != (255+1)) - { - (*op++=( c)); - bp = ip; - goto fsm_get; - } - else - { - - while (qn > 0) - { - qn--; - (*op++=( '\n')); - } - - (ip--); - } - c = (0401+1); - break; - - case ((0+28)+5): - - if (flags & (1L<<0)) (*op++=( c)); - else - - switch (c) - { - case 'a': - n = (('A'==0301)?0057:0007); - goto fsm_oct; - case 'E': - n = (('A'==0301)?0047:0033); - goto fsm_oct; - case 'v': - n = 0013; - goto fsm_oct; - case 'x': - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - lex(proto, (flags & ((1L<<16))) | (1L<<21)); - for (n = x = 0; (c = (*(unsigned char*)ip++)), x < 3; x++) switch (c) - { - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - case '8': case '9': - n = (n << 4) + c - '0'; - break; - case 'a': case 'b': case 'c': case 'd': - case 'e': case 'f': - n = (n << 4) + c - 'a' + 10; - break; - case 'A': case 'B': case 'C': case 'D': - case 'E': case 'F': - n = (n << 4) + c - 'A' + 10; - break; - default: - goto fsm_hex; - } - fsm_hex: - (ip--); - fsm_oct: - (*op++=( ((n >> 6) & 07) + '0')); - (*op++=( ((n >> 3) & 07) + '0')); - (*op++=( (n & 07) + '0')); - break; - default: - (*op++=( c)); - break; - } - rp = _pp_fsmtab[(0+21)]; - bp = ip; - goto fsm_get; - - case ((0+28)+6): - (ip--); - - if ((flags & (1L<<5)) && *proto->tp == 's' && !sstrncmp( proto->tp, "static", 6)) - { - c = ((0500+4)+9); - break; - } - - if (*proto->tp == '_' && !sstrncmp( proto->tp, "__STDPP__directive", 6)) c = '#'; - else c = (0401+0); - - break; - - case ((0+28)+7): - fsm_newline: - proto->line++; - - if (flags & (1L<<5)) - { - if (op != proto->ob && (*(op-1)) != ' ' && (*(op-1)) != '\n') - (*op++=( ' ')); - } - else - - (*op++=( c)); - if (flags & (1L<<3)) - { - - if (flags & (1L<<0)) - { - if (flags & (1L<<5)) (op=ko); - if (flags & (1L<<12)) - { - *(ip - 1) = 0; - op = strcopy(om, "/* "); - op = strcopy(op, im); - op = strcopy(op, " */\n"); - } - flags &= ~((1L<<2)|(1L<<3)|(1L<<7)|(1L<<8)|(1L<<12)|(1L<<15)|(1L<<22)|(1L<<26)); - } - else - - { - if ((flags & ((1L<<2)|(1L<<22))) == ((1L<<2)|(1L<<22))) - { - *(ip - 1) = 0; - op = strcopy(om, "#if defined(__STDC__) || defined(__STDPP__)\n"); - op = strcopy(op, im); - op = strcopy(op, "\n#else\n"); - bp = ip; - ip = im; - *op++ = *ip++; - while (*op = *ip++) - if (*op++ == '#' && *ip != '(') - { - op--; - while (*--op == ' ' || *op == '\t'); - if (*ip == '#') - { - op = strcopy(op + 1, "/**/"); - while (*++ip == ' ' || *ip == '\t'); - } - else - { - if (*op != '"') *++op = '"'; - op++; - while (*ip == ' ' || *ip == '\t') ip++; - while ((c = *ip) >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c == '_') *op++ = *ip++; - while (*ip == ' ' || *ip == '\t') ip++; - if (*ip == '"') ip++; - else *op++ = '"'; - } - } - ip = bp; - op = strcopy(op, "\n#endif\n"); - op = linesync(proto, op, proto->line); - } - flags &= ~((1L<<2)|(1L<<3)|(1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<22)|(1L<<23)|(1L<<25)|(1L<<26)); - } - call = 0; - group = 0; - paren = 0; - last = '\n'; - } - if (paren == 0 && (flags & ((1L<<15)|(1L<<21)|(1L<<23)|(1L<<24))) == (1L<<24)) - { - - if (flags & (1L<<5)) (op=ko); - - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - return 0; - } - goto fsm_start; - - case ((0+28)+8): - (*op++=( c)); - rp = _pp_fsmtab[((( state)>>(7+1))&((1<<7)-1))]; - bp = ip; - goto fsm_get; - - case ((0+28)+13): - (*op++=( c)); - c = (((( state)>>(7+1))&((1<<7)-1))+0401); - break; - - case ((0+28)+14): - (ip--); - c = (((( state)>>(7+1))&((1<<7)-1))+0401); - break; - - case (((0+28)+12)): - (ip--); - c = (0401+0); - if (!(flags & (1L<<1))) switch (((((long)( *proto->tp))<<16)|(((long)( *(ip - 1)))<<8)|((long)( ip - proto->tp)))) - { - case ((((long)( 'N'))<<16)|(((long)( 'N'))<<8)|((long)( 3))): - if (proto->tp[1] == 'o') - c = ((0500+4)+6); - break; - case ((((long)( 'd'))<<16)|(((long)( 'o'))<<8)|((long)( 2))): - c = ((0500+4)+6); - break; - case ((((long)( 'e'))<<16)|(((long)( 'e'))<<8)|((long)( 4))): - if (!(flags & (1L<<21)) && (flags & ((1L<<3)|(1L<<25))) != (1L<<3) && !sstrncmp( proto->tp, "else", 4)) - { - c = ((0500+4)+8); - goto fsm_id; - } - break; - case ((((long)( 'e'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): - if (!sstrncmp( proto->tp, "extern", 6)) - c = ((0500+4)+9); - break; - case ((((long)( 'f'))<<16)|(((long)( 'r'))<<8)|((long)( 3))): - if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "for", 3)) - { - c = ((0500+4)+11); - goto fsm_id; - } - break; - case ((((long)( 'i'))<<16)|(((long)( 'f'))<<8)|((long)( 2))): - c = ((0500+4)+13); - break; - case ((((long)( 'i'))<<16)|(((long)( 'e'))<<8)|((long)( 6))): - if (!sstrncmp( proto->tp, "inline", 6) && !(flags & ((1L<<15)|(1L<<23)|(1L<<25)|(1L<<26))) && proto->brace == 0 && paren == 0 && group == 0 && (last == ';' || last == '}' || last == '\n' || last == 0)) - { - flags |= (1L<<23); - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - line = proto->line; - op = strcopy(op - 6, "__INLINE__"); - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - } - break; - case ((((long)( 'r'))<<16)|(((long)( 'n'))<<8)|((long)( 6))): - if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "return", 6)) - { - c = ((0500+4)+17); - goto fsm_id; - } - break; - case ((((long)( 's'))<<16)|(((long)( 'c'))<<8)|((long)( 6))): - if ((proto->options & (1L<<6)) && !sstrncmp( proto->tp, "static", 6)) - { - proto->ox = op - 6; - flags |= (1L<<6); - } - break; - case ((((long)( 't'))<<16)|(((long)( 'f'))<<8)|((long)( 7))): - if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "typedef", 7)) - { - flags |= (1L<<26); - c = ((0500+4)+9); - } - break; - case ((((long)( 'v'))<<16)|(((long)( 't'))<<8)|((long)( 8))): - if (*ip == '(' && !sstrncmp( proto->tp, "va_start", 8)) c = (0500+1); - break; - case ((((long)( 'v'))<<16)|(((long)( 'd'))<<8)|((long)( 4))): - if (!sstrncmp( proto->tp, "void", 4)) - { - if (flags & ((1L<<0)|(1L<<19)|(1L<<10)|(1L<<11))) c = ((0500+4)+30); - else - { - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - line = proto->line; - if (lex(proto, (flags & ((1L<<16))) | (1L<<21)) == '*') - { - memcopy(op - 4, "__V_", 4); - memcopy(ip - 4, "__V_", 4); - } - else c = ((0500+4)+30); - proto->line = line; - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - bp = ip; - } - } - break; - case ((((long)( 'w'))<<16)|(((long)( 'e'))<<8)|((long)( 5))): - if (!(flags & (1L<<21)) && !sstrncmp( proto->tp, "while", 5)) - { - c = ((0500+4)+26); - goto fsm_id; - } - break; - } - - if ((flags & (1L<<0)) && c != ((0500+4)+9)) - c = (0401+0); - - break; - - case ((0+28)+10): - goto fsm_start; - - case ((0+28)+15): - (ip--); - - if ((flags & ((1L<<5)|(1L<<15))) == (1L<<5)) - { - while (op > proto->ob && (*(op - 1) == ' ' || *(op - 1) == '\t')) - op--; - if (op > proto->ob && *(op - 1) != '\n') *op++ = ' '; - } - - goto fsm_start; - - default: - if (state & (1<<7)) - { - if (c == '\\') - { - if (!(n = (*(unsigned char*)ip++))) - { - goto fsm_eob; - fsm_splice: - c = '\\'; - n = (*(unsigned char*)ip++); - } - if (n == '\n') - { - proto->line++; - (*op++=( '\\')); - (*op++=( '\n')); - bp = ip; - goto fsm_get; - } - (ip--); - } - state &= ~(1<<7); - if (state >= (0+28)) - goto fsm_terminal; - rp = _pp_fsmtab[state]; - } - (*op++=( c)); - bp = ip; - goto fsm_get; - } - if (!(flags & ((1L<<10)|(1L<<11)|(1L<<21)))) - { - if (!(flags & (1L<<3))) switch (c) - { - case '(': - - if (!(flags & (1L<<0)) || proto->brace == 0) - - { - if (paren++ == 0) - { - - if (!(flags & (1L<<0)) || group <= 1) - - { - - args = 0; - - if (group++ == 0) group++; - else if (flags & (1L<<8)) call++; - flags |= (1L<<15); - im = ip - 1; - om = op - 1; - } - sub = 0; - } - else if (paren == 2 && !aim) - { - sub++; - if (last == '(') - { - flags &= ~(1L<<15); - om = 0; - } - else if (flags & (1L<<8)) - { - aim = ip - 1; - aom = op - 1; - } - else if ((flags & ((1L<<15)|(1L<<25))) == (1L<<15)) - { - for (m = ip - 2; m > im && (*m == ' ' || *m == '\t'); m--); - if (m != im && sub == 1) - { - m = im + (*nns(ip) == '*'); - } - if (m == im) - { - flags &= ~(1L<<15); - om = 0; - } - } - else if ((flags & (1L<<15)) && sub == 1 && *nns(ip) != '*') - { - flags &= ~(1L<<15); - om = 0; - } - } - flags &= ~(1L<<25); - } - break; - case ')': - - if (!(flags & (1L<<0)) || proto->brace == 0) - - if (--paren == 0) - { - - if (flags & (1L<<0)) - { - if (group != 2) - { - c = (0401+0); - break; - } - group++; - } - - ie = ip; - } - else if (paren == 1 && (flags & (1L<<8)) && !aie) - aie = ip; - break; - case '*': - if (last == '(' && group == 2) - { - group--; - if (paren == 1) - { - flags |= (1L<<8); - aim = aie = 0; - } - } - break; - case '#': - dir = directive(ip, dir); - if (proto->brace == 0 && paren == 0 && last != '=' && (flags & ((1L<<0)|(1L<<1)|(1L<<3)|(1L<<15)|(1L<<19)|(1L<<23)|(1L<<25))) == ((1L<<15)|(1L<<25)) && ((dir & 03) != 03 || ((dir>>2) & 03) != 01)) - flags |= (1L<<3); - else if (!(flags & ((1L<<1)|(1L<<3)))) - { - flags |= (1L<<3); - if (!(flags & (1L<<19))) - { - bp = ip; - while (*ip == ' ' || *ip == '\t') ip++; - if (*ip == 'l' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e') - { - if (*++ip == ' ' || *ip == '\t') - { - proto->line = 0; - while (*++ip >= '0' && *ip <= '9') - proto->line = proto->line * 10 + *ip - '0'; - proto->line--; - } - } - - else if ((flags & ((1L<<0)|(1L<<5))) == (1L<<0)) - { - n = 0; - t = ip + 6; - while (ip < t && *ip >= 'a' && *ip <= 'z') - n = ((( n)<<5)+(( *ip++)-('a'-1))); - switch (n) - { - case ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'l')-('a'-1))))<<5)+(( 's')-('a'-1))))<<5)+(( 'e')-('a'-1))): - case ((( ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'f')-('a'-1))): - while (*ip == ' ' || *ip == '\t') ip++; - if (*ip != '\n' && *ip != '/' && *(ip + 1) != '*') - { - flags |= (1L<<12)|(1L<<15); - im = ip; - om = op + (ip - bp); - } - break; - case ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'l')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'f')-('a'-1))): - case ((( ((( ((( ((( (( 'e')-('a'-1)))<<5)+(( 'r')-('a'-1))))<<5)+(( 'r')-('a'-1))))<<5)+(( 'o')-('a'-1))))<<5)+(( 'r')-('a'-1))): - case ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))): - case ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): - case ((( ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'f')-('a'-1))))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): - case ((( ((( ((( ((( (( 'u')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'd')-('a'-1))))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))): - break; - case ((( ((( ((( ((( ((( (( 'i')-('a'-1)))<<5)+(( 'n')-('a'-1))))<<5)+(( 'c')-('a'-1))))<<5)+(( 'l')-('a'-1))))<<5)+(( 'u')-('a'-1))))<<5)+(( 'd')-('a'-1))): - if (*ip == 'e') ip++; - - case ((( ((( ((( ((( ((( (( 'd')-('a'-1)))<<5)+(( 'e')-('a'-1))))<<5)+(( 'f')-('a'-1))))<<5)+(( 'i')-('a'-1))))<<5)+(( 'n')-('a'-1))))<<5)+(( 'e')-('a'-1))): - case ((( ((( ((( ((( ((( (( 'p')-('a'-1)))<<5)+(( 'r')-('a'-1))))<<5)+(( 'a')-('a'-1))))<<5)+(( 'g')-('a'-1))))<<5)+(( 'm')-('a'-1))))<<5)+(( 'a')-('a'-1))): - if (*ip < 'a' || *ip > 'z') break; - - default: - flags |= (1L<<12)|(1L<<15); - im = bp - 1; - om = op - 1; - break; - } - } - else - - { - if (*ip == 'i' && *++ip == 'n' && *++ip == 'c' && *++ip == 'l' && *++ip == 'u' && *++ip == 'd' && *++ip == 'e') - { - while (*++ip == ' ' || *ip == '\t'); - if (*ip++ == '<' && *ip++ == 's' && *ip++ == 't' && *ip++ == 'd' && *ip++ == 'a' && *ip++ == 'r' && *ip++ == 'g' && *ip++ == '.' && *ip++ == 'h' && *ip++ == '>') - { - op = strcopy(op, "\ -if !defined(va_start)\n\ -#if defined(__STDARG__)\n\ -#include \n\ -#else\n\ -#include \n\ -#endif\n\ -#endif\n\ -"); - op = linesync(proto, op, proto->line); - break; - } - } - else if (*ip == 'd' && *++ip == 'e' && *++ ip == 'f' && *++ip == 'i' && *++ip == 'n' && *++ip == 'e' && (*++ip == ' ' || *ip == '\t')) - { - while (*++ip == ' ' || *ip == '\t'); - if (*ip == 'e' && *++ip == 'x' && *++ ip == 't' && *++ip == 'e' && *++ip == 'r' && *++ip == 'n' && (*++ip == ' ' || *ip == '\t')) - { - t = ip; - while (*++t == ' ' || *t == '\t'); - if (*t == 'e' && *++t == 'x' && *++ t == 't' && *++t == 'e' && *++t == 'r' && *++t == 'n' && (*++t == ' ' || *t == '\t' || *t == '\n' || *t == '\r')) - ip = t; - t = ip; - while (*++t == ' ' || *t == '\t'); - if (*t == '_' && *(t + 1) == '_') - { - op = strcopy(op, "undef __MANGLE__\n"); - op = linesync(proto, op, proto->line); - op = strcopy(op, "#define __MANGLE__ __LINKAGE__"); - break; - } - } - flags |= (1L<<2)|(1L<<15); - im = bp - 1; - om = op - 1; - } - else if (*ip == 'u' && *++ip == 'n' && *++ ip == 'd' && *++ip == 'e' && *++ip == 'f' && (*++ip == ' ' || *ip == '\t')) - { - while (*++ip == ' ' || *ip == '\t'); - if (*ip == 'e' && *++ip == 'x' && *++ ip == 't' && *++ip == 'e' && *++ip == 'r' && *++ip == 'n' && (*++ip == ' ' || *ip == '\t' || *ip == '\n' || *ip == '\r')) - { - op = strcopy(op, "undef __MANGLE__\n"); - op = linesync(proto, op, proto->line); - op = strcopy(op, "#define __MANGLE__ __LINKAGE__"); - break; - } - flags |= (1L<<2)|(1L<<15); - im = bp - 1; - om = op - 1; - } - } - ip = bp; - } - break; - } - else - break; - - case '{': - if (proto->brace++ == 0 && paren == 0) - { - if (last == '=') flags |= (1L<<9); - - else if (flags & (1L<<0)) - { - if ((flags & ((1L<<15)|(1L<<17)|(1L<<23))) == (1L<<15)) - { - if (args) - { - v = number(op, args < 0 ? -args : args); - v = strcopy(v, " argument actual/formal mismatch"); - *v++ = ' '; - v = memcopy(v, im, ie - im); - *v = 0; - proto_error((char*)proto + sizeof(Proto_t), 2, op, ((char*)0)); - } - ip--; - - v = ie; - while (ie < ip) - if (*ie++ == '/' && *ie == '*') - { - e = ie - 1; - while (++ie < ip) - { - if (*ie == '*') - { - while (ie < ip && *ie == '*') ie++; - if (ie < ip && *ie == '/') - { - while (++ie < ip && (*ie == ' ' || *ie == '\t')); - while (e > v && (*(e - 1) == ' ' || *(e - 1) == '\t')) e--; - if (e > v && *e != '\n') *e++ = ' '; - t = ie; - while (--e >= v) - *--t = *e; - v = t; - break; - } - } - } - } - ie = v; - - op = om++; - if (flags & (1L<<5)) - { - v = op; - while (v > ko && *--v != ' '); - if (*v != ' ') - { - om = (v = (op += 4)) + 1; - while (v >= ko + 4) - { - *v = *(v - 4); - v--; - } - memcopy(ko, "int ", 4); - } - if (*v == ' ') - { - while (*(v + 1) == '*') - *v++ = '*'; - *v = '\t'; - if ((v - ko) <= 8) - { - om = (e = ++op) + 1; - while (e > v) - { - *e = *(e - 1); - e--; - } - } - } - om = (v = (op += 7)) + 1; - while (v >= ko + 7) - { - *v = *(v - 7); - v--; - } - memcopy(ko, "extern ", 7); - } - (*op++=( '(')); - t = op; - e = 0; - - while (ie < ip) - { - if ((c = *ie) == ' ' || c == '\t' || c == '\n') - { - while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); - if (ie >= ip) break; - if (c != '*' && op > om) (*op++=( ' ')); - } - if ((n = ((c = *ie) == ',')) || c == ';') - { - if (flags & (1L<<5)) - { - m = op; - while (op > om && ((c = *(op - 1)) == '(' || c == ')' || c == '[' || c == ']')) - op--; - v = op; - while (op > om && (c = *(op - 1)) != ' ' && c != '*') - op--; - while (*(op - 1) == ' ') - op--; - if (!e) - { - e = op; - while (e > om && *(e - 1) == '*') - e--; - } - - - - - if (op <= om) - op = strcopy(op, "int"); - else if (*(op - 1) == ',') - op = strcopy(op, " int"); - - while (v < m) - (*op++=( *v++)); - } - (*op++=( ',')); - if (n) - { - if (x = !e) e = op - 1; - (*op++=( ' ')); - m = t; - while (m < e) - (*op++=( *m++)); - if (x) - { - m = e; - while (*--e != ' '); - while (*(e - 1) == '*') e--; - op -= m - e; - } - } - while ((c = *++ie) == ' ' || c == '\t' || c == '\n'); - if (ie >= ip) (op--); - else (*op++=( ' ')); - if (!n) - { - t = op; - e = 0; - } - } - else if (*ie == '*') - { - if (op > om && (c = *(op - 1)) == ' ') op--; - while (*ie == '*') (*op++=( *ie++)); - while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; - if (c != '(') (*op++=( ' ')); - } - else if (*ie == '(') - { - if (op > om && *(op - 1) == ' ') op--; - (*op++=( *ie++)); - while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; - } - else if (*ie == ')') - { - if (op > om && *(op - 1) == '(') - proto_error((char*)proto + sizeof(Proto_t), 1, "function pointer argument prototype omitted", ((char*)0)); - (*op++=( *ie++)); - while (*ie == ' ' || *ie == '\t' || *ie == '\n') ie++; - } - else if ((flags & (1L<<5)) && (op == om || *(op - 1) == ' ') && *ie == 'r' && !sstrncmp( ie, "register", 8) && (*(ie + 8) == ' ' || *(ie + 8) == '\t' || *(ie + 8) == '\n')) - { - ie += 8; - if (op > om) (op--); - } - else (*op++=( *ie++)); - } - - if (op <= om) op = strcopy(op, "void"); - (*op++=( ')')); - if (flags & (1L<<5)) - { - (*op++=( ';')); - (*op++=( '\n')); - (proto->op=op); - (ko=op); - } - else - { - (*op++=( '\n')); - (*op++=( *ip)); - } - ip++; - flags &= ~((1L<<15)|(1L<<23)); - } - } - - else if ((flags & ((1L<<15)|(1L<<19)|(1L<<23)|(1L<<25))) == ((1L<<15)|(1L<<25))) - { - line = proto->line; - op = strcopy(om, " __PARAM__("); - op = memcopy(op, im, ie - im); - (*op++=( ',')); - (*op++=( ' ')); - (*op++=( '(')); - flags &= ~((1L<<15)|(1L<<23)); - if (flags & (1L<<27)) - { - if ((vc = ie - im + 1) > sizeof(proto->variadic)) vc = sizeof(proto->variadic); - memcopy(proto->variadic, im, vc); - op = strcopy(op, "va_alist)) __OTORP__(va_dcl)\n{"); - } - else - { - flags |= (1L<<23); - proto->ip = im; - proto->op = op; - group = 0; - brack = 0; - for (;;) - { - switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) - { - case '[': - brack++; - continue; - case ']': - brack--; - continue; - case '(': - if (paren++) group++; - continue; - case ')': - if (--paren == 0) - { - group = 0; - if (flags & (1L<<15)) - { - flags &= ~((1L<<15)|(1L<<23)); - op = memcopy(op, m, e - m); - } - break; - } - continue; - case ',': - if (paren == 1) - { - group = 0; - if (flags & (1L<<15)) - { - flags &= ~((1L<<15)|(1L<<23)); - op = memcopy(op, m, e - m); - } - (*op++=( ',')); - (*op++=( ' ')); - proto->op = op; - } - continue; - case (0401+0): - if (group <= 1 && !brack) - { - flags |= (1L<<15); - m = proto->tp; - e = proto->ip; - } - continue; - default: - continue; - } - break; - } - (*op++=( ')')); - (*op++=( ')')); - } - if (!(flags & (1L<<23))) - { - flags |= (1L<<23); - proto->op = strcopy(op, " __OTORP__("); - proto->ip = im + 1; - n = *(ie - 1); - *(ie - 1) = ';'; - c = *ie; - *ie = 0; - lex(proto, (flags & ((1L<<16))) | (1L<<1)); - *(ie - 1) = n; - *ie = c; - proto->ip = ie; - op = proto->op; - (*op++=( ')')); - } - if (flags & (1L<<6)) memcopy( proto->ox, "extern", 6); - op = linesync(proto, op, proto->line = line); - if (flags & (1L<<3)) - { - proto->brace = 0; - (*op++=( '\n')); - (*op++=( '#')); - } - else if (!(flags & (1L<<27))) (*op++=( '{')); - } - } - flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)); - call = 0; - group = 0; - break; - case '}': - flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)|(1L<<25)); - if (--proto->brace == 0) - { - flags &= ~((1L<<9)|(1L<<27)|(1L<<28)); - - if (flags & (1L<<5)) (op=ko); - - } - call = 0; - group = 0; - paren = 0; - break; - case '=': - if (last == '?') flags |= (1L<<3); - else if (paren == 0 && (flags & ((1L<<9)|(1L<<15)|(1L<<23))) == (1L<<15)) - { - if (last == ')' && proto->brace && (group != 2 || call != 2)) flags |= (1L<<23); - else goto fsm_statement; - } - goto fsm_other; - case ',': - - if (flags & (1L<<0)) - { - if (paren == 1) args++; - else - { - args--; - flags &= ~(1L<<15); - } - break; - } - - if (paren == 0 && (flags & (1L<<1))) *(op - 1) = c = ';'; - - case ';': - fsm_statement: - if (flags & (1L<<9)) ; - - else if (flags & (1L<<0)) - { - if (paren == 0) - { - if ((flags & (1L<<15)) && last == ')') - flags &= ~(1L<<15); - if (!(flags & (1L<<15))) - { - call = 0; - group = 0; - flags &= ~(1L<<23); - if (flags & (1L<<5)) (op=ko); - if (flags & (1L<<24)) - { - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - return 0; - } - } - else - { - args--; - if ((flags & ((1L<<5)|(1L<<23))) == ((1L<<5)|(1L<<23))) - (op=ko); - } - } - } - - else if (paren == 0) - { - if ((flags & ((1L<<15)|(1L<<17)|(1L<<23))) == (1L<<15) && call > 1) - { - if ((flags & (1L<<14)) && func) - { - func[0] = 'F'; - func[1] = 'U'; - func[2] = 'N'; - func[3] = 'C'; - func = 0; - } - if ((flags & ((1L<<1)|(1L<<8))) == (1L<<8) && aim && aie < im) - { - while (aie < ip && (*aie == ' ' || *aie == '\t' || *aie == '\n')) aie++; - v = aim; - while (v < aie) - if (*v++ == ')') break; - while (v < aie && (*v == ' ' || *v == '\t' || *v == '\n')) v++; - if (v == aie || !(flags & (1L<<20))) - { - if (flags & (1L<<20)) n = 3; - else if (v == aie && *v == '(') n = 10; - else n = 11; - ko = op; - om += n; - v = op += n; - while (v >= ko + n) - { - *v = *(v - n); - v--; - } - if (flags & (1L<<20)) memcopy(aom, "(...))", 6); - else if (n == 10) memcopy(aom, "(__VARARG__))", 13); - else - { - ko = strcopy(aom, " __PROTO__("); - ko = memcopy(ko, aim, aie - aim); - *ko = ')'; - if (++ko >= om) - { - *ko++ = ')'; - om = ko; - } - } - } - } - else if (flags & (1L<<26)) - { - op = om; - while (*--op == ' ' || *op == '\t' || *op == '\n'); - if (*op != ')') - { - op = om += 14; - *--op = ')'; - while ((x = *(op - 14)) >= 'A' && x <= 'Z' || x >= 'a' && x <= 'z' || x >= '0' && x <= '9' || x == '_') - *--op = x; - memcopy(op - 13, "(__OTORP__(*)", 13); - } - } - if (flags & (1L<<17)) - ; - else if (flags & (1L<<20)) - { - op = om; - if (!(flags & (1L<<25))) op = strcopy(op, "(...)"); - else op = memcopy(op, im, ie - im); - (*op++=( c)); - } - else - { - if (flags & (1L<<1)) op = strcopy(om, "()"); - else if (!(flags & (1L<<25))) op = strcopy(om, "(__VARARG__)"); - else - { - op = strcopy(om, " __PROTO__("); - op = memcopy(op, im, ie - im); - (*op++=( ')')); - } - if (flags & (1L<<6)) memcopy( proto->ox, "extern", 6); - (*op++=( c)); - } - flags &= ~((1L<<15)|(1L<<27)|(1L<<28)); - if (c == ',' && !(flags & (1L<<8))) - { - call = 1; - group = 0; - break; - } - } - else if (flags & ((1L<<17)|(1L<<23))) call = 0; - if (c == ';') - { - flags &= ~((1L<<6)|(1L<<14)|(1L<<25)|(1L<<26)); - call = 0; - if (flags & (1L<<24)) - { - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - return 0; - } - } - else call = call > 1 && c == ','; - group = 0; - flags &= ~((1L<<7)|(1L<<8)|(1L<<15)|(1L<<17)|(1L<<23)); - } - else if (paren == 1 && group == 1 && !(flags & ((1L<<7)|(1L<<14)))) flags |= (1L<<25)|(1L<<17); - break; - case ((0500+4)+6): - case ((0500+4)+13): - flags |= (1L<<25)|(1L<<23); - break; - case ((0500+4)+9): - - if (flags & (1L<<0)) - { - if (proto->brace == 0) - flags |= (1L<<23); - } - else - - if (paren == 0 && !(flags & (1L<<26))) - { - flags |= (1L<<14); - if (!(flags & (1L<<19)) || proto->package) - { - op = strcopy(op, " __MANGLE__"); - if (proto->package) - { - op = strcopy(op - 1, proto->package); - func = op + 1; - op = strcopy(op, "_DATA__"); - } - } - else - func = 0; - } - break; - case (0401+29): - if (paren == 0 && (flags & ((1L<<1)|(1L<<27))) == (1L<<1)) - { - op -= 3; - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - return c; - } - if (paren == 1 && !(flags & (1L<<23))) - flags |= (1L<<27); - flags |= (1L<<25); - break; - case ((0500+4)+30): - goto fsm_id; - case (0500+1): - if ((flags & ((1L<<19)|(1L<<27))) == (1L<<27)) - { - flags &= ~(1L<<15); - line = proto->line; - op = strcopy(op - 8, "__VA_START__"); - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - for (;;) - { - switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) - { - case 0: - case ';': - break; - case (0401+0): - if (!(flags & (1L<<15))) - { - flags |= (1L<<15); - m = proto->tp; - e = proto->ip; - } - continue; - default: - continue; - } - break; - } - do{(ip=proto->ip);(op=proto->op);call=proto->call;}while(0); - if (flags & (1L<<15)) - { - v = m; - n = e - m; - } - else - { - v = "ap"; - n = 2; - } - op = strcopy(op, " __OTORP__("); - proto->ip = proto->variadic; - proto->op = op; - flags &= ~(1L<<15); - group = 0; - bp = proto->ip + 1; - if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; - for (;;) - { - switch (lex(proto, (flags & ((1L<<16))) | (1L<<21))) - { - case '(': - if (paren++) group++; - continue; - case ')': - if (--paren == 0) - { - if (flags & (1L<<15)) - { - flags &= ~(1L<<15); - if (!(flags & (1L<<28))) - { - op = memcopy(op, m, e - m); - op = strcopy(op, " = "); - } - op = strcopy(op, "va_arg("); - op = memcopy(op, v, n); - (*op++=( ',')); - (*op++=( ' ')); - if (m > bp) op = memcopy(op, bp, m - bp); - else op = strcopy(op, "int "); - if (group > 1) op = strcopy(op, ")()"); - else op = memcopy(op, e, proto->ip - e - 1); - (*op++=( ')')); - (*op++=( ';')); - } - group = 0; - break; - } - continue; - case ',': - if (paren == 1) - { - if (flags & (1L<<15)) - { - flags &= ~(1L<<15); - if (!(flags & (1L<<28))) - { - op = memcopy(op, m, e - m); - op = strcopy(op, " = "); - } - op = strcopy(op, "va_arg("); - op = memcopy(op, v, n); - (*op++=( ',')); - (*op++=( ' ')); - if (m > bp) op = memcopy(op, bp, m - bp); - else op = strcopy(op, "int "); - if (group > 1) op = strcopy(op, ")()"); - else op = memcopy(op, e, proto->ip - e - 1); - (*op++=( ')')); - (*op++=( ';')); - bp = proto->ip + 1; - if (*bp == 'r' && !sstrncmp( bp, "register", 8) && (*(bp + 8) == ' ' || *(bp + 8) == '\t')) bp += 9; - } - group = 0; - proto->op = op; - } - continue; - case (0401+0): - if (group <= 1) - { - flags |= (1L<<15); - m = proto->tp; - e = proto->ip; - } - continue; - default: - continue; - } - break; - } - op = strcopy(op, ")"); - flags |= (1L<<28); - proto->line = line; - call = 0; - break; - } - - case (0401+0): - fsm_id: - - if (flags & (1L<<0)) - { - if (!args && paren == 1) args++; - break; - } - - if (paren == 0) - { - if (last == ')') - { - if (proto->brace == 0 && !(flags & (1L<<1))) flags |= (1L<<23); - call = !call; - } - else if ((flags & (1L<<23)) || c == (0401+0) || c == ((0500+4)+30)) call++; - else flags |= (1L<<23); - if (last == (0401+0)) flags |= (1L<<7); - } - c = (0401+0); - flags |= (1L<<25); - break; - case (0401+1): - if (*proto->tp >= '0' && *proto->tp <= '9') - { - n = 0; - for (;; op--) - { - switch (*(op - 1)) - { - case 'f': - case 'F': - t = op; - while ((c = *--t) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'); - if (*t == '.') - op--; - n = 0; - break; - case 'l': - case 'L': - if (!(n & 01)) - { - n |= 01; - t = op; - while ((c = *--t) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z'); - if (*t == '.') - { - n = 0; - op--; - break; - } - } - continue; - case 'u': - case 'U': - n |= 02; - continue; - } - break; - } - if (n & 01) - *op++ = 'L'; - if (n & 02) - { - m = op; - t = op = m + 10; - while ((c = *--m) >= '0' && c <= '9' || c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z') - *--t = c; - c = *t; - strcopy(m + 1, "(unsigned)"); - *t = c; - break; - } - } - goto fsm_other; - - case '[': - if ((flags & (1L<<0)) && paren == 0 && group <= 2) flags |= (1L<<23); - - - default: - fsm_other: - - if (flags & (1L<<0)) break; - - flags |= (1L<<25); - if (paren == 0) flags |= (1L<<17); - break; - } - else if (c == '#' && *ip != '(') flags |= (1L<<22); - last = c; - - if ((flags & ((1L<<5)|(1L<<15))) == ((1L<<5)|(1L<<15)) && ((flags & ((1L<<3)|(1L<<23))) || proto->brace || c != '(' && c != ')' && c != '*' && c != (0401+0))) - (op=proto->op); - else - - (proto->op=op); - goto fsm_start; - } - else if (flags & ((1L<<10)|(1L<<11))) - { - - if ((flags & (1L<<29)) && c == '%' && *ip == '{') - t = 0; - else - - { - if (c == '#') - { - for (t = ip; *t == ' ' || *t == '\t'; t++); - if (*t++ == 'i' && *t++ == 'f' && *t++ == 'n' && *t++ == 'd' && *t++ == 'e' && *t++ == 'f') - { - - - - - t = 0; - } - } - else - t = ""; - } - if (t) - { - - n = ip - proto->tp; - ip -= n; - op -= n; - - - - - } - else - while (*ip != '\n') - *op++ = *ip++; - op = init(proto, op, flags); - op = linesync(proto, op, proto->line); - flags &= ~((1L<<10)|(1L<<11)); - proto->flags &= ~((1L<<10)|(1L<<11)); - goto fsm_start; - } - do{(proto->ip=ip);(proto->op=op);proto->flags&=~((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->flags|=flags&((1L<<5)|(1L<<9)|(1L<<17)|(1L<<27)|(1L<<28));proto->call=call;}while(0); - return c; -} - - - - - -void -pppclose __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ - register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); - - if (proto->flags & (1L<<16)) close(proto->fd); - free((char*)proto); -} - - -#line 2055 -char* -pppopen __PARAM__((char* file, int fd, char* notice, char* options, char* package, char* comment, int flags), (file, fd, notice, options, package, comment, flags)) __OTORP__(char* file; int fd; char* notice; char* options; char* package; char* comment; int flags;){ - register Proto_t* proto; - register char* iob; - register long n; - register char* s; - char* t; - int pragma; - int clr; - int hit; - int i; - int z; - char* b; - - int comlen; - char com[80]; - - int m = 0; - - static int retain; - - - - - - - if (flags & (1<<0)) flags &= ~(1<<5); - - if (flags & (1<<11)) flags &= ~retain; - else retain &= (1<<6); - if (file && (fd = open(file, O_RDONLY)) < 0) return 0; - - - - - - - - - - - - - - - - - - - - - - - { - - - - - n = (16*1024); - if (!(proto = (( 0)?( Proto_t*)realloc((char*)( 0),sizeof( Proto_t)*( 1)+( 5 * n + 2)):( Proto_t*)calloc(1,sizeof( Proto_t)*( 1)+( 5 * n + 2))))) - return 0; - proto->iz = n; - proto->oz = 3 * n; - proto->flags |= (1L<<16); - } - proto->fd = fd; - proto->package = package; - iob = (char*)proto + sizeof(Proto_t); - proto->op = proto->ob = iob; - proto->ip = proto->ib = iob + proto->oz + n; - if (m) proto->options |= (1L<<0); - if (!comment) - comment = "/*"; - if (!(proto->cc[0] = comment[0])) - notice = options = 0; - else if (comment[1]) - { - proto->cc[1] = comment[1]; - proto->cc[2] = comment[2] ? comment[2] : comment[0]; - } - else - proto->cc[1] = proto->cc[2] = comment[0]; - - - - - - n = read(fd, proto->ip, proto->iz); - if (!(proto->flags & (1L<<16))) - close(fd); - if (n < 0) - { - pppclose(iob); - return 0; - } - *(proto->ip + n) = 0; - - -#line 2165 - if (!notice && !options || (comlen = astlicense(com, sizeof(com), ((char*)0), "type=check", proto->cc[0], proto->cc[1], proto->cc[2])) <= 0) - *com = 0; - - hit = (notice || options) ? 0 : 0x02; - pragma = -1; - s = proto->ip; - m = 80; - while (m-- > 0 && *s && hit != (0x01|0x02)) - { - while (*s == ' ' || *s == '\t') - s++; - if (*s == '#') - { - b = s++; - while (*s == ' ' || *s == '\t') - s++; - if (*s == *"pragma"&& !sstrncmp( s, "pragma", sizeof("pragma") - 1) && (*(s += sizeof("pragma") - 1) == ' ' || *s == '\t')) - { - clr = 0; - while (*s && *s != '\r' && *s != '\n') - { - for (; *s == ' ' || *s == '\t'; s++); - for (t = s; *s && *s != ' ' && *s != '\t' && *s != '\r' && *s != '\n'; s++); - z = s - t; - for (i = 0; i < (sizeof( pragmas)/sizeof( pragmas[0])); i++) - if (pragmas[i].size == z && !sstrncmp( t, pragmas[i].name, z)) - { - clr = 1; - hit |= pragmas[i].hit; - switch (pragmas[i].hit) - { - case 0x02: - notice = options = 0; - break; - case 0x01: - pragma = pragmas[i].val; - break; - } - } - } - if (clr) - { - - if (!(flags & (1<<1)) || (flags & (1<<8))) - - for (; b < s; *b++ = ' '); - } - } - } - else if (*s == *"/* : : generated by proto : : */\n"&& !sstrncmp( s, "/* : : generated by proto : : */\n", sizeof("/* : : generated by proto : : */\n") - 1)) - { - pragma = 0; - break; - } - - else if (*s == '%' && *(s + 1) == '{') - proto->flags |= (1L<<29); - else if (!(hit & 0x02)) - { - if (*s == *com && !sstrncmp( s, com, comlen)) - { - hit |= 0x02; - notice = options = 0; - } - else - for (; *s && *s != '\n' && !(hit & 0x02); s++) - for (i = 0; i < (sizeof( notices)/sizeof( notices[0])); i++) - if (*s == notices[i].name[0] && !sstrncmp( s, notices[i].name, notices[i].size)) - { - s += notices[i].size; - if (notices[i].val) - { - while (*s == ' ' || *s == '\t') - s++; - if (*s == '(' && (*(s + 1) == 'c' || *(s + 1) == 'C') && *(s + 2) == ')' || *s >= '0' && *s <= '9' && *(s + 1) >= '0' && *(s + 1) <= '9') - { - hit |= notices[i].hit; - notice = options = 0; - } - } - else - { - hit |= notices[i].hit; - notice = options = 0; - } - break; - } - } - - while (*s && *s++ != '\n'); - } - if (flags & (1<<10)) proto->flags |= (1L<<20); - if (flags & (1<<12)) proto->test = 1; - if (flags & (1<<2)) proto->options |= (1L<<6); - - if (flags & (1<<0)) pragma = -pragma; - if (flags & (1<<1)) pragma = 0; - if (flags & (1<<7)) proto->flags |= (1L<<13); - if (!(proto->flags & (1L<<29)) && file && (m = sstrlen( file)) > 2 && file[--m] == 'y' && file[--m] == '.') - proto->flags |= (1L<<29); - - if (pragma <= 0) - { - if (flags & (1<<10)) - { - flags &= ~((1<<4)|(1<<5)); - proto->flags |= (1L<<19); - } - else if (!(flags & ((1<<3)|(1<<9)))) - { - pppclose(iob); - return 0; - } - else if ((flags & ((1<<3)|(1<<9))) == (1<<9) || !pragma) - { - proto->flags |= (1L<<18); - if (proto->flags & (1L<<16)) - proto->oz += proto->iz; - proto->iz = n; - if (notice || options) - { - if (proto->cc[0] == '#' && proto->ip[0] == '#' && proto->ip[1] == '!') - { - s = proto->ip; - while (*s && *s++ != '\n'); - m = s - proto->ip; - proto->op = memcopy(proto->op, proto->ip, m); - proto->ip = s; - proto->iz = n -= m; - } - - if (proto->cc[0]) - { - if ((comlen = astlicense(proto->op, proto->oz, notice, options, proto->cc[0], proto->cc[1], proto->cc[2])) < 0) - proto_error((char*)proto + sizeof(Proto_t), 1, proto->op, ((char*)0)); - else - proto->op += comlen; - } - if (!(flags & (1<<0)) && !(proto->flags & (1L<<29))) - - proto->op = linesync(proto, proto->op, 1); - proto->iz += proto->op - proto->ob; - } - memcopy(proto->op, proto->ip, n); - return iob; - } - } - - if (!(retain & (1<<6))) - { - retain |= (1<<6); - ppfsm(4, ((char*)0)); - } - - proto->line = 1; - - if (notice || options || (flags & ((1<<4)|(1<<5)))) - { - - if (notice || options) - { - if ((comlen = astlicense(proto->op, proto->oz, notice, options, proto->cc[0], proto->cc[1], proto->cc[2])) < 0) - proto_error((char*)proto + sizeof(Proto_t), 1, proto->op, ((char*)0)); - else - proto->op += comlen; - } - - if (flags & (1<<5)) - { - proto->flags |= (1L<<11); - if (flags & (1<<11)) - retain |= (1<<5); - } - else if (flags & (1<<4)) - { - if (flags & (1<<11)) retain |= (1<<4); - - if (flags & (1<<0)) - { - *proto->op++ = '#'; - proto->op = strcopy(proto->op, "pragma"); - *proto->op++ = ' '; - proto->op = strcopy(proto->op, pragmas[0].name); - *proto->op++ = '\n'; - } - else - - proto->flags |= (1L<<10); - } - - if (!(flags & (1<<0))) - { - if (proto->flags & (1L<<29)) - { - proto->op = strcopy(proto->op, "\n%{\n"+ !notice); - proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); - proto->op = strcopy(proto->op, "%}\n"); - } - else - { - if (n || notice || options) - *proto->op++ = '\n'; - proto->op = strcopy(proto->op, "/* : : generated by proto : : */\n"); - if (n) - proto->op = linesync(proto, proto->op, proto->line); - else if (proto->flags & ((1L<<10)|(1L<<11))) - proto->op = init(proto, proto->op, proto->flags); - } - } - - } - - - proto->file = file; - if (flags & (1<<0)) - { - proto->flags |= (1L<<0); - if (!(flags & (1<<4))) proto->flags |= (1L<<5); - } - - return iob; -} - - - - - - -int -pppread __PARAM__((char* iob), (iob)) __OTORP__(char* iob;){ - register Proto_t* proto = (Proto_t*)(iob - sizeof(Proto_t)); - register int n; - - if (proto->flags & (1L<<18)) - { - if (proto->iz) - { - n = proto->iz; - proto->iz = 0; - } - else if (!(proto->flags & (1L<<16))) n = 0; - else if ((n = read(proto->fd, proto->ob, proto->oz)) <= 0 || (proto->options & (1L<<0)) && n < proto->oz) - { - proto->flags &= ~(1L<<16); - close(proto->fd); - } - } - else - { - if (proto->op == proto->ob) - { - if (proto->flags & (1L<<4)) return -1; - - if (proto->flags & (1L<<29)) - { - register char* ip = proto->ip; - register char* op = proto->ob; - register char* ep = proto->ob + proto->oz - 2; - - if (!*ip) - { - ip = proto->ip = proto->ib; - if (!(proto->flags & (1L<<16))) n = 0; - else if ((n = read(proto->fd, ip, proto->iz)) <= 0 || (proto->options & (1L<<0)) && n < proto->iz) - { - if (n < 0) n = 0; - proto->flags &= ~(1L<<16); - close(proto->fd); - } - ip[n] = 0; - } - if (proto->flags & (1L<<30)) - { - proto->flags &= ~(1L<<30); - if (*ip == '%') - { - *op++ = *ip++; - if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); - else proto->flags |= (1L<<31); - } - } - if (proto->flags & (1L<<29)) - while (op < ep && (n = *op++ = *ip)) - { - ip++; - if (n == '%') - { - if (*ip == '%' && (ip == proto->ip + 1 || *(ip - 2) == '\n')) - { - *op++ = *ip++; - if (proto->flags & (1L<<31)) proto->flags &= ~(1L<<29); - else proto->flags |= (1L<<31); - break; - } - if (!*ip) - { - *op++ = '%'; - proto->flags |= (1L<<30); - break; - } - } - else if (n == '\n') proto->line++; - } - proto->op = memcopy(proto->ob, proto->ip, ip - proto->ip); - proto->ip = ip; - } - else - - lex(proto, proto->flags); - if ((proto->flags & ((1L<<4)|(1L<<16))) == (1L<<4)) - proto->op = strcopy(proto->op, "/* NOTE: some constructs may not have been converted */\n"); - } - n = proto->op - proto->ob; - proto->op = proto->ob; - } - return n; -} - - - - - - - - - - - - -#line 269 "proto.c" - - - - - -static int -proto __PARAM__((char* file, char* license, char* options, char* package, char* copy, char* comment, int flags), (file, license, options, package, copy, comment, flags)) __OTORP__(char* file; char* license; char* options; char* package; char* copy; char* comment; int flags;){ - char* b; - char* e; - char* p; - int n; - int m; - int x; - int fd; - char buf[1024]; - - if (file && access(file, 4)) - proto_error(((char*)0), 2, file, "not found"); - else if (b = pppopen(file, 0, license, options, package, comment, flags)) - { - if (!file) - fd = 1; - else if (flags & ((1<<13)<<1)) - { - e = file + sstrlen( file) - 1; - x = *e; - *e = '_'; - if ((fd = creat(file, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) - { - proto_error(b, 2, file, "cannot create temporary file"); - pppclose(b); - return flags | ((1<<13)<<0); - } - *e = x; - } - else if (copy) - { - if (((n = sstrlen( copy)) + sstrlen( file) + 2) > sizeof(buf)) - { - proto_error(b, 2, copy, "copy path too long"); - pppclose(b); - return flags | ((1<<13)<<0); - } - strcopy( buf, copy); - e = buf + n; - if (*file != '/') - *e++ = '/'; - strcopy( e, file); - if ((fd = creat(buf, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) - { - for (e = buf; *e == '/'; e++); - do - { - if (*e == '/') - { - *e = 0; - if (access(buf, 0) && mkdir(buf, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) - { - proto_error(b, 2, buf, "cannot create copy directory"); - pppclose(b); - return flags | ((1<<13)<<0); - } - *e = '/'; - } - } while (*e++); - if ((fd = creat(buf, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH)) < 0) - { - proto_error(b, 2, buf, "cannot create copy file"); - pppclose(b); - return flags | ((1<<13)<<0); - } - } - file = buf; - } - else - fd = 1; - if (file && (flags & ((1<<13)<<2))) - proto_error(b, 0, "convert to", file); - while ((n = pppread(b)) > 0) - { - p = b; - for (;;) - { - if ((m = write(fd, p, n)) <= 0) - { - proto_error(b, 2, "write error", ((char*)0)); - flags |= ((1<<13)<<0); - break; - } - if ((n -= m) <= 0) - break; - p += m; - } - if (m < 0) - break; - } - if (fd > 1) - close(fd); - if (file && (flags & ((1<<13)<<1))) - { - *e = '_'; - strcopy( b, file); - *e = x; - if (replace(b, file, !(flags & (1<<0)))) - proto_error(b, 2, "cannot rename to", file); - } - pppclose(b); - } - return flags; -} - - - - - -typedef struct Sufcom_s -{ - char suffix[4]; - char comment[4]; -} Sufcom_t; - -static const Sufcom_t sufcom[] = -{ - "c", "/*", - "cpp", "/*", - "cxx", "/*", - "c++", "/*", - "C", "/*", - "CPP", "/*", - "CXX", "/*", - "C++", "/*", - "f", "C", - "F", "C", - "h", "/*", - "hpp", "/*", - "hxx", "/*", - "H", "/*", - "HPP", "/*", - "HXX", "/*", - "ksh", "#", - "KSH", "#", - "l", "/*", - "L", "/*", - "p", "(*)", - "pas", "(*)", - "P", "(*)", - "PAS", "(*)", - "pl", "#", - "PL", "#", - "pl1", "/*", - "pli", "/*", - "PL1", "/*", - "PLI", "/*", - "sh", "#", - "SH", "#", - "sml", "(*)", - "SML", "(*)", - "y", "/*", - "Y", "/*", -}; - - - - - -static char* -type __PARAM__((register char* file, char* comment), (file, comment)) __OTORP__(register char* file; char* comment;){ - register char* suffix; - register int i; - - if (file && (!comment || !*comment)) - { - suffix = 0; - while (*file) - if (*file++ == '.') - suffix = file; - if (suffix && sstrlen( suffix) <= 3) - for (i = 0; i < sizeof(sufcom) / sizeof(sufcom[0]); i++) - if (!strcmp(suffix, sufcom[i].suffix)) - return (char*)sufcom[i].comment; - } - return comment; -} - -int -main __PARAM__((int argc, char** argv), (argc, argv)) __OTORP__(int argc; char** argv;){ - char* b; - char* file; - int fd; - int n; - char* op; - char* oe; - char* comment = 0; - char* copy = 0; - char* list = 0; - char* license = 0; - char* options = 0; - char* package = 0; - int flags = (1<<4); - char buf[1024]; - char opt[4 * 1024]; - - ; - - while ((file = *++argv) && *file == '-' && *(file + 1)) - { - for (;;) - { - switch (*++file) - { - case 0: - break; - case 'c': - if (!*(comment = ++file)) - comment = *++argv; - break; - case 'd': - flags |= (1<<1); - continue; - case 'e': - if (!*(package = ++file) && !(package = *++argv)) - { - file = "??"; - continue; - } - break; - case 'f': - flags |= (1<<3); - continue; - case 'h': - flags &= ~(1<<4); - continue; - case 'i': - flags |= (1<<0); - continue; - case 'l': - if (!*(license = ++file) && !(license = *++argv)) - { - file = "??"; - continue; - } - break; - case 'n': - flags |= (1<<7); - continue; - case 'o': - if (!*(b = ++file) && !(b = *++argv)) - { - file = "??"; - continue; - } - if (!options) - { - options = op = opt; - oe = op + sizeof(opt) - 1; - } - n = sstrlen( b); - if ((n + 1) >= (oe - op)) - proto_error(((char*)0), 3, b, "too many options"); - else - { - *op++ = '\n'; - memcopy( op, b, n + 1); - op += n; - } - break; - case 'p': - flags |= (1<<9); - continue; - case 'r': - flags |= ((1<<13)<<1); - continue; - case 's': - flags |= (1<<5); - continue; - case 't': - flags |= (1<<12); - continue; - case 'v': - flags |= ((1<<13)<<2); - continue; - case 'x': - flags |= (1<<2); - continue; - case 'z': - flags |= (1<<1)|(1<<8); - continue; - case 'C': - if (!*(copy = ++file) && !(copy = *++argv)) - { - file = "??"; - continue; - } - break; - case 'L': - if (!*(list = ++file) && !(list = *++argv)) - { - file = "??"; - continue; - } - break; - case 'P': - case '+': - flags |= (1<<10); - continue; - case 'S': - comment = "#"; - continue; - default: - proto_error(((char*)0), 2, file, "unknown option"); - - case '?': - b = "Usage: proto [-dfhinprstvzP+S] [-C directory] [-e package] [-l file]\n [-o \"name='value' ...\"] [-L file] file ...\n"; - write(2, b, sstrlen( b)); - return 2; - } - break; - } - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - if (list) - { - if (*list == '-' && !*(list + 1)) - fd = 0; - else if ((fd = open(list, O_RDONLY)) < 0) - proto_error(((char*)0), 3, list, "not found"); - do - { - for (b = buf; (n = read(fd, b, 1)) > 0 && *b != '\n' && b < &buf[sizeof(buf) - 1]; b++); - if (b > buf) - { - *b = 0; - flags = proto(buf, license, options, package, copy, type(buf, comment), flags); - } - } while (n > 0); - if (fd > 0) - close(fd); - } - if (file) - do flags = proto(file, license, options, package, copy, type(file, comment), flags); while (file = *++argv); - else if (!list) - flags = proto(file, license, options, package, copy, type(file, comment), flags); - return errors ? 1 : (flags & ((1<<13)<<0)) ? 2 : 0; -} diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/proto.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/proto.sh new file mode 100644 index 000000000..d9f35fce6 --- /dev/null +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/proto.sh @@ -0,0 +1,35 @@ +######################################################################## +# # +# This file is part of the ksh 93u+m package # +# Copyright (c) 2021 Contributors to ksh 93u+m # +# # +# and is licensed under the # +# Eclipse Public License, Version 1.0 # +# # +# A copy of the License is available at # +# http://www.eclipse.org/org/documents/epl-v10.html # +# (with md5 checksum b35adb5213ca9657e911e9befb180842) # +# # +# Martijn Dekker # +# # +######################################################################## + +# proto(1) has been removed. This is a backwards compatibility stub that allows +# compiling older AST code (with Mamfiles containing proto commands) using the +# current INIT system. This stub ignores all options, then invokes 'cat'. + +while getopts ':dfhinprstvzPSC:e:l:o:L:' opt +do case $opt in + \?) case $OPTARG in + +) ;; + *) echo "proto: $OPTARG: unknown option" + echo 'Usage: proto [-dfhinprstvzP+S] [-C directory] [-e package] [-l file]' + echo ' [-o "name='\''value'\'' ..."] [-L file] file ...' + exit 2 + ;; + esac >&2 + ;; + esac +done +shift $((OPTIND - 1)) +exec cat -- "$@" diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/ratz.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/ratz.c deleted file mode 100644 index 944a92f6e..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/ratz.c +++ /dev/null @@ -1,5312 +0,0 @@ -/* - * ratz -- read a tar gzip archive from the standard input - * - * coded for portability - * _SEAR_* macros for win32 self extracting archives -- see sear(1). - */ -#pragma clang diagnostic ignored "-Wparentheses" - -static char id[] = "\n@(#)$Id: ratz (Jean-loup Gailly, Mark Adler, Glenn Fowler) 1.2.3 2010-10-10 $\0\n"; - -#if _PACKAGE_ast - -#include -#include - -static const char usage[] = -"[-?\n@(#)$Id: ratz (Jean-loup Gailly, Mark Adler, Glenn Fowler) 1.2.3 2010-10-10 $\n]" -"[-author?Jean-loup Gailly]" -"[-author?Mark Adler]" -"[-author?Glenn Fowler ]" -"[-copyright?Copyright (c) 1995-2005 Jean-loup Gailly and Mark Adler]" -"[-license?http://www.opensource.org/licenses/zlib-license]" -"[+NAME?ratz - read a tar gzip archive]" -"[+DESCRIPTION?\bratz\b extracts files and directories from a tar gzip" -" archive on the standard input. It is a standalone program for systems" -" that do not have \bpax\b(1), \btar\b(1) or \bgunzip\b(1). Only regular" -" files and directories are extracted; all other file types are ignored.]" -"[+?\b.exe\b files generated by \bsear\b(1) are fully functional \bratz\b" -" executables, so any \bratz\b option may be used on a \bsear\b file." -" This allows \bsear\b file contents to be examined and extracted without" -" executing any embedded installation scripts.]" -"[c:cat|uncompress?Uncompress the standard input and copy it to the standard" -" output.]" -#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) -"[i!:install?Execute the sear installation script.]" -"[k:keep?Keep the installation temporary directory.]" -#endif -"[l:local?Reject files that traverse outside the current directory.]" -"[m:meter?Display a one line text meter showing archive read progress.]" -"[n!:convert?In ebcdic environments convert text archive members from ascii" -" to the native ebcdic.]" -"[t:list?List each file path on the standard output but do not extract.]" -"[v:verbose?List each file path on the standard output as it is extracted.]" -"[V?Print the program version and exit.]" -"[+SEE ALSO?\bgunzip\b(1), \bpackage\b(1), \bpax\b(1), \bsear\b(1), \btar\b(1)]" -; - -#else - -#define NiL ((char*)0) - -#endif - -#define METER_width 80 -#define METER_parts 20 - -#ifndef _GUNZIP_H -#define _GUNZIP_H 1 - -/* - * stripped down zlib containing public gzfopen()+gzread() in one file - * USE THE REAL ZLIB AFTER BOOTSTRAP - */ - -#define ZLIB_INTERNAL 1 -#define NO_GZCOMPRESS 1 - -#define gz_headerp voidp - -#include -#include - -#if _PACKAGE_ast || defined(__STDC__) || defined(_SEAR_EXEC) || defined(_WIN32) - -#define FOPEN_READ "rb" -#define FOPEN_WRITE "wb" - -#else - -#define FOPEN_READ "r" -#define FOPEN_WRITE "w" - -#endif - -#ifndef O_BINARY -#define O_BINARY 0 -#endif - -#if _PACKAGE_ast - -#ifndef setmode -#define setmode(d,m) -#endif - -#else - -#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__) -#define _WINIX 1 -#endif - -#if _WIN32 && !_WINIX - -#include -#include -#include -#include - -#define access _access -#define chmod _chmod -#define close _close -#define dup _dup -#define lseek _lseek -#define open _open -#define read _read -#define setmode _setmode -#define unlink _unlink - -#define mkdir(a,b) _mkdir(a) - -#else - -#define HAVE_UNISTD_H 1 - -#include -#include - -#ifndef setmode -#define setmode(d,m) -#endif - -#endif - -#if defined(__STDC__) - -#include -#include - -#endif - -#endif - -#ifndef _ZLIB_H -#define _ZLIB_H 1 - -/* zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.3, July 18th, 2005 - - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler - - 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. - - Jean-loup Gailly Mark Adler - jloup@gzip.org madler@alumni.caltech.edu - - - The data format used by the zlib library is described by RFCs (Request for - Comments) 1950 to 1952 in the files http://www.ietf.org/rfc/rfc1950.txt - (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). -*/ - -#ifndef _ZCONF_H -#define _ZCONF_H 1 - -#if _PACKAGE_ast -#include /* for { _WINIX __IMPORT__ __EXPORT__ } */ -#define z_off_t int32_t -#if _typ_int64_t -#define z_off64_t int64_t -#endif -#else -#if !defined(_WINIX) && (_UWIN || __CYGWIN__ || __EMX__) -#define _WINIX 1 -#endif -#endif - -#if _BLD_z && defined(__EXPORT__) -#define ZEXTERN __EXPORT__ -#define ZEXPORT -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if HAVE_UNISTD_H -# include /* for off_t */ -# include /* for SEEK_* and off_t */ -# ifdef VMS -# include /* for off_t */ -# endif -# define z_off_t off_t -#endif -#ifndef SEEK_SET -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif -#ifndef z_off_t -# define z_off_t long -#endif - -#if defined(__OS400__) -# define NO_vsnprintf -#endif - -#if defined(__MVS__) -# define NO_vsnprintf -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) -# pragma map(deflateInit_,"DEIN") -# pragma map(deflateInit2_,"DEIN2") -# pragma map(deflateEnd,"DEEND") -# pragma map(deflateBound,"DEBND") -# pragma map(inflateInit_,"ININ") -# pragma map(inflateInit2_,"ININ2") -# pragma map(inflateEnd,"INEND") -# pragma map(inflateSync,"INSY") -# pragma map(inflateSetDictionary,"INSEDI") -# pragma map(compressBound,"CMBND") -# pragma map(inflate_table,"INTABL") -# pragma map(inflate_fast,"INFA") -# pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* _ZCONF_H */ - -#define ZLIB_VERSION "1.2.3" -#define ZLIB_VERNUM 0x1230 - -/* - The 'zlib' compression library provides in-memory compression and - decompression functions, including integrity checks of the uncompressed - data. This version of the library supports only one compression method - (deflation) but other algorithms will be added later and will have the same - stream interface. - - Compression can be done in a single step if the buffers are large - enough (for example if an input file is mmap'ed), or can be done by - repeated calls of the compression function. In the latter case, the - application must provide more input and/or consume the output - (providing more output space) before each call. - - The compressed data format used by default by the in-memory functions is - the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped - around a deflate stream, which is itself documented in RFC 1951. - - The library also supports reading and writing files in gzip (.gz) format - with an interface similar to that of stdio using the functions that start - with "gz". The gzip format is different from the zlib format. gzip is a - gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. - - This library can optionally read and write gzip streams in memory as well. - - The zlib format was designed to be compact and fast for use in memory - and on communications channels. The gzip format was designed for single- - file compression on file systems, has a larger header than zlib to maintain - directory information, and uses a different, slower check method than zlib. - - The library does not install any signal handler. The decoder checks - the consistency of the compressed data, so the library should never - crash even in case of corrupted input. -*/ - -typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); -typedef void (*free_func) OF((voidpf opaque, voidpf address)); - -struct internal_state; - -typedef struct z_stream_s { - Bytef *next_in; /* next input byte */ - uInt avail_in; /* number of bytes available at next_in */ - uLong total_in; /* total nb of input bytes read so far */ - - Bytef *next_out; /* next output byte should be put there */ - uInt avail_out; /* remaining free space at next_out */ - uLong total_out; /* total nb of bytes output so far */ - - char *msg; /* last error message, NULL if no error */ - struct internal_state FAR *state; /* not visible by applications */ - - alloc_func zalloc; /* used to allocate the internal state */ - free_func zfree; /* used to free the internal state */ - voidpf opaque; /* private data object passed to zalloc and zfree */ - - int data_type; /* best guess about the data type: binary or text */ - uLong adler; /* adler32 value of the uncompressed data */ - uLong reserved; /* reserved for future use */ -} z_stream; - -typedef z_stream FAR *z_streamp; - - /* constants */ - -#define Z_NO_FLUSH 0 -#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ -#define Z_SYNC_FLUSH 2 -#define Z_FULL_FLUSH 3 -#define Z_FINISH 4 -#define Z_BLOCK 5 -/* Allowed flush values; see deflate() and inflate() below for details */ - -#define Z_OK 0 -#define Z_STREAM_END 1 -#define Z_NEED_DICT 2 -#define Z_ERRNO (-1) -#define Z_STREAM_ERROR (-2) -#define Z_DATA_ERROR (-3) -#define Z_MEM_ERROR (-4) -#define Z_BUF_ERROR (-5) -#define Z_VERSION_ERROR (-6) -/* Return codes for the compression/decompression functions. Negative - * values are errors, positive values are used for special but normal events. - */ - -#define Z_NO_COMPRESSION 0 -#define Z_BEST_SPEED 1 -#define Z_BEST_COMPRESSION 9 -#define Z_DEFAULT_COMPRESSION (-1) -/* compression levels */ - -#define Z_FILTERED 1 -#define Z_HUFFMAN_ONLY 2 -#define Z_RLE 3 -#define Z_FIXED 4 -#define Z_DEFAULT_STRATEGY 0 -/* compression strategy; see deflateInit2() below for details */ - -#define Z_BINARY 0 -#define Z_TEXT 1 -#define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ -#define Z_UNKNOWN 2 -/* Possible values of the data_type field (though see inflate()) */ - -#define Z_DEFLATED 8 -/* The deflate compression method (the only one supported in this version) */ - -#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ - -#define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) - -#endif /* _ZLIB_H */ - -#ifndef _ZUTIL_H -#define _ZUTIL_H 1 - -#if !_PACKAGE_ast && !defined(STDC) -#if defined(__STDC__) -# include -#endif -# include -# include -#endif - -#ifndef local -# define local static -#endif -/* compile with -Dlocal if your debugger can't find static symbols */ - -typedef unsigned char uch; -typedef uch FAR uchf; -typedef unsigned short ush; -typedef ush FAR ushf; -typedef unsigned long ulg; - - /* common constants */ - -#ifndef DEF_WBITS -# define DEF_WBITS MAX_WBITS -#endif -/* default windowBits for decompression. MAX_WBITS is for compression only */ - -#if MAX_MEM_LEVEL >= 8 -# define DEF_MEM_LEVEL 8 -#else -# define DEF_MEM_LEVEL MAX_MEM_LEVEL -#endif -/* default memLevel */ - -#define STORED_BLOCK 0 -#define STATIC_TREES 1 -#define DYN_TREES 2 -/* The three kinds of block type */ - -#define MIN_MATCH 3 -#define MAX_MATCH 258 -/* The minimum and maximum match lengths */ - -#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ - - /* target dependencies */ - -#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) -# define OS_CODE 0x00 -# if defined(__TURBOC__) || defined(__BORLANDC__) -# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) - /* Allow compilation with ANSI keywords only enabled */ - void _Cdecl farfree( void *block ); - void *_Cdecl farmalloc( unsigned long nbytes ); -# else -# include -# endif -# else /* MSC or DJGPP */ -# include -# endif -#endif - -#ifdef AMIGA -# define OS_CODE 0x01 -#endif - -#if defined(VAXC) || defined(VMS) -# define OS_CODE 0x02 -# define F_OPEN(name, mode) \ - fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") -#endif - -#if defined(ATARI) || defined(atarist) -# define OS_CODE 0x05 -#endif - -#ifdef OS2 -# define OS_CODE 0x06 -# ifdef M_I86 - #include -# endif -#endif - -#if defined(MACOS) || defined(TARGET_OS_MAC) -# define OS_CODE 0x07 -# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fdopen */ -# else -# ifndef fdopen -# define fdopen(fd,mode) NULL /* No fdopen() */ -# endif -# endif -#endif - -#ifdef TOPS20 -# define OS_CODE 0x0a -#endif - -#ifdef WIN32 -# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ -# define OS_CODE 0x0b -# endif -#endif - -#ifdef __50SERIES /* Prime/PRIMOS */ -# define OS_CODE 0x0f -#endif - -#if defined(_BEOS_) || defined(RISCOS) -# define fdopen(fd,mode) NULL /* No fdopen() */ -#endif - -#if (defined(_MSC_VER) && (_MSC_VER > 600)) -# if defined(_WIN32_WCE) -# define fdopen(fd,mode) NULL /* No fdopen() */ -# ifndef _PTRDIFF_T_DEFINED - typedef int ptrdiff_t; -# define _PTRDIFF_T_DEFINED -# endif -# else -# define fdopen(fd,type) _fdopen(fd,type) -# endif -#endif - - /* common defaults */ - -#ifndef OS_CODE -# define OS_CODE 0x03 /* assume Unix */ -#endif - -#ifndef F_OPEN -# define F_OPEN(name, mode) fopen((name), (mode)) -#endif - - /* functions */ - -#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#if defined(__CYGWIN__) -# ifndef HAVE_VSNPRINTF -# define HAVE_VSNPRINTF -# endif -#endif -#ifndef HAVE_VSNPRINTF -# ifdef MSDOS - /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), - but for now we just assume it doesn't. */ -# define NO_vsnprintf -# endif -# ifdef __TURBOC__ -# define NO_vsnprintf -# endif -# ifdef WIN32 - /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ -# if !defined(vsnprintf) && !defined(NO_vsnprintf) -# define vsnprintf _vsnprintf -# endif -# endif -# ifdef __SASC -# define NO_vsnprintf -# endif -#endif -#ifdef VMS -# define NO_vsnprintf -#endif - -#if defined(pyr) -# define NO_MEMCPY -#endif -#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) - /* Use our own functions for small and medium model with MSC <= 5.0. - * You may have to use the same strategy for Borland C (untested). - * The __SC__ check is for Symantec. - */ -# define NO_MEMCPY -#endif -#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) -# define HAVE_MEMCPY -#endif -#ifdef HAVE_MEMCPY -# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ -# define zmemcpy _fmemcpy -# define zmemcmp _fmemcmp -# define zmemzero(dest, len) _fmemset(dest, 0, len) -# else -# define zmemcpy memcpy -# define zmemcmp memcmp -# define zmemzero(dest, len) memset(dest, 0, len) -# endif -#else - extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); - extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); - extern void zmemzero OF((Bytef* dest, uInt len)); -#endif - -/* Diagnostic functions */ -#ifdef Z_DEBUG -# include - extern int z_verbose; - extern void z_error OF((char *m)); -# define Assert(cond,msg) {if(!(cond)) z_error(msg);} -# define Trace(x) {if (z_verbose>=0) fprintf x ;} -# define Tracev(x) {if (z_verbose>0) fprintf x ;} -# define Tracevv(x) {if (z_verbose>1) fprintf x ;} -# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} -# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} -#else -# define Assert(cond,msg) -# define Trace(x) -# define Tracev(x) -# define Tracevv(x) -# define Tracec(c,x) -# define Tracecv(c,x) -#endif - - -voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); -void zcfree OF((voidpf opaque, voidpf ptr)); - -#define ZALLOC(strm, items, size) \ - (*((strm)->zalloc))((strm)->opaque, (items), (size)) -#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) -#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} -#endif /* _ZUTIL_H */ - -#ifndef _ZUTIL_C -#define _ZUTIL_C - -#if 0 && !_PACKAGE_ast && !defined(STDC) -extern void exit OF((int)); -#endif - -#ifndef HAVE_MEMCPY - -void zmemcpy(dest, source, len) - Bytef* dest; - const Bytef* source; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = *source++; /* ??? to be unrolled */ - } while (--len != 0); -} - -int zmemcmp(s1, s2, len) - const Bytef* s1; - const Bytef* s2; - uInt len; -{ - uInt j; - - for (j = 0; j < len; j++) { - if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; - } - return 0; -} - -void zmemzero(dest, len) - Bytef* dest; - uInt len; -{ - if (len == 0) return; - do { - *dest++ = 0; /* ??? to be unrolled */ - } while (--len != 0); -} -#endif - - -#ifdef SYS16BIT - -#ifdef __TURBOC__ -/* Turbo C in 16-bit mode */ - -# define MY_ZCALLOC - -/* Turbo C malloc() does not allow dynamic allocation of 64K bytes - * and farmalloc(64K) returns a pointer with an offset of 8, so we - * must fix the pointer. Warning: the pointer must be put back to its - * original form in order to free it, use zcfree(). - */ - -#define MAX_PTR 10 -/* 10*64K = 640K */ - -local int next_ptr = 0; - -typedef struct ptr_table_s { - voidpf org_ptr; - voidpf new_ptr; -} ptr_table; - -local ptr_table table[MAX_PTR]; -/* This table is used to remember the original form of pointers - * to large buffers (64K). Such pointers are normalized with a zero offset. - * Since MSDOS is not a preemptive multitasking OS, this table is not - * protected from concurrent access. This hack doesn't work anyway on - * a protected system like OS/2. Use Microsoft C instead. - */ - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - voidpf buf = opaque; /* just to make some compilers happy */ - ulg bsize = (ulg)items*size; - - /* If we allocate less than 65520 bytes, we assume that farmalloc - * will return a usable pointer which doesn't have to be normalized. - */ - if (bsize < 65520L) { - buf = farmalloc(bsize); - if (*(ush*)&buf != 0) return buf; - } else { - buf = farmalloc(bsize + 16L); - } - if (buf == NULL || next_ptr >= MAX_PTR) return NULL; - table[next_ptr].org_ptr = buf; - - /* Normalize the pointer to seg:0 */ - *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; - *(ush*)&buf = 0; - table[next_ptr++].new_ptr = buf; - return buf; -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - int n; - if (*(ush*)&ptr != 0) { /* object < 64K */ - farfree(ptr); - return; - } - /* Find the original pointer */ - for (n = 0; n < next_ptr; n++) { - if (ptr != table[n].new_ptr) continue; - - farfree(table[n].org_ptr); - while (++n < next_ptr) { - table[n-1] = table[n]; - } - next_ptr--; - return; - } - ptr = opaque; /* just to make some compilers happy */ - Assert(0, "zcfree: ptr not found"); -} - -#endif /* __TURBOC__ */ - - -#ifdef M_I86 -/* Microsoft C in 16-bit mode */ - -# define MY_ZCALLOC - -#if (!defined(_MSC_VER) || (_MSC_VER <= 600)) -# define _halloc halloc -# define _hfree hfree -#endif - -voidpf zcalloc (voidpf opaque, unsigned items, unsigned size) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - return _halloc((long)items, size); -} - -void zcfree (voidpf opaque, voidpf ptr) -{ - if (opaque) opaque = 0; /* to make compiler happy */ - _hfree(ptr); -} - -#endif /* M_I86 */ - -#endif /* SYS16BIT */ - - -#ifndef MY_ZCALLOC /* Any system without a special alloc function */ - -#if 0 && !_PACKAGE_ast -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern voidp calloc OF((uInt items, uInt size)); -extern void free OF((voidpf ptr)); -#endif -#endif - -voidpf zcalloc (opaque, items, size) - voidpf opaque; - unsigned items; - unsigned size; -{ - if (opaque) items += size - size; /* make compiler happy */ - return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : - (voidpf)calloc(items, size); -} - -void zcfree (opaque, ptr) - voidpf opaque; - voidpf ptr; -{ - free(ptr); - if (opaque) return; /* make compiler happy */ -} - -#endif /* MY_ZCALLOC */ - -#endif /* _ZUTIL_C */ - -#ifndef _CRC32_H -#define _CRC32_H 1 - -/* crc32.h -- tables for rapid CRC calculation - * Generated automatically by crc32.c - */ - -#ifndef TBLS -#define TBLS 1 -#endif - -local const unsigned long FAR crc_table[TBLS][256] = -{ - { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, - 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, - 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, - 0x90bf1d91, 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, - 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, 0x136c9856, - 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, - 0xfa0f3d63, 0x8d080df5, 0x3b6e20c8, 0x4c69105e, 0xd56041e4, - 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, - 0x45df5c75, 0xdcd60dcf, 0xabd13d59, 0x26d930ac, 0x51de003a, - 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, - 0xb8bda50f, 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, - 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, 0x76dc4190, - 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, - 0x9fbfe4a5, 0xe8b8d433, 0x7807c9a2, 0x0f00f934, 0x9609a88e, - 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, - 0x1b01a57b, 0x8208f4c1, 0xf50fc457, 0x65b0d9c6, 0x12b7e950, - 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, - 0xfbd44c65, 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, - 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, 0x4369e96a, - 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, - 0xaa0a4c5f, 0xdd0d7cc9, 0x5005713c, 0x270241aa, 0xbe0b1010, - 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, - 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, 0xedb88320, 0x9abfb3b6, - 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, - 0x73dc1683, 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, - 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, 0xf00f9344, - 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, - 0x196c3671, 0x6e6b06e7, 0xfed41b76, 0x89d32be0, 0x10da7a5a, - 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, - 0xa6bc5767, 0x3fb506dd, 0x48b2364b, 0xd80d2bda, 0xaf0a1b4c, - 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, - 0x4669be79, 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, - 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, 0xc5ba3bbe, - 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, - 0x2cd99e8b, 0x5bdeae1d, 0x9b64c2b0, 0xec63f226, 0x756aa39c, - 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, - 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, 0x86d3d2d4, 0xf1d4e242, - 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, - 0x18b74777, 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, - 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, 0xa00ae278, - 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, - 0x4969474d, 0x3e6e77db, 0xaed16a4a, 0xd9d65adc, 0x40df0b66, - 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, - 0xcdd70693, 0x54de5729, 0x23d967bf, 0xb3667a2e, 0xc4614ab8, - 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, - 0x2d02ef8d - }, -}; - -#endif /* _CRC32_H */ - -#ifndef _CRC32_C -#define _CRC32_C 1 - -/* ========================================================================= */ -#define DO1 crc = crc_table[0][((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8) -#define DO8 DO1; DO1; DO1; DO1; DO1; DO1; DO1; DO1 - -/* ========================================================================= */ -unsigned long ZEXPORT crc32(crc, buf, len) - unsigned long crc; - const unsigned char FAR *buf; - unsigned len; -{ - if (buf == Z_NULL) return 0; - -#ifdef DYNAMIC_CRC_TABLE - if (crc_table_empty) - make_crc_table(); -#endif /* DYNAMIC_CRC_TABLE */ - -#ifdef BYFOUR - if (sizeof(void *) == sizeof(ptrdiff_t)) { - u4 endian; - - endian = 1; - if (*((unsigned char *)(&endian))) - return crc32_little(crc, buf, len); - else - return crc32_big(crc, buf, len); - } -#endif /* BYFOUR */ - crc = crc ^ 0xffffffff; - while (len >= 8) { - DO8; - len -= 8; - } - if (len) do { - DO1; - } while (--len); - return crc ^ 0xffffffff; -} - -#undef DO1 -#undef DO8 - -#endif /* _CRC32_C */ - -#ifndef _ADLER32_C -#define _ADLER32_C 1 - -#define BASE 65521 /* largest prime smaller than 65536 */ -#define NMAX 5552 -/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ - -#define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} -#define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); -#define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); -#define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); -#define DO16(buf) DO8(buf,0); DO8(buf,8); - -/* use NO_DIVIDE if your processor does not do division in hardware */ -#ifdef NO_DIVIDE -# define MOD(a) \ - do { \ - if (a >= (BASE << 16)) a -= (BASE << 16); \ - if (a >= (BASE << 15)) a -= (BASE << 15); \ - if (a >= (BASE << 14)) a -= (BASE << 14); \ - if (a >= (BASE << 13)) a -= (BASE << 13); \ - if (a >= (BASE << 12)) a -= (BASE << 12); \ - if (a >= (BASE << 11)) a -= (BASE << 11); \ - if (a >= (BASE << 10)) a -= (BASE << 10); \ - if (a >= (BASE << 9)) a -= (BASE << 9); \ - if (a >= (BASE << 8)) a -= (BASE << 8); \ - if (a >= (BASE << 7)) a -= (BASE << 7); \ - if (a >= (BASE << 6)) a -= (BASE << 6); \ - if (a >= (BASE << 5)) a -= (BASE << 5); \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -# define MOD4(a) \ - do { \ - if (a >= (BASE << 4)) a -= (BASE << 4); \ - if (a >= (BASE << 3)) a -= (BASE << 3); \ - if (a >= (BASE << 2)) a -= (BASE << 2); \ - if (a >= (BASE << 1)) a -= (BASE << 1); \ - if (a >= BASE) a -= BASE; \ - } while (0) -#else -# define MOD(a) a %= BASE -# define MOD4(a) a %= BASE -#endif - -/* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) - uLong adler; - const Bytef *buf; - uInt len; -{ - unsigned long sum2; - unsigned n; - - /* split Adler-32 into component sums */ - sum2 = (adler >> 16) & 0xffff; - adler &= 0xffff; - - /* in case user likes doing a byte at a time, keep it fast */ - if (len == 1) { - adler += buf[0]; - if (adler >= BASE) - adler -= BASE; - sum2 += adler; - if (sum2 >= BASE) - sum2 -= BASE; - return adler | (sum2 << 16); - } - - /* initial Adler-32 value (deferred check for len == 1 speed) */ - if (buf == Z_NULL) - return 1L; - - /* in case short lengths are provided, keep it somewhat fast */ - if (len < 16) { - while (len--) { - adler += *buf++; - sum2 += adler; - } - if (adler >= BASE) - adler -= BASE; - MOD4(sum2); /* only added so many BASE's */ - return adler | (sum2 << 16); - } - - /* do length NMAX blocks -- requires just one modulo operation */ - while (len >= NMAX) { - len -= NMAX; - n = NMAX / 16; /* NMAX is divisible by 16 */ - do { - DO16(buf); /* 16 sums unrolled */ - buf += 16; - } while (--n); - MOD(adler); - MOD(sum2); - } - - /* do remaining bytes (less than NMAX, still just one modulo) */ - if (len) { /* avoid modulos if none remaining */ - while (len >= 16) { - len -= 16; - DO16(buf); - buf += 16; - } - while (len--) { - adler += *buf++; - sum2 += adler; - } - MOD(adler); - MOD(sum2); - } - - /* return recombined sums */ - return adler | (sum2 << 16); -} - -#endif /* _ADLER32_C */ - -#ifndef _DEFLATE_H -#define _DEFLATE_H 1 - -/* =========================================================================== - * Internal compression state. - */ - -#define LENGTH_CODES 29 -/* number of length codes, not counting the special END_BLOCK code */ - -#define LITERALS 256 -/* number of literal bytes 0..255 */ - -#define L_CODES (LITERALS+1+LENGTH_CODES) -/* number of Literal or Length codes, including the END_BLOCK code */ - -#define D_CODES 30 -/* number of distance codes */ - -#define BL_CODES 19 -/* number of codes used to transfer the bit lengths */ - -#define HEAP_SIZE (2*L_CODES+1) -/* maximum heap size */ - -#define MAX_BITS 15 -/* All codes must not exceed MAX_BITS bits */ - -#define INIT_STATE 42 -#define EXTRA_STATE 69 -#define NAME_STATE 73 -#define COMMENT_STATE 91 -#define HCRC_STATE 103 -#define BUSY_STATE 113 -#define FINISH_STATE 666 -/* Stream status */ - - -/* Data structure describing a single value and its code string. */ -typedef struct ct_data_s { - union { - ush freq; /* frequency count */ - ush code; /* bit string */ - } fc; - union { - ush dad; /* father node in Huffman tree */ - ush len; /* length of bit string */ - } dl; -} FAR ct_data; - -#define Freq fc.freq -#define Code fc.code -#define Dad dl.dad -#define Len dl.len - -typedef struct static_tree_desc_s static_tree_desc; - -typedef struct tree_desc_s { - ct_data *dyn_tree; /* the dynamic tree */ - int max_code; /* largest code with non zero frequency */ - static_tree_desc *stat_desc; /* the corresponding static tree */ -} FAR tree_desc; - -typedef ush Pos; -typedef Pos FAR Posf; -typedef unsigned IPos; - -/* A Pos is an index in the character window. We use short instead of int to - * save space in the various tables. IPos is used only for parameter passing. - */ - -typedef struct internal_state { - z_streamp strm; /* pointer back to this zlib stream */ - int status; /* as the name implies */ - Bytef *pending_buf; /* output still pending */ - ulg pending_buf_size; /* size of pending_buf */ - Bytef *pending_out; /* next pending byte to output to the stream */ - uInt pending; /* nb of bytes in the pending buffer */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - gz_headerp gzhead; /* gzip header information to write */ - uInt gzindex; /* where in extra, name, or comment */ - Byte method; /* STORED (for zip only) or DEFLATED */ - int last_flush; /* value of flush param for previous deflate call */ - - /* used by deflate.c: */ - - uInt w_size; /* LZ77 window size (32K by default) */ - uInt w_bits; /* log2(w_size) (8..16) */ - uInt w_mask; /* w_size - 1 */ - - Bytef *window; - /* Sliding window. Input bytes are read into the second half of the window, - * and move to the first half later to keep a dictionary of at least wSize - * bytes. With this organization, matches are limited to a distance of - * wSize-MAX_MATCH bytes, but this ensures that IO is always - * performed with a length multiple of the block size. Also, it limits - * the window size to 64K, which is quite useful on MSDOS. - * To do: use the user input buffer as sliding window. - */ - - ulg window_size; - /* Actual size of window: 2*wSize, except when the user input buffer - * is directly used as sliding window. - */ - - Posf *prev; - /* Link to older string with same hash index. To limit the size of this - * array to 64K, this link is maintained only for the last 32K strings. - * An index in this array is thus a window index modulo 32K. - */ - - Posf *head; /* Heads of the hash chains or NIL. */ - - uInt ins_h; /* hash index of string to be inserted */ - uInt hash_size; /* number of elements in hash table */ - uInt hash_bits; /* log2(hash_size) */ - uInt hash_mask; /* hash_size-1 */ - - uInt hash_shift; - /* Number of bits by which ins_h must be shifted at each input - * step. It must be such that after MIN_MATCH steps, the oldest - * byte no longer takes part in the hash key, that is: - * hash_shift * MIN_MATCH >= hash_bits - */ - - long block_start; - /* Window position at the beginning of the current output block. Gets - * negative when the window is moved backwards. - */ - - uInt match_length; /* length of best match */ - IPos prev_match; /* previous match */ - int match_available; /* set if previous match exists */ - uInt strstart; /* start of string to insert */ - uInt match_start; /* start of matching string */ - uInt lookahead; /* number of valid bytes ahead in window */ - - uInt prev_length; - /* Length of the best match at previous step. Matches not greater than this - * are discarded. This is used in the lazy match evaluation. - */ - - uInt max_chain_length; - /* To speed up deflation, hash chains are never searched beyond this - * length. A higher limit improves compression ratio but degrades the - * speed. - */ - - uInt max_lazy_match; - /* Attempt to find a better match only when the current match is strictly - * smaller than this value. This mechanism is used only for compression - * levels >= 4. - */ -# define max_insert_length max_lazy_match - /* Insert new strings in the hash table only if the match length is not - * greater than this length. This saves time but degrades compression. - * max_insert_length is used only for compression levels <= 3. - */ - - int level; /* compression level (1..9) */ - int strategy; /* favor or force Huffman coding*/ - - uInt good_match; - /* Use a faster search when the previous match is longer than this */ - - int nice_match; /* Stop searching when current match exceeds this */ - - /* used by trees.c: */ - /* Didn't use ct_data typedef below to suppress compiler warning */ - struct ct_data_s dyn_ltree[HEAP_SIZE]; /* literal and length tree */ - struct ct_data_s dyn_dtree[2*D_CODES+1]; /* distance tree */ - struct ct_data_s bl_tree[2*BL_CODES+1]; /* Huffman tree for bit lengths */ - - struct tree_desc_s l_desc; /* desc. for literal tree */ - struct tree_desc_s d_desc; /* desc. for distance tree */ - struct tree_desc_s bl_desc; /* desc. for bit length tree */ - - ush bl_count[MAX_BITS+1]; - /* number of codes at each bit length for an optimal tree */ - - int heap[2*L_CODES+1]; /* heap used to build the Huffman trees */ - int heap_len; /* number of elements in the heap */ - int heap_max; /* element of largest frequency */ - /* The sons of heap[n] are heap[2*n] and heap[2*n+1]. heap[0] is not used. - * The same heap array is used to build all trees. - */ - - uch depth[2*L_CODES+1]; - /* Depth of each subtree used as tie breaker for trees of equal frequency - */ - - uchf *l_buf; /* buffer for literals or lengths */ - - uInt lit_bufsize; - /* Size of match buffer for literals/lengths. There are 4 reasons for - * limiting lit_bufsize to 64K: - * - frequencies can be kept in 16 bit counters - * - if compression is not successful for the first block, all input - * data is still in the window so we can still emit a stored block even - * when input comes from standard input. (This can also be done for - * all blocks if lit_bufsize is not greater than 32K.) - * - if compression is not successful for a file smaller than 64K, we can - * even emit a stored file instead of a stored block (saving 5 bytes). - * This is applicable only for zip (not gzip or zlib). - * - creating new Huffman trees less frequently may not provide fast - * adaptation to changes in the input data statistics. (Take for - * example a binary file with poorly compressible code followed by - * a highly compressible string table.) Smaller buffer sizes give - * fast adaptation but have of course the overhead of transmitting - * trees more frequently. - * - I can't count above 4 - */ - - uInt last_lit; /* running index in l_buf */ - - ushf *d_buf; - /* Buffer for distances. To simplify the code, d_buf and l_buf have - * the same number of elements. To use different lengths, an extra flag - * array would be necessary. - */ - - ulg opt_len; /* bit length of current block with optimal trees */ - ulg static_len; /* bit length of current block with static trees */ - uInt matches; /* number of string matches in current block */ - int last_eob_len; /* bit length of EOB code for last block */ - -#ifdef Z_DEBUG - ulg compressed_len; /* total bit length of compressed file mod 2^32 */ - ulg bits_sent; /* bit length of compressed data sent mod 2^32 */ -#endif - - ush bi_buf; - /* Output buffer. bits are inserted starting at the bottom (least - * significant bits). - */ - int bi_valid; - /* Number of valid bits in bi_buf. All bits above the last valid bit - * are always zero. - */ - -} FAR deflate_state; - -/* Output a byte on the stream. - * IN assertion: there is enough room in pending_buf. - */ -#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} - - -#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) -/* Minimum amount of lookahead, except at the end of the input file. - * See deflate.c for comments about the MIN_MATCH+1. - */ - -#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) -/* In order to simplify the code, particularly on 16 bit machines, match - * distances are limited to MAX_DIST instead of WSIZE. - */ - - /* in trees.c */ -void _tr_init OF((deflate_state *s)); -int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); -void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); -void _tr_align OF((deflate_state *s)); -void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, - int eof)); - -#define d_code(dist) \ - ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) -/* Mapping from a distance to a distance code. dist is the distance - 1 and - * must not have side effects. _dist_code[256] and _dist_code[257] are never - * used. - */ - -#ifndef Z_DEBUG -/* Inline versions of _tr_tally for speed: */ - -#if defined(GEN_TREES_H) || !defined(STDC) - extern uch _length_code[]; - extern uch _dist_code[]; -#else - extern const uch _length_code[]; - extern const uch _dist_code[]; -#endif - -# define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ - s->d_buf[s->last_lit] = 0; \ - s->l_buf[s->last_lit++] = cc; \ - s->dyn_ltree[cc].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -# define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ - s->d_buf[s->last_lit] = dist; \ - s->l_buf[s->last_lit++] = len; \ - dist--; \ - s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \ - s->dyn_dtree[d_code(dist)].Freq++; \ - flush = (s->last_lit == s->lit_bufsize-1); \ - } -#else -# define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) -# define _tr_tally_dist(s, distance, length, flush) \ - flush = _tr_tally(s, distance, length) -#endif - -#endif /* _DEFLATE_H */ - -#ifndef _INFTREES_H -#define _INFTREES_H 1 - -typedef struct { - unsigned char op; /* operation, extra bits, table bits */ - unsigned char bits; /* bits in this part of the code */ - unsigned short val; /* offset in table or code value */ -} code; - -/* op values as set by inflate_table(): - 00000000 - literal - 0000tttt - table link, tttt != 0 is the number of table index bits - 0001eeee - length or distance, eeee is the number of extra bits - 01100000 - end of block - 01000000 - invalid code - */ - -/* Maximum size of dynamic tree. The maximum found in a long but non- - exhaustive search was 1444 code structures (852 for length/literals - and 592 for distances, the latter actually the result of an - exhaustive search). The true maximum is not known, but the value - below is more than safe. */ -#define ENOUGH 2048 -#define MAXD 592 - -/* Type of code to build for inftable() */ -typedef enum { - CODES, - LENS, - DISTS -} codetype; - -#endif /* _INFTREES_H */ - -#ifndef _INFLATE_H -#define _INFLATE_H 1 - -/* Possible inflate modes between inflate() calls */ -typedef enum { - HEAD, /* i: waiting for magic header */ - FLAGS, /* i: waiting for method and flags (gzip) */ - TIME, /* i: waiting for modification time (gzip) */ - OS, /* i: waiting for extra flags and operating system (gzip) */ - EXLEN, /* i: waiting for extra length (gzip) */ - EXTRA, /* i: waiting for extra bytes (gzip) */ - NAME, /* i: waiting for end of file name (gzip) */ - COMMENT, /* i: waiting for end of comment (gzip) */ - HCRC, /* i: waiting for header crc (gzip) */ - DICTID, /* i: waiting for dictionary check value */ - DICT, /* waiting for inflateSetDictionary() call */ - TYPE, /* i: waiting for type bits, including last-flag bit */ - TYPEDO, /* i: same, but skip check to exit inflate on new block */ - STORED, /* i: waiting for stored size (length and complement) */ - COPY, /* i/o: waiting for input or output to copy stored block */ - TABLE, /* i: waiting for dynamic block table lengths */ - LENLENS, /* i: waiting for code length code lengths */ - CODELENS, /* i: waiting for length/lit and distance code lengths */ - LEN, /* i: waiting for length/lit code */ - LENEXT, /* i: waiting for length extra bits */ - DIST, /* i: waiting for distance code */ - DISTEXT, /* i: waiting for distance extra bits */ - MATCH, /* o: waiting for output space to copy string */ - LIT, /* o: waiting for output space to write literal */ - CHECK, /* i: waiting for 32-bit check value */ - LENGTH, /* i: waiting for 32-bit length (gzip) */ - DONE, /* finished check, done -- remain here until reset */ - BAD, /* got a data error -- remain here until reset */ - MEM, /* got an inflate() memory error -- remain here until reset */ - SYNC /* looking for synchronization bytes to restart inflate() */ -} inflate_mode; - -/* - State transitions between above modes - - - (most modes can go to the BAD or MEM mode -- not shown for clarity) - - Process header: - HEAD -> (gzip) or (zlib) - (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME - NAME -> COMMENT -> HCRC -> TYPE - (zlib) -> DICTID or TYPE - DICTID -> DICT -> TYPE - Read deflate blocks: - TYPE -> STORED or TABLE or LEN or CHECK - STORED -> COPY -> TYPE - TABLE -> LENLENS -> CODELENS -> LEN - Read deflate codes: - LEN -> LENEXT or LIT or TYPE - LENEXT -> DIST -> DISTEXT -> MATCH -> LEN - LIT -> LEN - Process trailer: - CHECK -> LENGTH -> DONE - */ - -/* state maintained between inflate() calls. Approximately 7K bytes. */ -struct inflate_state { - inflate_mode mode; /* current inflate mode */ - int last; /* true if processing last block */ - int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ - int havedict; /* true if dictionary provided */ - int flags; /* gzip header method and flags (0 if zlib) */ - unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ - unsigned long check; /* protected copy of check value */ - unsigned long total; /* protected copy of output count */ - gz_headerp head; /* where to save gzip header information */ - /* sliding window */ - unsigned wbits; /* log base 2 of requested window size */ - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if needed */ - /* bit accumulator */ - unsigned long hold; /* input bit accumulator */ - unsigned bits; /* number of bits in "in" */ - /* for string and stored block copying */ - unsigned length; /* literal or length of data to copy */ - unsigned offset; /* distance back to copy string from */ - /* for table and code decoding */ - unsigned extra; /* extra bits needed */ - /* fixed and dynamic code tables */ - code const FAR *lencode; /* starting table for length/literal codes */ - code const FAR *distcode; /* starting table for distance codes */ - unsigned lenbits; /* index bits for lencode */ - unsigned distbits; /* index bits for distcode */ - /* dynamic table building */ - unsigned ncode; /* number of code length code lengths */ - unsigned nlen; /* number of length code lengths */ - unsigned ndist; /* number of distance code lengths */ - unsigned have; /* number of code lengths in lens[] */ - code FAR *next; /* next available space in codes[] */ - unsigned short lens[320]; /* temporary storage for code lengths */ - unsigned short work[288]; /* work area for code table building */ - code codes[ENOUGH]; /* space for code tables */ -}; -#endif /* _INFLATE_H */ - -#ifndef _INFTREES_C -#define _INFTREES_C 1 - -#define MAXBITS 15 - -const char inflate_copyright[] = - " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; -/* - If you use the zlib library in a product, an acknowledgment is welcome - in the documentation of your product. If for some reason you cannot - include such an acknowledgment, I would appreciate that you keep this - copyright string in the executable of your product. - */ - -/* - Build a set of tables to decode the provided canonical Huffman code. - The code lengths are lens[0..codes-1]. The result starts at *table, - whose indices are 0..2^bits-1. work is a writable array of at least - lens shorts, which is used as a work area. type is the type of code - to be generated, CODES, LENS, or DISTS. On return, zero is success, - -1 is an invalid code, and +1 means that ENOUGH isn't enough. table - on return points to the next available entry's address. bits is the - requested root table index bits, and on return it is the actual root - table index bits. It will differ if the request is greater than the - longest code or if it is less than the shortest code. - */ -int inflate_table(type, lens, codes, table, bits, work) -codetype type; -unsigned short FAR *lens; -unsigned codes; -code FAR * FAR *table; -unsigned FAR *bits; -unsigned short FAR *work; -{ - unsigned len; /* a code's length in bits */ - unsigned sym; /* index of code symbols */ - unsigned min, max; /* minimum and maximum code lengths */ - unsigned root; /* number of index bits for root table */ - unsigned curr; /* number of index bits for current table */ - unsigned drop; /* code bits to drop for sub-table */ - int left; /* number of prefix codes available */ - unsigned used; /* code entries in table used */ - unsigned huff; /* Huffman code */ - unsigned incr; /* for incrementing code, index */ - unsigned fill; /* index for replicating entries */ - unsigned low; /* low bits for current root entry */ - unsigned mask; /* mask for low root bits */ - code this; /* table entry for duplication */ - code FAR *next; /* next available space in table */ - const unsigned short FAR *base; /* base value table to use */ - const unsigned short FAR *extra; /* extra bits table to use */ - int end; /* use base and extra for symbol > end */ - unsigned short count[MAXBITS+1]; /* number of codes of each length */ - unsigned short offs[MAXBITS+1]; /* offsets in table for each length */ - static const unsigned short lbase[31] = { /* Length codes 257..285 base */ - 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, - 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; - static const unsigned short lext[31] = { /* Length codes 257..285 extra */ - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, - 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; - static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ - 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, - 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, - 8193, 12289, 16385, 24577, 0, 0}; - static const unsigned short dext[32] = { /* Distance codes 0..29 extra */ - 16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 29, 29, 64, 64}; - - /* - Process a set of code lengths to create a canonical Huffman code. The - code lengths are lens[0..codes-1]. Each length corresponds to the - symbols 0..codes-1. The Huffman code is generated by first sorting the - symbols by length from short to long, and retaining the symbol order - for codes with equal lengths. Then the code starts with all zero bits - for the first code of the shortest length, and the codes are integer - increments for the same length, and zeros are appended as the length - increases. For the deflate format, these bits are stored backwards - from their more natural integer increment ordering, and so when the - decoding tables are built in the large loop below, the integer codes - are incremented backwards. - - This routine assumes, but does not check, that all of the entries in - lens[] are in the range 0..MAXBITS. The caller must assure this. - 1..MAXBITS is interpreted as that code length. zero means that that - symbol does not occur in this code. - - The codes are sorted by computing a count of codes for each length, - creating from that a table of starting indices for each length in the - sorted table, and then entering the symbols in order in the sorted - table. The sorted table is work[], with that space being provided by - the caller. - - The length counts are used for other purposes as well, i.e. finding - the minimum and maximum length codes, determining if there are any - codes at all, checking for a valid set of lengths, and looking ahead - at length counts to determine sub-table sizes when building the - decoding tables. - */ - - /* accumulate lengths for codes (assumes lens[] all in 0..MAXBITS) */ - for (len = 0; len <= MAXBITS; len++) - count[len] = 0; - for (sym = 0; sym < codes; sym++) - count[lens[sym]]++; - - /* bound code lengths, force root to be within code lengths */ - root = *bits; - for (max = MAXBITS; max >= 1; max--) - if (count[max] != 0) break; - if (root > max) root = max; - if (max == 0) { /* no symbols to code at all */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)1; - this.val = (unsigned short)0; - *(*table)++ = this; /* make a table to force an error */ - *(*table)++ = this; - *bits = 1; - return 0; /* no symbols, but wait for decoding to report error */ - } - for (min = 1; min <= MAXBITS; min++) - if (count[min] != 0) break; - if (root < min) root = min; - - /* check for an over-subscribed or incomplete set of lengths */ - left = 1; - for (len = 1; len <= MAXBITS; len++) { - left <<= 1; - left -= count[len]; - if (left < 0) return -1; /* over-subscribed */ - } - if (left > 0 && (type == CODES || max != 1)) - return -1; /* incomplete set */ - - /* generate offsets into symbol table for each length for sorting */ - offs[1] = 0; - for (len = 1; len < MAXBITS; len++) - offs[len + 1] = offs[len] + count[len]; - - /* sort symbols by length, by symbol order within each length */ - for (sym = 0; sym < codes; sym++) - if (lens[sym] != 0) work[offs[lens[sym]]++] = (unsigned short)sym; - - /* - Create and fill in decoding tables. In this loop, the table being - filled is at next and has curr index bits. The code being used is huff - with length len. That code is converted to an index by dropping drop - bits off of the bottom. For codes where len is less than drop + curr, - those top drop + curr - len bits are incremented through all values to - fill the table with replicated entries. - - root is the number of index bits for the root table. When len exceeds - root, sub-tables are created pointed to by the root entry with an index - of the low root bits of huff. This is saved in low to check for when a - new sub-table should be started. drop is zero when the root table is - being filled, and drop is root when sub-tables are being filled. - - When a new sub-table is needed, it is necessary to look ahead in the - code lengths to determine what size sub-table is needed. The length - counts are used for this, and so count[] is decremented as codes are - entered in the tables. - - used keeps track of how many table entries have been allocated from the - provided *table space. It is checked when a LENS table is being made - against the space in *table, ENOUGH, minus the maximum space needed by - the worst case distance code, MAXD. This should never happen, but the - sufficiency of ENOUGH has not been proven exhaustively, hence the check. - This assumes that when type == LENS, bits == 9. - - sym increments through all symbols, and the loop terminates when - all codes of length max, i.e. all codes, have been processed. This - routine permits incomplete codes, so another loop after this one fills - in the rest of the decoding tables with invalid code markers. - */ - - /* set up for code type */ - switch (type) { - case CODES: - base = extra = work; /* dummy value--not used */ - end = 19; - break; - case LENS: - base = lbase; - base -= 257; - extra = lext; - extra -= 257; - end = 256; - break; - default: /* DISTS */ - base = dbase; - extra = dext; - end = -1; - } - - /* initialize state for loop */ - huff = 0; /* starting code */ - sym = 0; /* starting code symbol */ - len = min; /* starting code length */ - next = *table; /* current table to fill in */ - curr = root; /* current table index bits */ - drop = 0; /* current bits to drop from code for index */ - low = (unsigned)(-1); /* trigger new sub-table when len > root */ - used = ((unsigned int)1) << root; /* use root table entries */ - mask = used - 1; /* mask for comparing low */ - - /* check available table space */ - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* process all codes and make table entries */ - for (;;) { - /* create table entry */ - this.bits = (unsigned char)(len - drop); - if ((int)(work[sym]) < end) { - this.op = (unsigned char)0; - this.val = work[sym]; - } - else if ((int)(work[sym]) > end) { - this.op = (unsigned char)(extra[work[sym]]); - this.val = base[work[sym]]; - } - else { - this.op = (unsigned char)(32 + 64); /* end of block */ - this.val = 0; - } - - /* replicate for those indices with low len bits equal to huff */ - incr = ((unsigned int)1) << (len - drop); - fill = ((unsigned int)1) << curr; - min = fill; /* save offset to next table */ - do { - fill -= incr; - next[(huff >> drop) + fill] = this; - } while (fill != 0); - - /* backwards increment the len-bit code huff */ - incr = ((unsigned int)1) << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - - /* go to next symbol, update count, len */ - sym++; - if (--(count[len]) == 0) { - if (len == max) break; - len = lens[work[sym]]; - } - - /* create new sub-table if needed */ - if (len > root && (huff & mask) != low) { - /* if first time, transition to sub-tables */ - if (drop == 0) - drop = root; - - /* increment past last table */ - next += min; /* here min is 1 << curr */ - - /* determine length of next table */ - curr = len - drop; - left = (int)(1 << curr); - while (curr + drop < max) { - left -= count[curr + drop]; - if (left <= 0) break; - curr++; - left <<= 1; - } - - /* check for enough space */ - used += ((unsigned int)1) << curr; - if (type == LENS && used >= ENOUGH - MAXD) - return 1; - - /* point entry in root table to sub-table */ - low = huff & mask; - (*table)[low].op = (unsigned char)curr; - (*table)[low].bits = (unsigned char)root; - (*table)[low].val = (unsigned short)(next - *table); - } - } - - /* - Fill in rest of table for incomplete codes. This loop is similar to the - loop above in incrementing huff for table indices. It is assumed that - len is equal to curr + drop, so there is no loop needed to increment - through high index bits. When the current sub-table is filled, the loop - drops back to the root table to fill in any remaining entries there. - */ - this.op = (unsigned char)64; /* invalid code marker */ - this.bits = (unsigned char)(len - drop); - this.val = (unsigned short)0; - while (huff != 0) { - /* when done with sub-table, drop back to root table */ - if (drop != 0 && (huff & mask) != low) { - drop = 0; - len = root; - next = *table; - this.bits = (unsigned char)len; - } - - /* put invalid code marker in table */ - next[huff >> drop] = this; - - /* backwards increment the len-bit code huff */ - incr = ((unsigned int)1) << (len - 1); - while (huff & incr) - incr >>= 1; - if (incr != 0) { - huff &= incr - 1; - huff += incr; - } - else - huff = 0; - } - - /* set return parameters */ - *table += used; - *bits = root; - return 0; -} - -#endif /* _INFTREES_C */ - -#ifndef _INFFAST_C -#define _INFFAST_C 1 - -/* Allow machine dependent optimization for post-increment or pre-increment. - Based on testing to date, - Pre-increment preferred for: - - PowerPC G3 (Adler) - - MIPS R5000 (Randers-Pehrson) - Post-increment preferred for: - - none - No measurable difference: - - Pentium III (Anderson) - - M68060 (Nikl) - */ -#undef OFF /* (ancient) sunos */ -#ifdef POSTINC -# define OFF 0 -# define PUP(a) *(a)++ -#else -# define OFF 1 -# define PUP(a) *++(a) -#endif - -/* - Decode literal, length, and distance codes and write out the resulting - literal and match bytes until either not enough input or output is - available, an end-of-block is encountered, or a data error is encountered. - When large enough input and output buffers are supplied to inflate(), for - example, a 16K input buffer and a 64K output buffer, more than 95% of the - inflate execution time is spent in this routine. - - Entry assumptions: - - state->mode == LEN - strm->avail_in >= 6 - strm->avail_out >= 258 - start >= strm->avail_out - state->bits < 8 - - On return, state->mode is one of: - - LEN -- ran out of enough output space or enough available input - TYPE -- reached end of block code, inflate() to interpret next block - BAD -- error in block data - - Notes: - - - The maximum input bits used by a length/distance pair is 15 bits for the - length code, 5 bits for the length extra, 15 bits for the distance code, - and 13 bits for the distance extra. This totals 48 bits, or six bytes. - Therefore if strm->avail_in >= 6, then there is enough input to avoid - checking for available input while decoding. - - - The maximum bytes that a single length/distance pair can output is 258 - bytes, which is the maximum length that can be coded. inflate_fast() - requires strm->avail_out >= 258 for each loop to avoid checking for - output space. - */ -void inflate_fast(strm, start) -z_streamp strm; -unsigned start; /* inflate()'s starting value for strm->avail_out */ -{ - struct inflate_state FAR *state; - unsigned char FAR *in; /* local strm->next_in */ - unsigned char FAR *last; /* while in < last, enough input available */ - unsigned char FAR *out; /* local strm->next_out */ - unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ - unsigned char FAR *end; /* while out < end, enough space available */ -#ifdef INFLATE_STRICT - unsigned dmax; /* maximum distance from zlib header */ -#endif - unsigned wsize; /* window size or zero if not using window */ - unsigned whave; /* valid bytes in the window */ - unsigned write; /* window write index */ - unsigned char FAR *window; /* allocated sliding window, if wsize != 0 */ - unsigned long hold; /* local strm->hold */ - unsigned bits; /* local strm->bits */ - code const FAR *lcode; /* local strm->lencode */ - code const FAR *dcode; /* local strm->distcode */ - unsigned lmask; /* mask for first level of length codes */ - unsigned dmask; /* mask for first level of distance codes */ - code this; /* retrieved table entry */ - unsigned op; /* code bits, operation, extra bits, or */ - /* window position, window bytes to copy */ - unsigned len; /* match length, unused bytes */ - unsigned dist; /* match distance */ - unsigned char FAR *from; /* where to copy match from */ - - /* copy state to local variables */ - state = (struct inflate_state FAR *)strm->state; - in = strm->next_in - OFF; - last = in + (strm->avail_in - 5); - out = strm->next_out - OFF; - beg = out - (start - strm->avail_out); - end = out + (strm->avail_out - 257); -#ifdef INFLATE_STRICT - dmax = state->dmax; -#endif - wsize = state->wsize; - whave = state->whave; - write = state->write; - window = state->window; - hold = state->hold; - bits = state->bits; - lcode = state->lencode; - dcode = state->distcode; - lmask = (((unsigned int)1) << state->lenbits) - 1; - dmask = (((unsigned int)1) << state->distbits) - 1; - - /* decode literals and length/distances until end-of-block or not enough - input data or output space */ - do { - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = lcode[hold & lmask]; - dolen: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op == 0) { /* literal */ - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - PUP(out) = (unsigned char)(this.val); - } - else if (op & 16) { /* length base */ - len = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (op) { - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - len += (unsigned)hold & ((((unsigned int)1) << op) - 1); - hold >>= op; - bits -= op; - } - Tracevv((stderr, "inflate: length %u\n", len)); - if (bits < 15) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - this = dcode[hold & dmask]; - dodist: - op = (unsigned)(this.bits); - hold >>= op; - bits -= op; - op = (unsigned)(this.op); - if (op & 16) { /* distance base */ - dist = (unsigned)(this.val); - op &= 15; /* number of extra bits */ - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - if (bits < op) { - hold += (unsigned long)(PUP(in)) << bits; - bits += 8; - } - } - dist += (unsigned)hold & ((((unsigned int)1) << op) - 1); -#ifdef INFLATE_STRICT - if (dist > dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - hold >>= op; - bits -= op; - Tracevv((stderr, "inflate: distance %u\n", dist)); - op = (unsigned)(out - beg); /* max distance in output */ - if (dist > op) { /* see if copy from window */ - op = dist - op; /* distance back in window */ - if (op > whave) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - from = window - OFF; - if (write == 0) { /* very common case */ - from += wsize - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - else if (write < op) { /* wrap around window */ - from += wsize + write - op; - op -= write; - if (op < len) { /* some from end of window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = window - OFF; - if (write < len) { /* some from start of window */ - op = write; - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - } - else { /* contiguous in window */ - from += write - op; - if (op < len) { /* some from window */ - len -= op; - do { - PUP(out) = PUP(from); - } while (--op); - from = out - dist; /* rest from output */ - } - } - while (len > 2) { - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - else { - from = out - dist; /* copy direct from output */ - do { /* minimum length is three */ - PUP(out) = PUP(from); - PUP(out) = PUP(from); - PUP(out) = PUP(from); - len -= 3; - } while (len > 2); - if (len) { - PUP(out) = PUP(from); - if (len > 1) - PUP(out) = PUP(from); - } - } - } - else if ((op & 64) == 0) { /* 2nd level distance code */ - this = dcode[this.val + (hold & ((((unsigned int)1) << op) - 1))]; - goto dodist; - } - else { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - } - else if ((op & 64) == 0) { /* 2nd level length code */ - this = lcode[this.val + (hold & ((((unsigned int)1) << op) - 1))]; - goto dolen; - } - else if (op & 32) { /* end-of-block */ - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - else { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - } while (in < last && out < end); - - /* return unused bytes (on entry, bits < 8, so in won't go too far back) */ - len = bits >> 3; - in -= len; - bits -= len << 3; - hold &= (((unsigned int)1) << bits) - 1; - - /* update state and return */ - strm->next_in = in + OFF; - strm->next_out = out + OFF; - strm->avail_in = (unsigned)(in < last ? 5 + (last - in) : 5 - (in - last)); - strm->avail_out = (unsigned)(out < end ? - 257 + (end - out) : 257 - (out - end)); - state->hold = hold; - state->bits = bits; - return; -} - -/* - inflate_fast() speedups that turned out slower (on a PowerPC G3 750CXe): - - Using bit fields for code structure - - Different op definition to avoid & for extra bits (do & for table bits) - - Three separate decoding do-loops for direct, window, and write == 0 - - Special case for distance > 1 copies to do overlapped load and store copy - - Explicit branch predictions (based on measured branch probabilities) - - Deferring match copy and interspersed it with decoding subsequent codes - - Swapping literal/length else - - Swapping window/direct else - - Larger unrolled copy loops (three is about right) - - Moving len -= 3 statement into middle of loop - */ - -#endif /* _INFFAST_C */ - -#ifndef _INFLATE_C -#define _INFLATE_C 1 - -/* function prototypes */ -local void fixedtables OF((struct inflate_state FAR *state)); -local int updatewindow OF((z_streamp strm, unsigned out)); -#ifdef BUILDFIXED - void makefixed OF((void)); -#endif -local unsigned syncsearch OF((unsigned FAR *have, unsigned char FAR *buf, - unsigned len)); - -int ZEXPORT inflateReset(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - strm->total_in = strm->total_out = state->total = 0; - strm->msg = Z_NULL; - strm->adler = 1; /* to support ill-conceived Java test suite */ - state->mode = HEAD; - state->last = 0; - state->havedict = 0; - state->dmax = 32768; - state->head = Z_NULL; - state->wsize = 0; - state->whave = 0; - state->write = 0; - state->hold = 0; - state->bits = 0; - state->lencode = state->distcode = state->next = state->codes; - Tracev((stderr, "inflate: reset\n")); - return Z_OK; -} - -int ZEXPORT inflatePrime(strm, bits, value) -z_streamp strm; -int bits; -int value; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; - value &= (1L << bits) - 1; - state->hold += value << state->bits; - state->bits += bits; - return Z_OK; -} - -int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) -z_streamp strm; -int windowBits; -const char *version; -int stream_size; -{ - struct inflate_state FAR *state; - - if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || - stream_size != (int)(sizeof(z_stream))) - return Z_VERSION_ERROR; - if (strm == Z_NULL) return Z_STREAM_ERROR; - strm->msg = Z_NULL; /* in case we return an error */ - if (strm->zalloc == (alloc_func)0) { - strm->zalloc = zcalloc; - strm->opaque = (voidpf)0; - } - if (strm->zfree == (free_func)0) strm->zfree = zcfree; - state = (struct inflate_state FAR *) - ZALLOC(strm, 1, sizeof(struct inflate_state)); - if (state == Z_NULL) return Z_MEM_ERROR; - Tracev((stderr, "inflate: allocated\n")); - strm->state = (struct internal_state FAR *)state; - if (windowBits < 0) { - state->wrap = 0; - windowBits = -windowBits; - } - else { - state->wrap = (windowBits >> 4) + 1; -#ifdef GUNZIP - if (windowBits < 48) windowBits &= 15; -#endif - } - if (windowBits < 8 || windowBits > 15) { - ZFREE(strm, state); - strm->state = Z_NULL; - return Z_STREAM_ERROR; - } - state->wbits = (unsigned)windowBits; - state->window = Z_NULL; - return inflateReset(strm); -} - -int ZEXPORT inflateInit_(strm, version, stream_size) -z_streamp strm; -const char *version; -int stream_size; -{ - return inflateInit2_(strm, DEF_WBITS, version, stream_size); -} - -/* - Return state with length and distance decoding tables and index sizes set to - fixed code decoding. Normally this returns fixed tables from inffixed.h. - If BUILDFIXED is defined, then instead this routine builds the tables the - first time it's called, and returns those tables the first time and - thereafter. This reduces the size of the code by about 2K bytes, in - exchange for a little execution time. However, BUILDFIXED should not be - used for threaded applications, since the rewriting of the tables and virgin - may not be thread-safe. - */ -local void fixedtables(state) -struct inflate_state FAR *state; -{ -#ifndef _INFFIXED_H -#define _INFFIXED_H 1 - static const code lenfix[512] = { - {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, - {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, - {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, - {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, - {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, - {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, - {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, - {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, - {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, - {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, - {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, - {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, - {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, - {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, - {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, - {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, - {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, - {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, - {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, - {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, - {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, - {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, - {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, - {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, - {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, - {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, - {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, - {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, - {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, - {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, - {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, - {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, - {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, - {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, - {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, - {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, - {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, - {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, - {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, - {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, - {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, - {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, - {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, - {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, - {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, - {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, - {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, - {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, - {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, - {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, - {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, - {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, - {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, - {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, - {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, - {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, - {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, - {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, - {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, - {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, - {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, - {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, - {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, - {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, - {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, - {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, - {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, - {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, - {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, - {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, - {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, - {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, - {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, - {0,9,255} - }; - - static const code distfix[32] = { - {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, - {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, - {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, - {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, - {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, - {22,5,193},{64,5,0} - }; -#endif /* _INFFIXED_H */ - state->lencode = lenfix; - state->lenbits = 9; - state->distcode = distfix; - state->distbits = 5; -} - -/* - Update the window with the last wsize (normally 32K) bytes written before - returning. If window does not exist yet, create it. This is only called - when a window is already in use, or when output has been written during this - inflate call, but the end of the deflate stream has not been reached yet. - It is also called to create a window for dictionary data when a dictionary - is loaded. - - Providing output buffers larger than 32K to inflate() should provide a speed - advantage, since only the last 32K of output is copied to the sliding window - upon return from inflate(), and since all distances after the first 32K of - output will fall in the output data, making match copies simpler and faster. - The advantage may be dependent on the size of the processor's data caches. - */ -local int updatewindow(strm, out) -z_streamp strm; -unsigned out; -{ - struct inflate_state FAR *state; - unsigned copy, dist; - - state = (struct inflate_state FAR *)strm->state; - - /* if it hasn't been done already, allocate space for the window */ - if (state->window == Z_NULL) { - state->window = (unsigned char FAR *) - ZALLOC(strm, ((unsigned int)1) << state->wbits, - sizeof(unsigned char)); - if (state->window == Z_NULL) return 1; - } - - /* if window not in use yet, initialize */ - if (state->wsize == 0) { - state->wsize = ((unsigned int)1) << state->wbits; - state->write = 0; - state->whave = 0; - } - - /* copy state->wsize or less output bytes into the circular window */ - copy = out - strm->avail_out; - if (copy >= state->wsize) { - zmemcpy(state->window, strm->next_out - state->wsize, state->wsize); - state->write = 0; - state->whave = state->wsize; - } - else { - dist = state->wsize - state->write; - if (dist > copy) dist = copy; - zmemcpy(state->window + state->write, strm->next_out - copy, dist); - copy -= dist; - if (copy) { - zmemcpy(state->window, strm->next_out - copy, copy); - state->write = copy; - state->whave = state->wsize; - } - else { - state->write += dist; - if (state->write == state->wsize) state->write = 0; - if (state->whave < state->wsize) state->whave += dist; - } - } - return 0; -} - -/* Macros for inflate(): */ - -/* check function to use adler32() for zlib or crc32() for gzip */ -#ifdef GUNZIP -# define UPDATE(check, buf, len) \ - (state->flags ? crc32(check, buf, len) : adler32(check, buf, len)) -#else -# define UPDATE(check, buf, len) adler32(check, buf, len) -#endif - -/* check macros for header crc */ -#ifdef GUNZIP -# define CRC2(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - check = crc32(check, hbuf, 2); \ - } while (0) - -# define CRC4(check, word) \ - do { \ - hbuf[0] = (unsigned char)(word); \ - hbuf[1] = (unsigned char)((word) >> 8); \ - hbuf[2] = (unsigned char)((word) >> 16); \ - hbuf[3] = (unsigned char)((word) >> 24); \ - check = crc32(check, hbuf, 4); \ - } while (0) -#endif - -/* Load registers with state in inflate() for speed */ -#define LOAD() \ - do { \ - put = strm->next_out; \ - left = strm->avail_out; \ - next = strm->next_in; \ - have = strm->avail_in; \ - hold = state->hold; \ - bits = state->bits; \ - } while (0) - -/* Restore state from registers in inflate() */ -#define RESTORE() \ - do { \ - strm->next_out = put; \ - strm->avail_out = left; \ - strm->next_in = next; \ - strm->avail_in = have; \ - state->hold = hold; \ - state->bits = bits; \ - } while (0) - -/* Clear the input bit accumulator */ -#define INITBITS() \ - do { \ - hold = 0; \ - bits = 0; \ - } while (0) - -/* Get a byte of input into the bit accumulator, or return from inflate() - if there is no input available. */ -#define PULLBYTE() \ - do { \ - if (have == 0) goto inf_leave; \ - have--; \ - hold += (unsigned long)(*next++) << bits; \ - bits += 8; \ - } while (0) - -/* Assure that there are at least n bits in the bit accumulator. If there is - not enough available input to do that, then return from inflate(). */ -#define NEEDBITS(n) \ - do { \ - while (bits < (unsigned)(n)) \ - PULLBYTE(); \ - } while (0) - -/* Return the low n bits of the bit accumulator (n < 16) */ -#define BITS(n) \ - ((unsigned)hold & ((((unsigned int)1) << (n)) - 1)) - -/* Remove n bits from the bit accumulator */ -#define DROPBITS(n) \ - do { \ - hold >>= (n); \ - bits -= (unsigned)(n); \ - } while (0) - -/* Remove zero to seven bits as needed to go to a byte boundary */ -#define BYTEBITS() \ - do { \ - hold >>= bits & 7; \ - bits -= bits & 7; \ - } while (0) - -/* Reverse the bytes in a 32-bit value */ -#define REVERSE(q) \ - ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \ - (((q) & 0xff00) << 8) + (((q) & 0xff) << 24)) - -/* - inflate() uses a state machine to process as much input data and generate as - much output data as possible before returning. The state machine is - structured roughly as follows: - - for (;;) switch (state) { - ... - case STATEn: - if (not enough input data or output space to make progress) - return; - ... make progress ... - state = STATEm; - break; - ... - } - - so when inflate() is called again, the same case is attempted again, and - if the appropriate resources are provided, the machine proceeds to the - next state. The NEEDBITS() macro is usually the way the state evaluates - whether it can proceed or should return. NEEDBITS() does the return if - the requested bits are not available. The typical use of the BITS macros - is: - - NEEDBITS(n); - ... do something with BITS(n) ... - DROPBITS(n); - - where NEEDBITS(n) either returns from inflate() if there isn't enough - input left to load n bits into the accumulator, or it continues. BITS(n) - gives the low n bits in the accumulator. When done, DROPBITS(n) drops - the low n bits off the accumulator. INITBITS() clears the accumulator - and sets the number of available bits to zero. BYTEBITS() discards just - enough bits to put the accumulator on a byte boundary. After BYTEBITS() - and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. - - NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return - if there is no input available. The decoding of variable length codes uses - PULLBYTE() directly in order to pull just enough bytes to decode the next - code, and no more. - - Some states loop until they get enough input, making sure that enough - state information is maintained to continue the loop where it left off - if NEEDBITS() returns in the loop. For example, want, need, and keep - would all have to actually be part of the saved state in case NEEDBITS() - returns: - - case STATEw: - while (want < need) { - NEEDBITS(n); - keep[want++] = BITS(n); - DROPBITS(n); - } - state = STATEx; - case STATEx: - - As shown above, if the next state is also the next case, then the break - is omitted. - - A state may also return if there is not enough output space available to - complete that state. Those states are copying stored data, writing a - literal byte, and copying a matching string. - - When returning, a "goto inf_leave" is used to update the total counters, - update the check value, and determine whether any progress has been made - during that inflate() call in order to return the proper return code. - Progress is defined as a change in either strm->avail_in or strm->avail_out. - When there is a window, goto inf_leave will update the window with the last - output written. If a goto inf_leave occurs in the middle of decompression - and there is no window currently, goto inf_leave will create one and copy - output to the window for the next call of inflate(). - - In this implementation, the flush parameter of inflate() only affects the - return code (per zlib.h). inflate() always writes as much as possible to - strm->next_out, given the space available and the provided input--the effect - documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers - the allocation of and copying into a sliding window until necessary, which - provides the effect documented in zlib.h for Z_FINISH when the entire input - stream available. So the only thing the flush parameter actually does is: - when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it - will return Z_BUF_ERROR if it has not reached the end of the stream. - */ - -int ZEXPORT inflate(strm, flush) -z_streamp strm; -int flush; -{ - struct inflate_state FAR *state; - unsigned char FAR *next; /* next input */ - unsigned char FAR *put; /* next output */ - unsigned have, left; /* available input and output */ - unsigned long hold; /* bit buffer */ - unsigned bits; /* bits in bit buffer */ - unsigned in, out; /* save starting available input and output */ - unsigned copy; /* number of stored or match bytes to copy */ - unsigned char FAR *from; /* where to copy match bytes from */ - code this; /* current decoding table entry */ - code last; /* parent table entry */ - unsigned len; /* length to copy for repeats, bits to drop */ - int ret; /* return code */ -#ifdef GUNZIP - unsigned char hbuf[4]; /* buffer for gzip header crc calculation */ -#endif - static const unsigned short order[19] = /* permutation of code lengths */ - {16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; - - if (strm == Z_NULL || strm->state == Z_NULL || strm->next_out == Z_NULL || - (strm->next_in == Z_NULL && strm->avail_in != 0)) - return Z_STREAM_ERROR; - - state = (struct inflate_state FAR *)strm->state; - if (state->mode == TYPE) state->mode = TYPEDO; /* skip check */ - LOAD(); - in = have; - out = left; - ret = Z_OK; - for (;;) - switch (state->mode) { - case HEAD: - if (state->wrap == 0) { - state->mode = TYPEDO; - break; - } - NEEDBITS(16); -#ifdef GUNZIP - if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */ - state->check = crc32(0L, Z_NULL, 0); - CRC2(state->check, hold); - INITBITS(); - state->mode = FLAGS; - break; - } - state->flags = 0; /* expect zlib header */ - if (state->head != Z_NULL) - state->head->done = -1; - if (!(state->wrap & 1) || /* check if zlib header allowed */ -#else - if ( -#endif - ((BITS(8) << 8) + (hold >> 8)) % 31) { - strm->msg = (char *)"incorrect header check"; - state->mode = BAD; - break; - } - if (BITS(4) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - DROPBITS(4); - len = BITS(4) + 8; - if (len > state->wbits) { - strm->msg = (char *)"invalid window size"; - state->mode = BAD; - break; - } - state->dmax = ((unsigned int)1) << len; - Tracev((stderr, "inflate: zlib header ok\n")); - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = hold & 0x200 ? DICTID : TYPE; - INITBITS(); - break; -#ifdef GUNZIP - case FLAGS: - NEEDBITS(16); - state->flags = (int)(hold); - if ((state->flags & 0xff) != Z_DEFLATED) { - strm->msg = (char *)"unknown compression method"; - state->mode = BAD; - break; - } - if (state->flags & 0xe000) { - strm->msg = (char *)"unknown header flags set"; - state->mode = BAD; - break; - } - if (state->head != Z_NULL) - state->head->text = (int)((hold >> 8) & 1); - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = TIME; - case TIME: - NEEDBITS(32); - if (state->head != Z_NULL) - state->head->time = hold; - if (state->flags & 0x0200) CRC4(state->check, hold); - INITBITS(); - state->mode = OS; - case OS: - NEEDBITS(16); - if (state->head != Z_NULL) { - state->head->xflags = (int)(hold & 0xff); - state->head->os = (int)(hold >> 8); - } - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - state->mode = EXLEN; - case EXLEN: - if (state->flags & 0x0400) { - NEEDBITS(16); - state->length = (unsigned)(hold); - if (state->head != Z_NULL) - state->head->extra_len = (unsigned)hold; - if (state->flags & 0x0200) CRC2(state->check, hold); - INITBITS(); - } - else if (state->head != Z_NULL) - state->head->extra = Z_NULL; - state->mode = EXTRA; - case EXTRA: - if (state->flags & 0x0400) { - copy = state->length; - if (copy > have) copy = have; - if (copy) { - if (state->head != Z_NULL && - state->head->extra != Z_NULL) { - len = state->head->extra_len - state->length; - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); - } - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - state->length -= copy; - } - if (state->length) goto inf_leave; - } - state->length = 0; - state->mode = NAME; - case NAME: - if (state->flags & 0x0800) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->name != Z_NULL && - state->length < state->head->name_max) - state->head->name[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->name = Z_NULL; - state->length = 0; - state->mode = COMMENT; - case COMMENT: - if (state->flags & 0x1000) { - if (have == 0) goto inf_leave; - copy = 0; - do { - len = (unsigned)(next[copy++]); - if (state->head != Z_NULL && - state->head->comment != Z_NULL && - state->length < state->head->comm_max) - state->head->comment[state->length++] = len; - } while (len && copy < have); - if (state->flags & 0x0200) - state->check = crc32(state->check, next, copy); - have -= copy; - next += copy; - if (len) goto inf_leave; - } - else if (state->head != Z_NULL) - state->head->comment = Z_NULL; - state->mode = HCRC; - case HCRC: - if (state->flags & 0x0200) { - NEEDBITS(16); - if (hold != (state->check & 0xffff)) { - strm->msg = (char *)"header crc mismatch"; - state->mode = BAD; - break; - } - INITBITS(); - } - if (state->head != Z_NULL) { - state->head->hcrc = (int)((state->flags >> 9) & 1); - state->head->done = 1; - } - strm->adler = state->check = crc32(0L, Z_NULL, 0); - state->mode = TYPE; - break; -#endif - case DICTID: - NEEDBITS(32); - strm->adler = state->check = REVERSE(hold); - INITBITS(); - state->mode = DICT; - case DICT: - if (state->havedict == 0) { - RESTORE(); - return Z_NEED_DICT; - } - strm->adler = state->check = adler32(0L, Z_NULL, 0); - state->mode = TYPE; - case TYPE: - if (flush == Z_BLOCK) goto inf_leave; - case TYPEDO: - if (state->last) { - BYTEBITS(); - state->mode = CHECK; - break; - } - NEEDBITS(3); - state->last = BITS(1); - DROPBITS(1); - switch (BITS(2)) { - case 0: /* stored block */ - Tracev((stderr, "inflate: stored block%s\n", - state->last ? " (last)" : "")); - state->mode = STORED; - break; - case 1: /* fixed block */ - fixedtables(state); - Tracev((stderr, "inflate: fixed codes block%s\n", - state->last ? " (last)" : "")); - state->mode = LEN; /* decode codes */ - break; - case 2: /* dynamic block */ - Tracev((stderr, "inflate: dynamic codes block%s\n", - state->last ? " (last)" : "")); - state->mode = TABLE; - break; - case 3: - strm->msg = (char *)"invalid block type"; - state->mode = BAD; - } - DROPBITS(2); - break; - case STORED: - BYTEBITS(); /* go to byte boundary */ - NEEDBITS(32); - if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) { - strm->msg = (char *)"invalid stored block lengths"; - state->mode = BAD; - break; - } - state->length = (unsigned)hold & 0xffff; - Tracev((stderr, "inflate: stored length %u\n", - state->length)); - INITBITS(); - state->mode = COPY; - case COPY: - copy = state->length; - if (copy) { - if (copy > have) copy = have; - if (copy > left) copy = left; - if (copy == 0) goto inf_leave; - zmemcpy(put, next, copy); - have -= copy; - next += copy; - left -= copy; - put += copy; - state->length -= copy; - break; - } - Tracev((stderr, "inflate: stored end\n")); - state->mode = TYPE; - break; - case TABLE: - NEEDBITS(14); - state->nlen = BITS(5) + 257; - DROPBITS(5); - state->ndist = BITS(5) + 1; - DROPBITS(5); - state->ncode = BITS(4) + 4; - DROPBITS(4); -#ifndef PKZIP_BUG_WORKAROUND - if (state->nlen > 286 || state->ndist > 30) { - strm->msg = (char *)"too many length or distance symbols"; - state->mode = BAD; - break; - } -#endif - Tracev((stderr, "inflate: table sizes ok\n")); - state->have = 0; - state->mode = LENLENS; - case LENLENS: - while (state->have < state->ncode) { - NEEDBITS(3); - state->lens[order[state->have++]] = (unsigned short)BITS(3); - DROPBITS(3); - } - while (state->have < 19) - state->lens[order[state->have++]] = 0; - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 7; - ret = inflate_table(CODES, state->lens, 19, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid code lengths set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: code lengths ok\n")); - state->have = 0; - state->mode = CODELENS; - case CODELENS: - while (state->have < state->nlen + state->ndist) { - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.val < 16) { - NEEDBITS(this.bits); - DROPBITS(this.bits); - state->lens[state->have++] = this.val; - } - else { - if (this.val == 16) { - NEEDBITS(this.bits + 2); - DROPBITS(this.bits); - if (state->have == 0) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - len = state->lens[state->have - 1]; - copy = 3 + BITS(2); - DROPBITS(2); - } - else if (this.val == 17) { - NEEDBITS(this.bits + 3); - DROPBITS(this.bits); - len = 0; - copy = 3 + BITS(3); - DROPBITS(3); - } - else { - NEEDBITS(this.bits + 7); - DROPBITS(this.bits); - len = 0; - copy = 11 + BITS(7); - DROPBITS(7); - } - if (state->have + copy > state->nlen + state->ndist) { - strm->msg = (char *)"invalid bit length repeat"; - state->mode = BAD; - break; - } - while (copy--) - state->lens[state->have++] = (unsigned short)len; - } - } - - /* handle error breaks in while */ - if (state->mode == BAD) break; - - /* build code tables */ - state->next = state->codes; - state->lencode = (code const FAR *)(state->next); - state->lenbits = 9; - ret = inflate_table(LENS, state->lens, state->nlen, &(state->next), - &(state->lenbits), state->work); - if (ret) { - strm->msg = (char *)"invalid literal/lengths set"; - state->mode = BAD; - break; - } - state->distcode = (code const FAR *)(state->next); - state->distbits = 6; - ret = inflate_table(DISTS, state->lens + state->nlen, state->ndist, - &(state->next), &(state->distbits), state->work); - if (ret) { - strm->msg = (char *)"invalid distances set"; - state->mode = BAD; - break; - } - Tracev((stderr, "inflate: codes ok\n")); - state->mode = LEN; - case LEN: - if (have >= 6 && left >= 258) { - RESTORE(); - inflate_fast(strm, out); - LOAD(); - break; - } - for (;;) { - this = state->lencode[BITS(state->lenbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if (this.op && (this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->lencode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - state->length = (unsigned)this.val; - if ((int)(this.op) == 0) { - Tracevv((stderr, this.val >= 0x20 && this.val < 0x7f ? - "inflate: literal '%c'\n" : - "inflate: literal 0x%02x\n", this.val)); - state->mode = LIT; - break; - } - if (this.op & 32) { - Tracevv((stderr, "inflate: end of block\n")); - state->mode = TYPE; - break; - } - if (this.op & 64) { - strm->msg = (char *)"invalid literal/length code"; - state->mode = BAD; - break; - } - state->extra = (unsigned)(this.op) & 15; - state->mode = LENEXT; - case LENEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->length += BITS(state->extra); - DROPBITS(state->extra); - } - Tracevv((stderr, "inflate: length %u\n", state->length)); - state->mode = DIST; - case DIST: - for (;;) { - this = state->distcode[BITS(state->distbits)]; - if ((unsigned)(this.bits) <= bits) break; - PULLBYTE(); - } - if ((this.op & 0xf0) == 0) { - last = this; - for (;;) { - this = state->distcode[last.val + - (BITS(last.bits + last.op) >> last.bits)]; - if ((unsigned)(last.bits + this.bits) <= bits) break; - PULLBYTE(); - } - DROPBITS(last.bits); - } - DROPBITS(this.bits); - if (this.op & 64) { - strm->msg = (char *)"invalid distance code"; - state->mode = BAD; - break; - } - state->offset = (unsigned)this.val; - state->extra = (unsigned)(this.op) & 15; - state->mode = DISTEXT; - case DISTEXT: - if (state->extra) { - NEEDBITS(state->extra); - state->offset += BITS(state->extra); - DROPBITS(state->extra); - } -#ifdef INFLATE_STRICT - if (state->offset > state->dmax) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } -#endif - if (state->offset > state->whave + out - left) { - strm->msg = (char *)"invalid distance too far back"; - state->mode = BAD; - break; - } - Tracevv((stderr, "inflate: distance %u\n", state->offset)); - state->mode = MATCH; - case MATCH: - if (left == 0) goto inf_leave; - copy = out - left; - if (state->offset > copy) { /* copy from window */ - copy = state->offset - copy; - if (copy > state->write) { - copy -= state->write; - from = state->window + (state->wsize - copy); - } - else - from = state->window + (state->write - copy); - if (copy > state->length) copy = state->length; - } - else { /* copy from output */ - from = put - state->offset; - copy = state->length; - } - if (copy > left) copy = left; - left -= copy; - state->length -= copy; - do { - *put++ = *from++; - } while (--copy); - if (state->length == 0) state->mode = LEN; - break; - case LIT: - if (left == 0) goto inf_leave; - *put++ = (unsigned char)(state->length); - left--; - state->mode = LEN; - break; - case CHECK: - if (state->wrap) { - NEEDBITS(32); - out -= left; - strm->total_out += out; - state->total += out; - if (out) - strm->adler = state->check = - UPDATE(state->check, put - out, out); - out = left; - if (( -#ifdef GUNZIP - state->flags ? hold : -#endif - REVERSE(hold)) != state->check) { - strm->msg = (char *)"incorrect data check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: check matches trailer\n")); - } -#ifdef GUNZIP - state->mode = LENGTH; - case LENGTH: - if (state->wrap && state->flags) { - NEEDBITS(32); - if (hold != (state->total & 0xffffffff)) { - strm->msg = (char *)"incorrect length check"; - state->mode = BAD; - break; - } - INITBITS(); - Tracev((stderr, "inflate: length matches trailer\n")); - } -#endif - state->mode = DONE; - case DONE: - ret = Z_STREAM_END; - goto inf_leave; - case BAD: - ret = Z_DATA_ERROR; - goto inf_leave; - case MEM: - return Z_MEM_ERROR; - case SYNC: - default: - return Z_STREAM_ERROR; - } - - /* - Return from inflate(), updating the total counts and the check value. - If there was no progress during the inflate() call, return a buffer - error. Call updatewindow() to create and/or update the window state. - Note: a memory error from inflate() is non-recoverable. - */ - inf_leave: - RESTORE(); - if (state->wsize || (state->mode < CHECK && out != strm->avail_out)) - if (updatewindow(strm, out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - in -= strm->avail_in; - out -= strm->avail_out; - strm->total_in += in; - strm->total_out += out; - state->total += out; - if (state->wrap && out) - strm->adler = state->check = - UPDATE(state->check, strm->next_out - out, out); - strm->data_type = state->bits + (state->last ? 64 : 0) + - (state->mode == TYPE ? 128 : 0); - if (((in == 0 && out == 0) || flush == Z_FINISH) && ret == Z_OK) - ret = Z_BUF_ERROR; - return ret; -} - -int ZEXPORT inflateEnd(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->window != Z_NULL) ZFREE(strm, state->window); - ZFREE(strm, strm->state); - strm->state = Z_NULL; - Tracev((stderr, "inflate: end\n")); - return Z_OK; -} - -int ZEXPORT inflateSetDictionary(strm, dictionary, dictLength) -z_streamp strm; -const Bytef *dictionary; -uInt dictLength; -{ - struct inflate_state FAR *state; - unsigned long id; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (state->wrap != 0 && state->mode != DICT) - return Z_STREAM_ERROR; - - /* check for correct dictionary id */ - if (state->mode == DICT) { - id = adler32(0L, Z_NULL, 0); - id = adler32(id, dictionary, dictLength); - if (id != state->check) - return Z_DATA_ERROR; - } - - /* copy dictionary to window */ - if (updatewindow(strm, strm->avail_out)) { - state->mode = MEM; - return Z_MEM_ERROR; - } - if (dictLength > state->wsize) { - zmemcpy(state->window, dictionary + dictLength - state->wsize, - state->wsize); - state->whave = state->wsize; - } - else { - zmemcpy(state->window + state->wsize - dictLength, dictionary, - dictLength); - state->whave = dictLength; - } - state->havedict = 1; - Tracev((stderr, "inflate: dictionary set\n")); - return Z_OK; -} - -int ZEXPORT inflateGetHeader(strm, head) -z_streamp strm; -gz_headerp head; -{ - struct inflate_state FAR *state; - - /* check state */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; - - /* save header structure */ - state->head = head; -#ifdef GUNZIP - head->done = 0; -#endif - return Z_OK; -} - -/* - Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found - or when out of input. When called, *have is the number of pattern bytes - found in order so far, in 0..3. On return *have is updated to the new - state. If on return *have equals four, then the pattern was found and the - return value is how many bytes were read including the last byte of the - pattern. If *have is less than four, then the pattern has not been found - yet and the return value is len. In the latter case, syncsearch() can be - called again with more data and the *have state. *have is initialized to - zero for the first call. - */ -local unsigned syncsearch(have, buf, len) -unsigned FAR *have; -unsigned char FAR *buf; -unsigned len; -{ - unsigned got; - unsigned next; - - got = *have; - next = 0; - while (next < len && got < 4) { - if ((int)(buf[next]) == (got < 2 ? 0 : 0xff)) - got++; - else if (buf[next]) - got = 0; - else - got = 4 - got; - next++; - } - *have = got; - return next; -} - -int ZEXPORT inflateSync(strm) -z_streamp strm; -{ - unsigned len; /* number of bytes to look at or looked at */ - unsigned long in, out; /* temporary to save total_in and total_out */ - unsigned char buf[4]; /* to restore bit buffer to byte string */ - struct inflate_state FAR *state; - - /* check parameters */ - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - if (strm->avail_in == 0 && state->bits < 8) return Z_BUF_ERROR; - - /* if first time, start search in bit buffer */ - if (state->mode != SYNC) { - state->mode = SYNC; - state->hold <<= state->bits & 7; - state->bits -= state->bits & 7; - len = 0; - while (state->bits >= 8) { - buf[len++] = (unsigned char)(state->hold); - state->hold >>= 8; - state->bits -= 8; - } - state->have = 0; - syncsearch(&(state->have), buf, len); - } - - /* search available input */ - len = syncsearch(&(state->have), strm->next_in, strm->avail_in); - strm->avail_in -= len; - strm->next_in += len; - strm->total_in += len; - - /* return no joy or set up to restart inflate() on a new block */ - if (state->have != 4) return Z_DATA_ERROR; - in = strm->total_in; out = strm->total_out; - inflateReset(strm); - strm->total_in = in; strm->total_out = out; - state->mode = TYPE; - return Z_OK; -} - -/* - Returns true if inflate is currently at the end of a block generated by - Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP - implementation to provide an additional safety check. PPP uses - Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored - block. When decompressing, PPP checks that at the end of input packet, - inflate is waiting for these length bytes. - */ -int ZEXPORT inflateSyncPoint(strm) -z_streamp strm; -{ - struct inflate_state FAR *state; - - if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)strm->state; - return state->mode == STORED && state->bits == 0; -} - -int ZEXPORT inflateCopy(dest, source) -z_streamp dest; -z_streamp source; -{ - struct inflate_state FAR *state; - struct inflate_state FAR *copy; - unsigned char FAR *window; - unsigned wsize; - - /* check input */ - if (dest == Z_NULL || source == Z_NULL || source->state == Z_NULL || - source->zalloc == (alloc_func)0 || source->zfree == (free_func)0) - return Z_STREAM_ERROR; - state = (struct inflate_state FAR *)source->state; - - /* allocate space */ - copy = (struct inflate_state FAR *) - ZALLOC(source, 1, sizeof(struct inflate_state)); - if (copy == Z_NULL) return Z_MEM_ERROR; - window = Z_NULL; - if (state->window != Z_NULL) { - window = (unsigned char FAR *) - ZALLOC(source, ((unsigned int)1) << state->wbits, sizeof(unsigned char)); - if (window == Z_NULL) { - ZFREE(source, copy); - return Z_MEM_ERROR; - } - } - - /* copy state */ - zmemcpy(dest, source, sizeof(z_stream)); - zmemcpy(copy, state, sizeof(struct inflate_state)); - if (state->lencode >= state->codes && - state->lencode <= state->codes + ENOUGH - 1) { - copy->lencode = copy->codes + (state->lencode - state->codes); - copy->distcode = copy->codes + (state->distcode - state->codes); - } - copy->next = copy->codes + (state->next - state->codes); - if (window != Z_NULL) { - wsize = ((unsigned int)1) << state->wbits; - zmemcpy(window, state->window, wsize); - } - copy->window = window; - dest->state = (struct internal_state FAR *)copy; - return Z_OK; -} - -#endif /* _INFLATE_C */ - -#ifndef _GZIO_C -#define _GZIO_C 1 - -typedef voidp gzFile; - -#ifndef Z_BUFSIZE -# ifdef MAXSEG_64K -# define Z_BUFSIZE 4096 /* minimize memory usage for 16-bit DOS */ -# else -# define Z_BUFSIZE 16384 -# endif -#endif -#ifndef Z_PRINTF_BUFSIZE -# define Z_PRINTF_BUFSIZE 4096 -#endif - -#ifdef __MVS__ -# pragma map (fdopen , "\174\174FDOPEN") - FILE *fdopen(int, const char *); -#endif - -#if 0 && !_PACKAGE_ast -#ifndef STDC -extern voidp malloc OF((uInt size)); -extern void free OF((voidpf ptr)); -#endif -#endif - -#define ALLOC(size) malloc(size) -#define TRYFREE(p) {if (p) free(p);} - -static int const gz_magic[2] = {0x1f, 0x8b}; /* gzip magic header */ - -/* gzip flag byte */ -#define ASCII_FLAG 0x01 /* bit 0 set: file probably ascii text */ -#define HEAD_CRC 0x02 /* bit 1 set: header CRC present */ -#define EXTRA_FIELD 0x04 /* bit 2 set: extra field present */ -#define ORIG_NAME 0x08 /* bit 3 set: original file name present */ -#define COMMENT 0x10 /* bit 4 set: file comment present */ -#define RESERVED 0xE0 /* bits 5..7: reserved */ - -typedef struct gz_stream { - z_stream stream; - int z_err; /* error code for last stream operation */ - int z_eof; /* set if end of input file */ - FILE *file; /* .gz file */ - Byte *inbuf; /* input buffer */ - Byte *outbuf; /* output buffer */ - uLong crc; /* crc32 of uncompressed data */ - char *msg; /* error message */ - char *path; /* path name for debugging only */ - int transparent; /* 1 if input file is not a .gz file */ -#if _PACKAGE_ast - int fatal; /* fatal stream error => all other ops fail */ - int nocrc; /* 1 to skip 'r' crc checks */ - int noclose; /* 1 to skip destroy fclose */ - int verified;/* 2-byte magic read and verified ('v') */ -#endif - char mode; /* 'w' or 'r' */ - z_off_t start; /* start of compressed data in file (header skipped) */ - z_off_t in; /* bytes into deflate or inflate */ - z_off_t out; /* bytes out of deflate or inflate */ - int back; /* one character push-back */ - int last; /* true if push-back is last character */ -} gz_stream; - - -local gzFile gz_open OF((const char *path, const char *mode, FILE* fp)); -local int get_byte OF((gz_stream *s)); -local void check_header OF((gz_stream *s)); -local int destroy OF((gz_stream *s)); -local uLong getLong OF((gz_stream *s)); - -/* =========================================================================== - Opens a gzip (.gz) file for reading or writing. The mode parameter - is as in fopen ("rb" or "wb"). The file is given either by FILE pointer - or path name (if fp == 0). - gz_open returns NULL if the file could not be opened or if there was - insufficient memory to allocate the (de)compression state; errno - can be checked to distinguish the two cases (if errno is zero, the - zlib error is Z_MEM_ERROR). -*/ -local gzFile gz_open (path, mode, fp) - const char *path; - const char *mode; - FILE *fp; -{ - int err; - int level = Z_DEFAULT_COMPRESSION; /* compression level */ - int strategy = Z_DEFAULT_STRATEGY; /* compression strategy */ - char *p = (char*)mode; - gz_stream *s; - char fmode[80]; /* copy of mode, without the compression level */ - char *m = fmode; - - if (!path || !mode) return Z_NULL; - - s = (gz_stream *)ALLOC(sizeof(gz_stream)); - if (!s) return Z_NULL; - - s->stream.zalloc = (alloc_func)0; - s->stream.zfree = (free_func)0; - s->stream.opaque = (voidpf)0; - s->stream.next_in = s->inbuf = Z_NULL; - s->stream.next_out = s->outbuf = Z_NULL; - s->stream.avail_in = s->stream.avail_out = 0; - s->file = NULL; - s->z_err = Z_OK; - s->z_eof = 0; - s->in = 0; - s->out = 0; - s->back = EOF; - s->crc = crc32(0L, Z_NULL, 0); -#if _PACKAGE_ast - s->fatal = 0; - s->nocrc = 0; - s->verified = 0; -#endif - s->msg = NULL; - s->transparent = 0; - - s->path = (char*)ALLOC(strlen(path)+1); - if (s->path == NULL) { - return destroy(s), (gzFile)Z_NULL; - } - strcpy(s->path, path); /* do this early for debugging */ - - s->mode = '\0'; - do { - if (*p == 'r') s->mode = 'r'; - if (*p == 'w' || *p == 'a') s->mode = 'w'; - if (*p >= '0' && *p <= '9') { - level = *p - '0'; - } else if (*p == 'f') { - strategy = Z_FILTERED; - } else if (*p == 'h') { - strategy = Z_HUFFMAN_ONLY; - } else if (*p == 'R') { - strategy = Z_RLE; -#if _PACKAGE_ast - } else if (*p == 'n') { - s->nocrc = 1; - } else if (*p == 'o') { - s->noclose = 1; - } else if (*p == 'v') { - s->verified = 1; -#endif - } else { - *m++ = *p; /* copy the mode */ - } - } while (*p++ && m != fmode + sizeof(fmode)); - if (s->mode == '\0') return destroy(s), (gzFile)Z_NULL; - - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else -#if _PACKAGE_ast - s->nocrc = 0; -#endif - err = deflateInit2(&(s->stream), level, - Z_DEFLATED, -MAX_WBITS, DEF_MEM_LEVEL, strategy); - /* windowBits is passed < 0 to suppress zlib header */ - - s->stream.next_out = s->outbuf = (Byte*)ALLOC(Z_BUFSIZE); -#endif - if (err != Z_OK || s->outbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } else { - s->stream.next_in = s->inbuf = (Byte*)ALLOC(Z_BUFSIZE); - - err = inflateInit2(&(s->stream), -MAX_WBITS); - /* windowBits is passed < 0 to tell that there is no zlib header. - * Note that in this case inflate *requires* an extra "dummy" byte - * after the compressed stream in order to complete decompression and - * return Z_STREAM_END. Here the gzip CRC32 ensures that 4 bytes are - * present after the compressed stream. - */ - if (err != Z_OK || s->inbuf == Z_NULL) { - return destroy(s), (gzFile)Z_NULL; - } - } - s->stream.avail_out = Z_BUFSIZE; - - errno = 0; - - if (!(s->file = fp) && !(s->file = F_OPEN(path, fmode))) { - return destroy(s), (gzFile)Z_NULL; - } - if (s->mode == 'w') { - /* Write a very simple .gz header: - */ - fprintf(s->file, "%c%c%c%c%c%c%c%c%c%c", gz_magic[0], gz_magic[1], - Z_DEFLATED, 0 /*flags*/, 0,0,0,0 /*time*/, 0 /*xflags*/, OS_CODE); - s->start = 10L; - /* We use 10L instead of ftell(s->file) to because ftell causes an - * fflush on some systems. This version of the library doesn't use - * start anyway in write mode, so this initialization is not - * necessary. - */ - } else { -#if _PACKAGE_ast - sfsetbuf(s->file, (void*)s->file, SF_UNBOUND); -#endif - check_header(s); /* skip the .gz header */ - s->start = (z_off_t)(ftell(s->file) - s->stream.avail_in); - } - - return (gzFile)s; -} - -/* =========================================================================== - Associate a gzFile with the stdio stream fp. -*/ -gzFile ZEXPORT gzfopen (fp, mode) - FILE* fp; - const char *mode; -{ - FILE* sp = (FILE*)fp; - char name[20]; - - if (!sp) - return (gzFile)Z_NULL; - sprintf(name, "", fileno(sp)); /* for debugging */ - - return gz_open (name, mode, sp); -} - -/* =========================================================================== - Read a byte from a gz_stream; update next_in and avail_in. Return EOF - for end of file. - IN assertion: the stream s has been successfully opened for reading. -*/ -local int get_byte(s) - gz_stream *s; -{ - if (s->z_eof) return EOF; - if (s->stream.avail_in == 0) { - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) s->z_err = Z_ERRNO; - return EOF; - } - s->stream.next_in = s->inbuf; - } - s->stream.avail_in--; - return *(s->stream.next_in)++; -} - -/* =========================================================================== - Check the gzip header of a gz_stream opened for reading. Set the stream - mode to transparent if the gzip magic header is not present; set s->err - to Z_DATA_ERROR if the magic header is present but the rest of the header - is incorrect. - IN assertion: the stream s has already been created successfully; - s->stream.avail_in is zero for the first time, but may be non-zero - for concatenated .gz files. -*/ -local void check_header(s) - gz_stream *s; -{ - int method; /* method byte */ - int flags; /* flags byte */ - uInt len; - int c; - -#if _PACKAGE_ast - if (!s->verified) - for (len = 0; len < 2; len++) { - c = get_byte(s); - if (c != gz_magic[len]) { - if (len != 0) s->stream.avail_in++, s->stream.next_in--; - if (c != EOF) { - s->stream.avail_in++, s->stream.next_in--; - s->transparent = 1; - } - s->z_err = s->stream.avail_in != 0 ? Z_OK : Z_STREAM_END; - return; - } - } -#else - /* Assure two bytes in the buffer so we can peek ahead -- handle case - where first byte of header is at the end of the buffer after the last - gzip segment */ - len = s->stream.avail_in; - if (len < 2) { - if (len) s->inbuf[0] = s->stream.next_in[0]; - errno = 0; - len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); - if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; - s->stream.avail_in += len; - s->stream.next_in = s->inbuf; - if (s->stream.avail_in < 2) { - s->transparent = s->stream.avail_in; - return; - } - } - - /* Peek ahead to check the gzip magic header */ - if (s->stream.next_in[0] != gz_magic[0] || - s->stream.next_in[1] != gz_magic[1]) { - s->transparent = 1; - return; - } - s->stream.avail_in -= 2; - s->stream.next_in += 2; -#endif - - /* Check the rest of the gzip header */ - method = get_byte(s); - flags = get_byte(s); - if (method != Z_DEFLATED || (flags & RESERVED) != 0) { - s->z_err = Z_DATA_ERROR; - return; - } - - /* Discard time, xflags and OS code: */ - for (len = 0; len < 6; len++) (void)get_byte(s); - - if ((flags & EXTRA_FIELD) != 0) { /* skip the extra field */ - len = (uInt)get_byte(s); - len += ((uInt)get_byte(s))<<8; - /* len is garbage if EOF but the loop below will quit anyway */ - while (len-- != 0 && get_byte(s) != EOF) ; - } - if ((flags & ORIG_NAME) != 0) { /* skip the original file name */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & COMMENT) != 0) { /* skip the .gz file comment */ - while ((c = get_byte(s)) != 0 && c != EOF) ; - } - if ((flags & HEAD_CRC) != 0) { /* skip the header crc */ - for (len = 0; len < 2; len++) (void)get_byte(s); - } - s->z_err = s->z_eof ? Z_DATA_ERROR : Z_OK; -} - - /* =========================================================================== - * Cleanup then free the given gz_stream. Return a zlib error code. - Try freeing in the reverse order of allocations. - */ -local int destroy (s) - gz_stream *s; -{ - int err = Z_OK; - - if (!s) return Z_STREAM_ERROR; - - TRYFREE(s->msg); - - if (s->stream.state != NULL) { - if (s->mode == 'w') { -#ifdef NO_GZCOMPRESS - err = Z_STREAM_ERROR; -#else - err = deflateEnd(&(s->stream)); -#endif - } else if (s->mode == 'r') { - err = inflateEnd(&(s->stream)); - } - } -#if _PACKAGE_ast - if (s->file != NULL && (s->noclose ? (s->mode == 'r' ? 0 : fflush(s->file)) : fclose(s->file))) { -#else - if (s->file != NULL && fclose(s->file)) { -#endif -#ifdef ESPIPE - if (errno != ESPIPE) /* fclose is broken for pipes in HP/UX */ -#endif - err = Z_ERRNO; - } - if (s->z_err < 0) err = s->z_err; - - TRYFREE(s->inbuf); - TRYFREE(s->outbuf); - TRYFREE(s->path); - TRYFREE(s); - return err; -} - -/* =========================================================================== - Reads the given number of uncompressed bytes from the compressed file. - gzread returns the number of bytes actually read (0 for end of file). -*/ -int ZEXPORT gzread (file, buf, len) - gzFile file; - voidp buf; - unsigned len; -{ - gz_stream *s = (gz_stream*)file; - Bytef *start = (Bytef*)buf; /* starting point for crc computation */ - Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ - - if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR; - - if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1; - if (s->z_err == Z_STREAM_END) return 0; /* EOF */ - - next_out = (Byte*)buf; - s->stream.next_out = (Bytef*)buf; - s->stream.avail_out = len; - - if (s->stream.avail_out && s->back != EOF) { - *next_out++ = s->back; - s->stream.next_out++; - s->stream.avail_out--; - s->back = EOF; - s->out++; - start++; - if (s->last) { - s->z_err = Z_STREAM_END; - return 1; - } - } - - while (s->stream.avail_out != 0) { - - if (s->transparent) { - /* Copy first the lookahead bytes: */ - uInt n = s->stream.avail_in; - if (n > s->stream.avail_out) n = s->stream.avail_out; - if (n > 0) { - zmemcpy(s->stream.next_out, s->stream.next_in, n); - next_out += n; - s->stream.next_out = next_out; - s->stream.next_in += n; - s->stream.avail_out -= n; - s->stream.avail_in -= n; - } - if (s->stream.avail_out > 0) { - s->stream.avail_out -= - (uInt)fread(next_out, 1, s->stream.avail_out, s->file); - } - len -= s->stream.avail_out; - s->in += len; - s->out += len; - if (len == 0) s->z_eof = 1; - return (int)len; - } - if (s->stream.avail_in == 0 && !s->z_eof) { - - errno = 0; - s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); - if (s->stream.avail_in == 0) { - s->z_eof = 1; - if (ferror(s->file)) { - s->z_err = Z_ERRNO; - break; - } - } - s->stream.next_in = s->inbuf; - } - s->in += s->stream.avail_in; - s->out += s->stream.avail_out; - s->z_err = inflate(&(s->stream), Z_NO_FLUSH); - s->in -= s->stream.avail_in; - s->out -= s->stream.avail_out; - - if (s->z_err == Z_STREAM_END) { - /* Check CRC and original size */ -#if _PACKAGE_ast - if (!s->nocrc) -#endif - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - start = s->stream.next_out; - -#if _PACKAGE_ast - if (getLong(s) != s->crc && !s->nocrc) { -#else - if (getLong(s) != s->crc) { -#endif - s->z_err = Z_DATA_ERROR; - } else { - (void)getLong(s); - /* The uncompressed length returned by above getlong() may be - * different from s->out in case of concatenated .gz files. - * Check for such files: - */ - check_header(s); - if (s->z_err == Z_OK) { - inflateReset(&(s->stream)); -#if _PACKAGE_ast - if (!s->nocrc) -#endif - s->crc = crc32(0L, Z_NULL, 0); -#if _PACKAGE_ast - else - s->z_err = Z_STREAM_END; -#endif - } - } - } - if (s->z_err != Z_OK || s->z_eof) break; - } -#if _PACKAGE_ast - if (!s->nocrc) -#endif - s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); - - if (len == s->stream.avail_out && - (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) - return -1; - return (int)(len - s->stream.avail_out); -} - -/* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets z_err in case - of error. -*/ -local uLong getLong (s) - gz_stream *s; -{ - uLong x = (uLong)get_byte(s); - int c; - - x += ((uLong)get_byte(s))<<8; - x += ((uLong)get_byte(s))<<16; - c = get_byte(s); - if (c == EOF) s->z_err = Z_DATA_ERROR; - x += ((uLong)c)<<24; - return x; -} - -#endif /* _GZIO_C */ - -#endif /* _GUNZIP_H */ - -#undef local - -#ifndef _RATZ_C -#define _RATZ_C 1 - -#include - -#ifndef S_IRUSR -#define S_IRUSR 0400 -#endif -#ifndef S_IWUSR -#define S_IWUSR 0200 -#endif -#ifndef S_IXUSR -#define S_IXUSR 0100 -#endif -#ifndef S_IRGRP -#define S_IRGRP 0040 -#endif -#ifndef S_IWGRP -#define S_IWGRP 0020 -#endif -#ifndef S_IXGRP -#define S_IXGRP 0010 -#endif -#ifndef S_IROTH -#define S_IROTH 0004 -#endif -#ifndef S_IWOTH -#define S_IWOTH 0002 -#endif -#ifndef S_IXOTH -#define S_IXOTH 0001 -#endif - -/* - * Standard Archive Format - * USTAR - Uniform Standard Tape ARchive - */ - -#define TBLOCK 512 -#define NAMSIZ 100 -#define PFXSIZ 155 - -#define TMODLEN 8 -#define TUIDLEN 8 -#define TGIDLEN 8 -#define TSIZLEN 12 -#define TMTMLEN 12 -#define TCKSLEN 8 - -#define TMAGIC "ustar" /* ustar and a null */ -#define TMAGLEN 6 -#define TVERSION "00" /* 00 and no null */ -#define TVERSLEN 2 -#define TUNMLEN 32 -#define TGNMLEN 32 -#define TDEVLEN 8 -#define TPADLEN 12 - -/* - * values used in typeflag field - */ - -#define REGTYPE '0' /* regular file */ -#define AREGTYPE 0 /* alternate REGTYPE */ -#define LNKTYPE '1' /* hard link */ -#define SYMTYPE '2' /* soft link */ -#define CHRTYPE '3' /* character special */ -#define BLKTYPE '4' /* block special */ -#define DIRTYPE '5' /* directory */ -#define FIFOTYPE '6' /* FIFO special */ -#define CONTTYPE '7' /* reserved */ -#define SOKTYPE '8' /* socket -- reserved */ -#define VERTYPE 'V' /* version -- reserved */ -#define EXTTYPE 'x' /* extended header -- reserved */ - -/* - * bits used in mode field - */ - -#define TSUID 04000 /* set uid on exec */ -#define TSGID 02000 /* set gid on exec */ -#define TSVTX 01000 /* sticky bit -- reserved */ - -/* - * file permissions - */ - -#define TUREAD 00400 /* read by owner */ -#define TUWRITE 00200 /* write by owner */ -#define TUEXEC 00100 /* execute by owner */ -#define TGREAD 00040 /* read by group */ -#define TGWRITE 00020 /* execute by group */ -#define TGEXEC 00010 /* write by group */ -#define TOREAD 00004 /* read by other */ -#define TOWRITE 00002 /* write by other */ -#define TOEXEC 00001 /* execute by other */ - -#define TAR_SUMASK ((1L<<(TCKSLEN-1)*3)-1) - -typedef struct -{ - char name[NAMSIZ]; - char mode[TMODLEN]; - char uid[TUIDLEN]; - char gid[TGIDLEN]; - char size[TSIZLEN]; - char mtime[TMTMLEN]; - char chksum[TCKSLEN]; - char typeflag; - char linkname[NAMSIZ]; - char magic[TMAGLEN]; - char version[TVERSLEN]; - char uname[TUNMLEN]; - char gname[TGNMLEN]; - char devmajor[TDEVLEN]; - char devminor[TDEVLEN]; - char prefix[PFXSIZ]; - char pad[TPADLEN]; -} Header_t; - -static struct -{ - char* id; - unsigned long blocks; - unsigned long files; -} state; - -#if !_PACKAGE_ast - -static void -usage() -{ -#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) - fprintf(stderr, "Usage: %s [-ciklmntvV] [ [no]name[=value] ... ]\n", state.id); -#else - fprintf(stderr, "Usage: %s [-clmntvV] < input.tgz\n", state.id); -#endif - exit(2); -} - -#endif - -/* - * the X/Open dd EBCDIC table - */ - -static const unsigned char a2e[] = -{ - 0000,0001,0002,0003,0067,0055,0056,0057, - 0026,0005,0045,0013,0014,0015,0016,0017, - 0020,0021,0022,0023,0074,0075,0062,0046, - 0030,0031,0077,0047,0034,0035,0036,0037, - 0100,0132,0177,0173,0133,0154,0120,0175, - 0115,0135,0134,0116,0153,0140,0113,0141, - 0360,0361,0362,0363,0364,0365,0366,0367, - 0370,0371,0172,0136,0114,0176,0156,0157, - 0174,0301,0302,0303,0304,0305,0306,0307, - 0310,0311,0321,0322,0323,0324,0325,0326, - 0327,0330,0331,0342,0343,0344,0345,0346, - 0347,0350,0351,0255,0340,0275,0232,0155, - 0171,0201,0202,0203,0204,0205,0206,0207, - 0210,0211,0221,0222,0223,0224,0225,0226, - 0227,0230,0231,0242,0243,0244,0245,0246, - 0247,0250,0251,0300,0117,0320,0137,0007, - 0040,0041,0042,0043,0044,0025,0006,0027, - 0050,0051,0052,0053,0054,0011,0012,0033, - 0060,0061,0032,0063,0064,0065,0066,0010, - 0070,0071,0072,0073,0004,0024,0076,0341, - 0101,0102,0103,0104,0105,0106,0107,0110, - 0111,0121,0122,0123,0124,0125,0126,0127, - 0130,0131,0142,0143,0144,0145,0146,0147, - 0150,0151,0160,0161,0162,0163,0164,0165, - 0166,0167,0170,0200,0212,0213,0214,0215, - 0216,0217,0220,0152,0233,0234,0235,0236, - 0237,0240,0252,0253,0254,0112,0256,0257, - 0260,0261,0262,0263,0264,0265,0266,0267, - 0270,0271,0272,0273,0274,0241,0276,0277, - 0312,0313,0314,0315,0316,0317,0332,0333, - 0334,0335,0336,0337,0352,0353,0354,0355, - 0356,0357,0372,0373,0374,0375,0376,0377, -}; - -/* - * the X/Open dd IBM table - */ - -static const unsigned char a2i[] = -{ - 0000,0001,0002,0003,0067,0055,0056,0057, - 0026,0005,0045,0013,0014,0015,0016,0017, - 0020,0021,0022,0023,0074,0075,0062,0046, - 0030,0031,0077,0047,0034,0035,0036,0037, - 0100,0132,0177,0173,0133,0154,0120,0175, - 0115,0135,0134,0116,0153,0140,0113,0141, - 0360,0361,0362,0363,0364,0365,0366,0367, - 0370,0371,0172,0136,0114,0176,0156,0157, - 0174,0301,0302,0303,0304,0305,0306,0307, - 0310,0311,0321,0322,0323,0324,0325,0326, - 0327,0330,0331,0342,0343,0344,0345,0346, - 0347,0350,0351,0255,0340,0275,0137,0155, - 0171,0201,0202,0203,0204,0205,0206,0207, - 0210,0211,0221,0222,0223,0224,0225,0226, - 0227,0230,0231,0242,0243,0244,0245,0246, - 0247,0250,0251,0300,0117,0320,0241,0007, - 0040,0041,0042,0043,0044,0025,0006,0027, - 0050,0051,0052,0053,0054,0011,0012,0033, - 0060,0061,0032,0063,0064,0065,0066,0010, - 0070,0071,0072,0073,0004,0024,0076,0341, - 0101,0102,0103,0104,0105,0106,0107,0110, - 0111,0121,0122,0123,0124,0125,0126,0127, - 0130,0131,0142,0143,0144,0145,0146,0147, - 0150,0151,0160,0161,0162,0163,0164,0165, - 0166,0167,0170,0200,0212,0213,0214,0215, - 0216,0217,0220,0232,0233,0234,0235,0236, - 0237,0240,0252,0253,0254,0255,0256,0257, - 0260,0261,0262,0263,0264,0265,0266,0267, - 0270,0271,0272,0273,0274,0275,0276,0277, - 0312,0313,0314,0315,0316,0317,0332,0333, - 0334,0335,0336,0337,0352,0353,0354,0355, - 0356,0357,0372,0373,0374,0375,0376,0377, -}; - -/* - * the mvs OpenEdition EBCDIC table - */ - -static const unsigned char a2o[] = -{ - 0000,0001,0002,0003,0067,0055,0056,0057, - 0026,0005,0025,0013,0014,0015,0016,0017, - 0020,0021,0022,0023,0074,0075,0062,0046, - 0030,0031,0077,0047,0034,0035,0036,0037, - 0100,0132,0177,0173,0133,0154,0120,0175, - 0115,0135,0134,0116,0153,0140,0113,0141, - 0360,0361,0362,0363,0364,0365,0366,0367, - 0370,0371,0172,0136,0114,0176,0156,0157, - 0174,0301,0302,0303,0304,0305,0306,0307, - 0310,0311,0321,0322,0323,0324,0325,0326, - 0327,0330,0331,0342,0343,0344,0345,0346, - 0347,0350,0351,0255,0340,0275,0137,0155, - 0171,0201,0202,0203,0204,0205,0206,0207, - 0210,0211,0221,0222,0223,0224,0225,0226, - 0227,0230,0231,0242,0243,0244,0245,0246, - 0247,0250,0251,0300,0117,0320,0241,0007, - 0040,0041,0042,0043,0044,0045,0006,0027, - 0050,0051,0052,0053,0054,0011,0012,0033, - 0060,0061,0032,0063,0064,0065,0066,0010, - 0070,0071,0072,0073,0004,0024,0076,0377, - 0101,0252,0112,0261,0237,0262,0152,0265, - 0273,0264,0232,0212,0260,0312,0257,0274, - 0220,0217,0352,0372,0276,0240,0266,0263, - 0235,0332,0233,0213,0267,0270,0271,0253, - 0144,0145,0142,0146,0143,0147,0236,0150, - 0164,0161,0162,0163,0170,0165,0166,0167, - 0254,0151,0355,0356,0353,0357,0354,0277, - 0200,0375,0376,0373,0374,0272,0256,0131, - 0104,0105,0102,0106,0103,0107,0234,0110, - 0124,0121,0122,0123,0130,0125,0126,0127, - 0214,0111,0315,0316,0313,0317,0314,0341, - 0160,0335,0336,0333,0334,0215,0216,0337, -}; - -/* - * ascii text vs. control - */ - -static const unsigned char ascii_text[] = -{ - 0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -}; - -static int -block(fp, gz, buf) -FILE* fp; -gzFile gz; -char* buf; -{ - int r; - - if (gz) - r = gzread(gz, buf, sizeof(Header_t)) == sizeof(Header_t); - else - r = fread(buf, sizeof(Header_t), 1, fp) == 1; - if (r) - state.blocks++; - return r; -} - -static int -skip(fp, gz, buf, n) -FILE* fp; -gzFile gz; -char* buf; -unsigned long n; -{ - while (n > 0) - { - if (!block(fp, gz, buf)) - { - fprintf(stderr, "%s: unexpected EOF\n", state.id); - return 1; - } - if (n <= sizeof(Header_t)) - break; - n -= sizeof(Header_t); - } - return 0; -} - -static unsigned long -number(s) -register char* s; -{ - unsigned long n = 0; - - while (*s == ' ') - s++; - while (*s >= '0' && *s <= '7') - n = (n << 3) + (*s++ - '0'); - return n; -} - -#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) - -#ifndef PATH_MAX -#define PATH_MAX 256 -#endif - -#define EXIT(n) return(sear_exec((char*)0,(char**)0,(char*)0,(n))) - -static int sear_stdin; -static char* sear_tmp; -static char sear_buf[PATH_MAX]; - -static int -sear_seek(off_t offset, int tmp) -{ - int n; - char cmd[PATH_MAX]; - - GetModuleFileName(NULL, cmd, sizeof(cmd)); - sear_stdin = dup(0); - close(0); - if (open(cmd, O_BINARY|O_RDONLY) || lseek(0, offset, 0) != offset) - { - fprintf(stderr, "%s: %s: cannot seek to data offset\n", state.id, cmd); - return -1; - } - if (tmp) - { - if ((n = GetTempPath(sizeof(cmd), cmd)) <= 0 || n > sizeof(cmd)) - { - fprintf(stderr, "%s: cannot determine temporary directory path\n", state.id); - return -1; - } - if (!GetTempFileName(cmd, "SEA", 0, sear_buf)) - { - fprintf(stderr, "%s: cannot determine temporary file path\n", state.id); - return -1; - } - sear_tmp = sear_buf; - if (!DeleteFile(sear_tmp)) - { - fprintf(stderr, "%s: %s: cannot initialize temporary directory\n", state.id, sear_tmp); - return -1; - } - if (!CreateDirectory(sear_tmp, NULL)) - { - fprintf(stderr, "%s: %s: cannot create temporary directory\n", state.id, sear_tmp); - return -1; - } - if (!SetCurrentDirectory(sear_tmp)) - { - fprintf(stderr, "%s: %s: cannot cd to temporary directory\n", state.id, sear_tmp); - return -1; - } - } - return 0; -} - -/* - * remove dir and its subdirs - */ - -static void -sear_rm_r(char* dir) -{ - WIN32_FIND_DATA info; - HANDLE hp; - - if (!SetCurrentDirectory(dir)) - return; - if ((hp = FindFirstFile("*.*", &info)) != INVALID_HANDLE_VALUE) - { - do - { - if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - { - if (info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) - SetFileAttributes(info.cFileName, info.dwFileAttributes & ~FILE_ATTRIBUTE_READONLY); - DeleteFile(info.cFileName); - } - else if (info.cFileName[0] != '.' || info.cFileName[1] != 0 && (info.cFileName[1] != '.' || info.cFileName[2] != 0)) - sear_rm_r(info.cFileName); - } while(FindNextFile(hp, &info)); - FindClose(hp); - } - if (SetCurrentDirectory("..")) - RemoveDirectory(dir); -} - -/* - * system(3) without PATH search that should work on all windows variants - */ - -static int -sear_system(const char* command, int nowindow) -{ - PROCESS_INFORMATION pinfo; - STARTUPINFO sinfo; - char* cp; - char path[PATH_MAX]; - int n = *command == '"'; - DWORD flags = NORMAL_PRIORITY_CLASS; - - strncpy(path, &command[n], PATH_MAX - 4); - n = n ? '"' : ' '; - for (cp = path; *cp; *cp++) - if (*cp == n) - break; - *cp = 0; - if (GetFileAttributes(path) == 0xffffffff && GetLastError() == ERROR_FILE_NOT_FOUND) - strcpy(cp, ".exe"); - ZeroMemory(&sinfo, sizeof(sinfo)); - if (nowindow) - flags |= CREATE_NO_WINDOW; - if (!CreateProcess(path, (char*)command, 0, 0, TRUE, flags, NULL, NULL, &sinfo, &pinfo)) - n = GetLastError() == ERROR_FILE_NOT_FOUND ? 127 : 126; - else - { - CloseHandle(pinfo.hThread); - WaitForSingleObject(pinfo.hProcess, INFINITE); - if (!GetExitCodeProcess(pinfo.hProcess, &n)) - n = 1; - CloseHandle(pinfo.hProcess); - Sleep(2 * 1000); - } - return n; -} - -/* - * copy t to f but no farther than e - * next t returned - */ - -static char* -copy(char* t, const char* f, char* e) -{ - while (t < e && *f) - *t++ = *f++; - return t; -} - -/* - * execute cmd, chdir .., and remove sear_tmp - */ - -static int -sear_exec(const char* cmd, char* const* arg, char* operands, int code) -{ - const char* a; - char* b; - char* e; - int r; - int sh; - int nowindow; - char buf[1024]; - - fflush(stdout); - fflush(stderr); - if (sear_tmp) - { - close(0); - dup(sear_stdin); - close(sear_stdin); - nowindow = 0; - if (cmd) - { - if (arg) - for (r = 0; arg[r]; r++) - if (!strcmp(arg[r], "remote")) - { - nowindow = 1; - break; - } - sh = 0; - for (a = cmd; *a && *a != ' '; a++) - if (a[0] == '.' && a[1] == 's' && a[2] == 'h' && (!a[3] || a[3] == ' ')) - { - sh = 1; - break; - } - b = buf; - e = buf + sizeof(buf) - 1; - if (sh || arg) - { - if (sh) - { - b = copy(b, "ksh.exe ", e); - if (*cmd && *cmd != '/') - b = copy(b, "./", e); - } - b = copy(b, cmd, e); - while (a = *arg++) - { - if ((e - b) < 3) - break; - b = copy(b, " \"", e); - b = copy(b, a, e); - b = copy(b, "\"", e); - } - } - if (operands) - { - if (b == buf) - b = copy(b, cmd, e); - b = copy(b, " -- ", e); - b = copy(b, operands, e); - } - if (b > buf) - { - *b = 0; - cmd = (const char*)buf; - } - r = sear_system(cmd, nowindow); - } - else - r = code; - if (code >= 0) - sear_rm_r(sear_tmp); - } - else - r = cmd ? 0 : code; - return r; -} - -#else - -#define EXIT(n) return(n) - -#endif - -int -main(argc, argv) -int argc; -char** argv; -{ - register int c; - register char* s; - register char* t; - register char* e; - unsigned long n; - unsigned long m; - const unsigned char* a2x; - int clear; - int list; - int local; - int meter; - int unzip; - int verbose; - unsigned int mode; - unsigned long total; - off_t pos; - gzFile gz; - FILE* fp; - Header_t header; - unsigned char num[4]; - char path[sizeof(header.prefix) + sizeof(header.name) + 4]; - char buf[sizeof(header)]; -#if defined(_SEAR_OPTS) - char* opts[4]; -#endif - -#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) - int install = 1; -#endif - - setmode(0, O_BINARY); - setmode(1, O_BINARY); - clear = 0; - list = 0; - local = 0; - meter = 0; - unzip = 0; - verbose = 0; - if (s = *argv) - { - t = s; - while (*s) - if (*s++ == '/') - t = s; - if (!strcmp(t, "gunzip")) - unzip = 1; - state.id = t; - } - else - state.id = "ratz"; - switch ((unsigned char)'~') - { - case 0241: - switch ('\n') - { - case 0025: - a2x = a2o; - break; - default: - a2x = a2e; - break; - } - break; - case 0137: - a2x = a2i; - break; - default: - a2x = 0; - break; - } -#if defined(_SEAR_OPTS) - opts[0] = argv[0]; - opts[1] = _SEAR_OPTS; - opts[2] = argv[1]; - opts[3] = 0; - argv = opts; -#endif -#if _PACKAGE_ast - error_info.id = state.id; - for (;;) - { - switch (optget(argv, usage)) - { - case 'c': - unzip = 1; - continue; -#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) - case 'i': - install = 0; - continue; - case 'k': - install = -1; - continue; -#endif - case 'l': - local = 1; - continue; - case 'm': - meter = 1; - continue; - case 'n': - a2x = 0; - continue; - case 't': - list = 1; - continue; - case 'v': - verbose = 1; - continue; - case 'V': - sfprintf(sfstdout, "%s\n", id + 10); - return 0; - case '?': - error(ERROR_USAGE|4, "%s", opt_info.arg); - continue; - case ':': - error(2, "%s", opt_info.arg); - continue; - } - break; - } - if (error_info.errors) - error(ERROR_USAGE|4, "%s", optusage(NiL)); - argv += opt_info.index; -#else - while ((s = *++argv) && *s == '-' && *(s + 1)) - { - if (*(s + 1) == '-') - { - if (!*(s + 2)) - { - argv++; - break; - } - usage(); - break; - } - for (;;) - { - switch (c = *++s) - { - case 0: - break; - case 'c': - unzip = 1; - continue; -#if defined(_SEAR_EXEC) || defined(_SEAR_SEEK) - case 'i': - install = 0; - continue; - case 'k': - install = -1; - continue; -#endif - case 'l': - local = 1; - continue; - case 'm': - meter = 1; - continue; - case 'n': - a2x = 0; - continue; - case 't': - list = 1; - continue; - case 'v': - verbose = 1; - continue; - case 'V': - fprintf(stdout, "%s\n", id + 10); - return 0; - default: - fprintf(stderr, "%s: -%c: unknown option\n", state.id, c); - /*FALLTHROUGH*/ - case '?': - usage(); - break; - } - break; - } - } -#endif - -#if defined(_SEAR_SEEK) - if (sear_seek((off_t)_SEAR_SEEK, install && !list)) - { - Sleep(2 * 1000); - return 1; - } -#endif - - /* - * commit on the first gzip magic char - */ - - if ((c = getchar()) == EOF) - EXIT(0); - ungetc(c, stdin); - if (c != gz_magic[0]) - gz = 0; - else if (!(gz = gzfopen(stdin, FOPEN_READ))) - { - fprintf(stderr, "%s: gunzip open error\n", state.id); - EXIT(1); - } - if (unzip) - { - if (!gz) - { - fprintf(stderr, "%s: not a gzip file\n", state.id); - EXIT(1); - } - while ((c = gzread(gz, buf, sizeof(buf))) > 0) - if (fwrite(buf, c, 1, stdout) != 1) - { - fprintf(stderr, "%s: write error\n", state.id); - EXIT(1); - } - if (c < 0) - { - fprintf(stderr, "%s: read error\n", state.id); - EXIT(1); - } - if (fflush(stdout)) - { - fprintf(stderr, "%s: flush error\n", state.id); - EXIT(1); - } - EXIT(0); - } - if (meter) - { - if ((pos = lseek(0, (off_t)0, SEEK_CUR)) < 0) - meter = 0; - else - { - if (lseek(0, (off_t)(-4), SEEK_END) < 0 || read(0, num, 4) != 4) - meter = 0; - else if (!(total = ((num[0]|(num[1]<<8)|(num[2]<<16)|(num[3]<<24)) + sizeof(Header_t) - 1) / sizeof(Header_t))) - total = 1; - lseek(0, pos, SEEK_SET); - } - } - - /* - * loop on all the header blocks - */ - - while (block(stdin, gz, (char*)&header)) - { - /* - * last 2 blocks are NUL - */ - - if (!*header.name) - break; - - /* - * verify the checksum - */ - - s = header.chksum; - e = header.chksum + sizeof(header.chksum); - if (a2x) - { - for (; s < e; s++) - *s = a2x[*(unsigned char*)s]; - s = header.chksum; - } - n = number(s) & TAR_SUMASK; - while (s < e) - *s++ = 040; - m = 0; - s = (char*)&header; - e = (char*)&header + sizeof(header); - while (s < e) - m += *(unsigned char*)s++; - m &= TAR_SUMASK; - if (m != n) - { - if (state.files) - fprintf(stderr, "%s: archive corrupted\n", state.id); - else - fprintf(stderr, "%s: not a tar archive\n", state.id); - fprintf(stderr, "check sum %lu != %lu\n", m, n); - EXIT(1); - } - - /* - * convert to the native charset - */ - - if (a2x) - for (e = (s = (char*)&header) + sizeof(header); s < e; s++) - *s = a2x[*(unsigned char*)s]; - - /* - * get the pathname, type and size - */ - - state.files++; - t = path; - if (!strncmp(header.magic, TMAGIC, sizeof(header.magic)) && *header.prefix) - { - s = header.prefix; - e = header.prefix + sizeof(header.prefix); - while (s < e && (c = *s++)) - *t++ = c; - *t++ = '/'; - } - s = header.name; - e = header.name + sizeof(header.name); - while (s < e && (c = *s++)) - *t++ = c; - *t = 0; - - /* - * verify the dir prefix - */ - - t = 0; - s = path; - while (*s) - if (*s++ == '/') - t = s; - if (t) - { - *--t = 0; - if (!list && access(path, 0)) - { - s = path; - do - { - if (!(c = *s) || c == '/') - { - *s = 0; - if (access(path, 0) && mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) - { - fprintf(stderr, "%s: %s: cannot create directory\n", state.id, path); - EXIT(1); - } - *s = c; - } - } while (*s++); - } - if (*(t + 1)) - *t = '/'; - else - header.typeflag = DIRTYPE; - } - - /* - * check for non-local paths - */ - - if (local && (path[0] == '/' || path[0] == '.' && path[1] == '.' && (!path[2] || path[2] == '/'))) - { - fprintf(stderr, "%s: %s: non-local path rejected", state.id, path); - if ((header.typeflag == REGTYPE || header.typeflag == AREGTYPE) && (n = number(header.size))) - while (n > 0) - { - if (!block(stdin, gz, buf)) - { - fprintf(stderr, "%s: unexpected EOF\n", state.id); - EXIT(1); - } - if (n <= sizeof(header)) - break; - n -= sizeof(header); - } - continue; - } - - /* - * create and grab the data - */ - - n = number(header.mode); - mode = 0; - if (n & TUREAD) - mode |= S_IRUSR; - if (n & TUWRITE) - mode |= S_IWUSR; - if (n & TUEXEC) - mode |= S_IXUSR; - if (n & TGREAD) - mode |= S_IRGRP; - if (n & TGWRITE) - mode |= S_IWGRP; - if (n & TGEXEC) - mode |= S_IXGRP; - if (n & TOREAD) - mode |= S_IROTH; - if (n & TOWRITE) - mode |= S_IWOTH; - if (n & TOEXEC) - mode |= S_IXOTH; - if (list || meter) - { - if (meter) - { - int i; - int j; - int k; - int n; - int p; - char bar[METER_parts + 1]; - - for (s = path; *s; s++) - if (s[0] == ' ' && s[1] == '-' && s[2] == '-' && s[3] == ' ') - break; - if (*s) - { - if (clear) - { - fprintf(stderr, "%*s", clear, "\r"); - clear = 0; - } - fprintf(stderr, "\n%s\n\n", path); - } - else - { - n = (int)strlen(s = path); - p = (state.blocks * 100) / total; - if (n > (METER_width - METER_parts - 1)) - { - s += n - (METER_width - METER_parts - 1); - n = METER_width - METER_parts - 1; - } - j = n + METER_parts + 2; - if (!clear) - clear = j + 5; - if ((k = clear - j - 5) < 0) - k = 0; - if ((i = (p / (100 / METER_parts))) >= sizeof(bar)) - i = sizeof(bar) - 1; - n = 0; - while (n < i) - bar[n++] = '*'; - while (n < sizeof(bar) - 1) - bar[n++] = ' '; - bar[n] = 0; - clear = fprintf(stderr, "%02d%% |%s| %s%*s", p, bar, s, k, "\r"); - } - } - else - { - if (verbose) - { - switch (header.typeflag) - { - case REGTYPE: - case AREGTYPE: - c = '-'; - break; - case DIRTYPE: - c = 'd'; - break; - case LNKTYPE: - c = 'h'; - break; - case SYMTYPE: - c = 'l'; - break; - default: - c = '?'; - break; - } - printf("%c", c); - m = 0400; - while (m) - { - printf("%c", (n & m) ? 'r' : '-'); - m >>= 1; - printf("%c", (n & m) ? 'w' : '-'); - m >>= 1; - printf("%c", (n & m) ? 'x' : '-'); - m >>= 1; - } - printf(" %10lu ", number(header.size)); - } - switch (header.typeflag) - { - case LNKTYPE: - printf("%s == %s\n", path, header.linkname); - break; - case SYMTYPE: - printf("%s => %s\n", path, header.linkname); - break; - default: - printf("%s\n", path); - break; - } - } - if (list) - { - if (skip(stdin, gz, buf, number(header.size))) - EXIT(1); - continue; - } - } - else if (verbose) - printf("%s\n", path); - switch (header.typeflag) - { - case REGTYPE: - case AREGTYPE: - while (!(fp = fopen(path, FOPEN_WRITE))) - if (unlink(path)) - { - fprintf(stderr, "%s: warning: %s: cannot create file\n", state.id, path); - break; - } - n = number(header.size); - c = a2x ? 0 : -1; - while (n > 0) - { - if (!block(stdin, gz, buf)) - { - fprintf(stderr, "%s: unexpected EOF\n", state.id); - EXIT(1); - } - switch (c) - { - case 0: - if ((m = n) < 4) - { - for (e = (s = buf) + m; s < e; s++) - if (a2x[*(unsigned char*)s] != '\n') - break; - } - else - { - if (m > 256) - m = 256; - for (e = (s = buf) + m; s < e; s++) - if (!ascii_text[*(unsigned char*)s]) - break; - } - if (s < e) - { - c = -1; - break; - } - c = 1; - /*FALLTHROUGH*/ - case 1: - for (e = (s = buf) + sizeof(header); s < e; s++) - *s = a2x[*(unsigned char*)s]; - break; - } - if (fp && fwrite(buf, n > sizeof(header) ? sizeof(header) : n, 1, fp) != 1) - { - fprintf(stderr, "%s: %s: write error\n", state.id, path); - EXIT(1); - } - if (n <= sizeof(header)) - break; - n -= sizeof(header); - } - if (fp && fclose(fp)) - { - fprintf(stderr, "%s: %s: write error\n", state.id, path); - EXIT(1); - } - break; - case DIRTYPE: - if (access(path, 0) && mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH)) - { - fprintf(stderr, "%s: %s: cannot create directory\n", state.id, path); - EXIT(1); - } - break; - case SYMTYPE: -#if defined(S_IFLNK) || defined(S_ISLNK) - while (symlink(header.linkname, path)) - if (unlink(path)) - { - fprintf(stderr, "%s: %s: cannot symlink to %s\n", state.id, path, header.linkname); - EXIT(1); - } - continue; -#endif -#if !_WIN32 || _WINIX - case LNKTYPE: - while (link(header.linkname, path)) - if (unlink(path)) - { - fprintf(stderr, "%s: %s: cannot link to %s\n", state.id, path, header.linkname); - EXIT(1); - } - continue; -#endif - default: - fprintf(stderr, "%s: %s: file type %c ignored\n", state.id, path, header.typeflag); - if (skip(stdin, gz, buf, number(header.size))) - EXIT(1); - continue; - } - if (chmod(path, mode)) - fprintf(stderr, "%s: %s: cannot change mode to %03o\n", state.id, path, mode); - } - if (clear) - fprintf(stderr, "%*s", clear, "\r"); - if (!state.files) - fprintf(stderr, "%s: warning: empty archive\n", state.id); - else if (verbose) - fprintf(stderr, "%lu file%s, %lu block%s\n", state.files, state.files == 1 ? "" : "s", state.blocks, state.blocks == 1 ? "" : "s"); -#if defined(_SEAR_EXEC) -#if !defined(_SEAR_ARGS) -#define _SEAR_ARGS 0 -#endif - if (install && sear_exec(_SEAR_EXEC, argv, _SEAR_ARGS, install)) - { - Sleep(2 * 1000); - return 1; - } -#endif - return 0; -} - -#endif /* _RATZ_C */ diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/regress.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/regress.sh index 8b3106523..a53ab61ff 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/regress.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/regress.sh @@ -2,6 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2012 AT&T Intellectual Property # +# Copyright (c) 2020-2021 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # @@ -25,7 +26,9 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in [-? @(#)$Id: regress (AT&T Research) 2012-02-02 $ ] -'$USAGE_LICENSE$' +[-author?Glenn Fowler ] +[-copyright?Copyright (c) 1995-2012 AT&T Intellectual Property] +[-license?http://www.eclipse.org/org/documents/epl-v10.html] [+NAME?regress - run regression tests] [+DESCRIPTION?\bregress\b runs the tests in \aunit\a, or \aunit\a\b.tst\b if \aunit\a does not exist. If \acommand\a is omitted @@ -51,7 +54,7 @@ case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in [r!:regular?Run each test with the standard input and standard output redirected through regular files.] [t:test?Run only tests matching \apattern\a. Tests are numbered and - consist of at least two digits (0 filled if necessary.) Tests matching + consist of at least two digits (0 filled if necessary). Tests matching \b+(0)\b are always run.]:[pattern] [x:trace?Enable debug tracing.] [v:verbose?List differences between actual (<) and expected (>) output, @@ -171,7 +174,7 @@ unit [ command [ arg ... ] ] the next explicit \bSET\b.] [+TALLY?Called by \bregress\b display the \bTEST\b results.] [+TEST \b\anumber\a [ \adescription\a ... ]]?Define a new test - group labelled \anumber\a with optional \adescripion\a.] + group labelled \anumber\a with optional \adescription\a.] [+TITLE \b[+]] \atext\a?Set the \bTEST\b output title to \atext\a. If \b+\b is specified then \atext\a is appended to the default title. The default title is the test file base diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/release.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/release.c deleted file mode 100644 index cf519e401..000000000 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/release.c +++ /dev/null @@ -1,367 +0,0 @@ -/*********************************************************************** -* * -* This software is part of the ast package * -* Copyright (c) 1990-2011 AT&T Intellectual Property * -* and is licensed under the * -* Eclipse Public License, Version 1.0 * -* by AT&T Intellectual Property * -* * -* A copy of the License is available at * -* http://www.eclipse.org/org/documents/epl-v10.html * -* (with md5 checksum b35adb5213ca9657e911e9befb180842) * -* * -* Information and Software Systems Research * -* AT&T Research * -* Florham Park NJ * -* * -* Glenn Fowler * -* * -***********************************************************************/ -#pragma prototyped -#pragma clang diagnostic ignored "-Wparentheses" - -/* - * release -- list recent release changes - * - * coded for portability - */ - -static char id[] = "\n@(#)$Id: release (AT&T Research) 2000-01-28 $\0\n"; - -#if _PACKAGE_ast - -#include -#include - -static const char usage[] = -"[-?\n@(#)$Id: release (AT&T Research) 2000-01-28 $\n]" -USAGE_LICENSE -"[+NAME?release - list recent changes]" -"[+DESCRIPTION?\brelease\b lists the changes within the date range specified" -" by the \b--from\b and \b--to\b options. The input files are assumed to" -" contain date tag lines of the form [\acc\a]]\ayy-mm-dd\a [ \atext\a ]]" -" (or \bdate\b(1) default format), where \acc\a is determined by a Y2K" -" window year of 69 (we can produce an example coding dated 1991 - this" -" can be patented?, how about 1+1=2?.) The date tag lines are followed by" -" \areadme\a text in reverse chronological order (newer entries at the" -" top of the file.) If no selection options are specified then all" -" changes are listed. If no \afile\a operands are specified then the" -" standard input is read.]" -"[+?The entries for each \afile\a are annotated with the file directory name.]" -"[f:from?Entries older than \adate\a are omitted.]:[date]" -"[r:release?List all changes that include the first \acount\a release marks." -" A release mark has a date tag followed by optional space and at least" -" three \b-\b characters. Changes from release mark \acount\a+1 are not" -" listed. If there are no release marks then the date range is used;" -" if there is at least one release mark then the date range is ignored" -" and at most \acount\a release marks will be listed.]#[count]" -"[t:to?Entries newer than \adate\a are omitted.]:[date]" -"[V?Print the program version and exit.]" - -"\n" -"\n[ file ... ]\n" -"\n" - -"[+SEE ALSO?\bpackage\b(1)]" -; - -#else - -#define elementsof(x) ((int)(sizeof(x)/sizeof(x[0]))) - -#define NiL ((char*)0) - -#endif - -#include -#include -#include -#include - -#if !_PACKAGE_ast && defined(__STDC__) -#include -#include -#endif - -static char mon[] = "janfebmaraprmayjunjulaugsepoctnovdec"; -static char day[] = "sunmontuewedthufrisat"; - -#if !_PACKAGE_ast - -static void -usage() -{ - fprintf(stderr, "Usage: release [-V] [-h hi-date] [-l lo-date] [-r count] [ file ...]\n"); - exit(2); -} - -#endif - -static unsigned long -number(register char* s, char** e) -{ - unsigned long q = 0; - - while (isspace(*s)) - s++; - while (isdigit(*s)) - q = q * 10 + *s++ - '0'; - if (e) - *e = s; - return q; -} - -unsigned long -string(register char* s, char* tab, int num, int siz, char** e) -{ - register int i; - register int j; - char buf[16]; - - while (isspace(*s)) - s++; - for (i = 0; i < siz; i++) - buf[i] = isupper(s[i]) ? tolower(s[i]) : s[i]; - for (i = 0; i < num; i += siz) - for (j = 0; j < siz && buf[j] == tab[j+i]; j++) - if (j == (siz - 1)) - { - *e = s + siz; - return i / siz + 1; - } - return 0; -} - -static unsigned long -date(char* s, char** e) -{ - char* t; - unsigned long y; - unsigned long m; - unsigned long d; - - if (isdigit(*s)) - { - y = number(s, &t); - if (*t != '-') - return 0; - switch (t - s) - { - case 2: - y += 1900; - if (y <= 1969) - y += 100; - break; - case 4: - if (y < 1969) - return 0; - break; - } - if (!(m = number(++t, &s))) - return 0; - if ((s - t) != 2 || *s != '-' || m < 1 || m > 12) - return 0; - if (!(d = number(++s, &t))) - return 0; - if ((t - s) != 2 || d < 1 || d > 31) - return 0; - } - else - { - if (string(s, day, elementsof(day), 3, &t)) - s = t; - if (!(m = string(s, mon, elementsof(mon), 3, &t))) - return 0; - if (!(d = number(t, &s))) - return 0; - for (y = 1969; *s; s++) - if ((y = number(s, &t)) && (t - s) == 4) - { - if (y < 1969) - return 0; - break; - } - } - if (e) - { - while (isspace(*t)) - t++; - *e = t; - } - return ((y - 1969) * 13 + m) * 32 + d; -} - -int -main(int argc, char** argv) -{ - register char* s; - register char* u; - register char* v; - char* p; - char* e; - int i; - unsigned long t; - unsigned long lo; - unsigned long hi; - int mk; - FILE* f; - char buf[1024]; - - mk = 0; - lo = hi = 0; -#if _PACKAGE_ast - error_info.id = "release"; - for (;;) - { - switch (optget(argv, usage)) - { - case 'f': - if (!(lo = date(opt_info.arg, &e)) || *e) - { - error(2, "%s: invalid from date [%s]", opt_info.arg, e); - return 1; - } - continue; - case 'r': - mk = opt_info.num + 1; - continue; - case 't': - if (!(hi = date(opt_info.arg, &e)) || *e) - { - error(2, "%s: invalid to date [%s]", opt_info.arg, e); - return 1; - } - continue; - case 'V': - sfprintf(sfstdout, "%s\n", id + 10); - return 0; - case '?': - error(ERROR_USAGE|4, "%s", opt_info.arg); - continue; - case ':': - error(2, "%s", opt_info.arg); - continue; - } - break; - } - if (error_info.errors) - error(ERROR_USAGE|4, "%s", optusage(NiL)); - argv += opt_info.index; -#else - while ((s = *++argv) && *s == '-' && *(s + 1)) - { - if (*(s + 1) == '-') - { - if (!*(s + 2)) - { - argv++; - break; - } - usage(); - break; - } - for (;;) - { - switch (i = *++s) - { - case 0: - break; - case 'f': - case 't': - if (!*(v = ++s) && !(v = *++argv)) - { - s = "??"; - continue; - } - if (!(t = date(v, &e)) || *e) - { - fprintf(stderr, "release: -%c%s: invalid date [%s]\n", i, s, e); - return 1; - } - switch (i) - { - case 'f': - lo = t; - break; - case 't': - hi = t; - break; - } - break; - case 'r': - if (!*(v = ++s) && !(v = *++argv)) - { - s = "??"; - continue; - } - mk = number(v, &e) + 1; - if (*e) - { - fprintf(stderr, "release: -%c%s: invalid count\n", i, s); - return 1; - } - break; - case 'V': - fprintf(stdout, "%s\n", id + 10); - return 0; - default: - fprintf(stderr, "release: -%c: unknown option\n", i); - /*FALLTHROUGH*/ - case '?': - usage(); - break; - } - break; - } - } -#endif - do - { - if (!(p = *argv++) || !*p || *p == '-' && !*(p + 1)) - { - argv--; - p = ""; - f = stdin; - } - else if (!(f = fopen(p, "r"))) - { - fprintf(stderr, "release: %s: cannot read", p); - return 1; - } - while (s = fgets(buf, sizeof(buf), f)) - { - if (t = date(s, &e)) - { - if (mk && e[0] == '-' && e[1] == '-' && e[2] == '-' && !--mk) - break; - if (t < lo) - break; - if (hi && t > hi) - continue; - if (p) - { - if (*p) - { - for (u = v = p; *p; p++) - if (*p == '/') - { - v = u; - u = p + 1; - } - printf("\n:::::::: "); - while ((i = *v++) && i != '/') - fputc(i, stdout); - printf(" ::::::::\n\n"); - } - p = 0; - } - } - if (!p) - fputs(s, stdout); - } - if (f == stdin) - break; - fclose(f); - } while (*argv); - return 0; -} diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/rt.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/rt.sh index 2b8b8408b..84484a7c9 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/rt.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/rt.sh @@ -2,6 +2,7 @@ # # # This software is part of the ast package # # Copyright (c) 1994-2011 AT&T Intellectual Property # +# Copyright (c) 2020-2021 Contributors to ksh 93u+m # # and is licensed under the # # Eclipse Public License, Version 1.0 # # by AT&T Intellectual Property # @@ -31,9 +32,11 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in [-? @(#)$Id: rt (AT&T Research) 2010-07-27 $ ] -'$USAGE_LICENSE$' +[-author?Glenn Fowler ] +[-copyright?Copyright (c) 2005-2012 AT&T Intellectual Property] +[-license?http://www.eclipse.org/org/documents/epl-v10.html] [+NAME?rt - run "nmake test" and filter output] -[+DESCRIPTION?\brt\b runs \vnmake test\v and filters the regression +[+DESCRIPTION?\brt\b runs \bnmake test\b and filters the regression test output to contain only test summary lines. If no \atest\a operands are specified then \btest\b is assumed. If \b-\b is specified then the \afile\a operands, or the standard input @@ -42,7 +45,7 @@ case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in [f:failed?Only list failed test results.] [h!:heading?Enable per-file heading when more than one \afile\a operand follows \b-\b.] -[v:verbose?Run with \vREGRESSFLAGS=-v\v.] +[v:verbose?Run with \bREGRESSFLAGS=-v\b.] [ test ... | - [ file ... ] ] diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/silent.sh b/cde/programs/dtksh/ksh93/src/cmd/INIT/silent.sh index 77e85333b..4ae93a22b 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/silent.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/silent.sh @@ -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 diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/socket.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/socket.c index 51d74eb7a..05d0435f9 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/socket.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/socket.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/w.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/w.c index 0f6bc7d3d..8e0c76787 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/w.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/w.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/INIT/w2.c b/cde/programs/dtksh/ksh93/src/cmd/INIT/w2.c index 00efd257c..909306234 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/INIT/w2.c +++ b/cde/programs/dtksh/ksh93/src/cmd/INIT/w2.c @@ -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 * diff --git a/cde/programs/dtksh/ksh93/src/cmd/builtin/Mamfile b/cde/programs/dtksh/ksh93/src/cmd/builtin/Mamfile index 164b1d215..4f2993ed2 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/builtin/Mamfile +++ b/cde/programs/dtksh/ksh93/src/cmd/builtin/Mamfile @@ -10,50 +10,17 @@ note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~g note * setv INSTALLROOT ../../.. setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGE_ast_LIB ${INSTALLROOT}/lib setv PACKAGE_cmd ${INSTALLROOT} -setv PACKAGE_cmd_INCLUDE ${PACKAGE_cmd}/include -setv PACKAGE_cmd_LIB ${PACKAGE_cmd}/lib setv PACKAGEROOT ../../../../.. -setv AR ${mam_cc_AR} ${mam_cc_AR_ARFLAGS} -setv ARFLAGS rc -setv AS as -setv ASFLAGS setv CC cc setv mam_cc_FLAGS setv KSH_RELFLAGS setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} -setv COTEMP $$ -setv CPIO cpio -setv CPIOFLAGS -setv CPP "${CC} -E" -setv F77 f77 -setv HOSTCC ${CC} setv IFFEFLAGS -setv IGNORE -setv LD ld setv LDFLAGS -setv LEX lex -setv LEXFLAGS -setv LPR lpr -setv LPRFLAGS -setv M4FLAGS -setv NMAKE nmake -setv NMAKEFLAGS -setv PR pr -setv PRFLAGS -setv SHELL /bin/sh -setv SILENT -setv TAR tar -setv YACC yacc -setv YACCFLAGS -d -make ${PACKAGEROOT}/lib/package/ast.lic -done ${PACKAGEROOT}/lib/package/ast.lic make .INIT make ${PACKAGE_ast_INCLUDE}/cmdlist.h - make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit - done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare done ${PACKAGE_ast_INCLUDE}/cmdlist.h exec - sed -e '/^CMDLIST(.*)$/!d' -e 's/CMDLIST(\(.*\))/\1/' -e '/^getconf$/d' -e '/^ln$/d' -e '/^mv$/d' -e '/^md5sum$/d' -e '/^sum$/d' ${PACKAGE_ast_INCLUDE}/cmdlist.h bind -lcmd @@ -66,7 +33,7 @@ make install meta FEATURE/pty features/%>FEATURE/% features/pty pty make features/pty done features/pty - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} -lm' ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libast} ${mam_libcmd} : run features/pty done FEATURE/pty generated make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit done ${PACKAGE_ast_INCLUDE}/ast_time.h @@ -74,19 +41,15 @@ make install prev ${PACKAGE_ast_INCLUDE}/regex.h implicit make ${PACKAGE_ast_INCLUDE}/proc.h implicit prev ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/proc.h prev ${PACKAGE_ast_INCLUDE}/error.h implicit prev ${PACKAGE_ast_INCLUDE}/cmd.h implicit done pty.c meta pty.o %.c>%.o pty.c pty prev pty.c - setv CMD_STANDALONE -DCMD_STANDALONE="b_pty" - setv LICENSE -DLICENSE="since=2001,author=gsf+dgk" - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -DUSAGE_LICENSE=\""[-author?Glenn Fowler ][-author?David Korn ][-copyright?Copyright (c) 2001-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?builtin]"\" -c pty.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} -I. -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""builtin"\" -D_PACKAGE_ast -DCMD_STANDALONE=b_pty -c pty.c done pty.o generated bind -lutil dontcare - setv CMD_STANDALONE -DCMD_STANDALONE="b_pty" exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o pty pty.o ${mam_libutil} ${mam_libast} ${mam_libcmd} done pty generated make ${INSTALLROOT}/bin diff --git a/cde/programs/dtksh/ksh93/src/cmd/builtin/RELEASE b/cde/programs/dtksh/ksh93/src/cmd/builtin/RELEASE index 86d2d313e..bb5a5bb70 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/builtin/RELEASE +++ b/cde/programs/dtksh/ksh93/src/cmd/builtin/RELEASE @@ -5,6 +5,6 @@ 10-04-01 pty: add --tty='stty-settings' 10-03-19 pty: add --dialogue 10-03-15 pty: fix select() fd management -09-03-31 features/pty,Makefile: add pty.h and -lutil refs for linux -- great, another util library +09-03-31 features/pty,Makefile: add pty.h and -lutil refs for Linux -- great, another util library 09-01-30 pty.c: add (for fd_set!! on mvs.390) 06-07-20 pty.c: add diff --git a/cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty b/cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty old mode 100755 new mode 100644 index 612609b36..317816c2c --- a/cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty +++ b/cde/programs/dtksh/ksh93/src/cmd/builtin/features/pty @@ -1,5 +1,3 @@ -set prototyped - header sys/types.h header pty.h header libutil.h @@ -13,7 +11,7 @@ lib openpty,_getpty,ptsname -lutil lib grantpt,unlockpt,posix_openpt stdlib.h lib cfmakeraw termios.h -tst - output{ +tst - -lm output{ #include #if _lib_ptsname #include @@ -52,7 +50,8 @@ tst - output{ return 0; } }end fail{ - echo '#error The output block in src/cmd/builtin/features/pty failed to compile. Rebuild with IFFEFLAGS=-d1 to debug.' + echo "$0: Output block failed to compile. Export IFFEFLAGS=-d1 to debug." >&2 + exit 1 }end extern _getpty char* (int*, int, mode_t, int) diff --git a/cde/programs/dtksh/ksh93/src/cmd/builtin/pty.c b/cde/programs/dtksh/ksh93/src/cmd/builtin/pty.c index b3f31ade0..8aaa3ef3f 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/builtin/pty.c +++ b/cde/programs/dtksh/ksh93/src/cmd/builtin/pty.c @@ -1,7 +1,8 @@ /*********************************************************************** * * * This software is part of the ast package * -* Copyright (c) 1992-2012 AT&T Intellectual Property * +* Copyright (c) 1992-2013 AT&T Intellectual Property * +* Copyright (c) 2020-2021 Contributors to ksh 93u+m * * and is licensed under the * * Eclipse Public License, Version 1.0 * * by AT&T Intellectual Property * @@ -18,11 +19,14 @@ * David Korn * * * ***********************************************************************/ -#pragma prototyped static const char usage[] = -"[-?\n@(#)pty (AT&T Research) 2012-06-11\n]" -USAGE_LICENSE +"[-?\n@(#)pty (AT&T Research) 2013-05-22\n]" +"[-author?Glenn Fowler ]" +"[-author?David Korn ]" +"[-copyright?Copyright (c) 2001-2013 AT&T Intellectual Property]" +"[-license?http://www.eclipse.org/org/documents/epl-v10.html]" +"[--catalog?builtin]" "[+NAME?pty - create pseudo terminal and run command]" "[+DESCRIPTION?\bpty\b creates a pseudo pty and then runs \bcommand\b " "with arguments given by \aarg\a and the standard input, standard " @@ -121,6 +125,12 @@ USAGE_LICENSE #define CMIN 1 #endif +static noreturn void outofmemory(void) +{ + error(ERROR_SYSTEM|ERROR_PANIC, "out of memory"); + UNREACHABLE(); +} + #if !_lib_openpty && !_lib__getpty && !defined(_pty_clone) # if !_lib_grantpt || !_lib_unlock # if !_lib_ptsname @@ -212,7 +222,6 @@ static int mkpty(int* master, int* minion) { struct termios tty; - struct termios tst; struct termios* ttyp; #ifdef TIOCGWINSZ struct winsize win; @@ -247,7 +256,12 @@ mkpty(int* master, int* minion) tty.c_lflag |= ECHOKE; #endif tty.c_oflag |= (ONLCR | OPOST); - tty.c_oflag &= ~(OCRNL | ONLRET); +#ifdef OCRNL + tty.c_oflag &= ~OCRNL; +#endif +#ifdef ONLRET + tty.c_oflag &= ~ONLRET; +#endif tty.c_iflag |= BRKINT; tty.c_iflag &= ~IGNBRK; tty.c_cc[VTIME] = 0; @@ -307,6 +321,7 @@ mkpty(int* master, int* minion) return -1; #endif #ifdef I_PUSH + struct termios tst; if (tcgetattr(*minion, &tst) < 0 && (ioctl(*minion, I_PUSH, "ptem") < 0 || ioctl(*minion, I_PUSH, "ldterm") < 0)) { close(*minion); @@ -641,10 +656,7 @@ masterline(Sfio_t* mp, Sfio_t* lp, char* prompt, int must, int timeout, Master_t a = roundof(bp->max - bp->buf + n, SF_BUFSIZE); r = bp->buf; if (!(bp->buf = vmnewof(bp->vm, bp->buf, char, a, 0))) - { - error(ERROR_SYSTEM|2, "out of space"); - return 0; - } + outofmemory(); bp->max = bp->buf + a; if (bp->buf != r) { @@ -780,12 +792,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) !(cond = vmnewof(vm, 0, Cond_t, 1, 0)) || !(master = vmnewof(vm, 0, Master_t, 1, 0)) || !(master->buf = vmnewof(vm, 0, char, 2 * SF_BUFSIZE, 0))) - { - error(ERROR_SYSTEM|2, "out of space"); - id = 0; - line = 0; - goto done; - } + outofmemory(); master->vm = vm; master->cur = master->end = master->buf; master->max = master->buf + 2 * SF_BUFSIZE - 1; @@ -836,10 +843,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) break; case 'i': if (!cond->next && !(cond->next = vmnewof(vm, 0, Cond_t, 1, 0))) - { - error(ERROR_SYSTEM|2, "out of space"); - goto done; - } + outofmemory(); cond = cond->next; cond->flags = IF; if ((cond->prev->flags & SKIP) && !(cond->text = 0) || !(cond->text = masterline(mp, lp, 0, 0, timeout, master))) @@ -948,7 +952,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) } if (*s && !(master->ignore = vmstrdup(vm, s))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); goto done; } break; @@ -960,7 +964,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) } if (*s && !(error_info.id = vmstrdup(vm, s))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); goto done; } break; @@ -972,7 +976,7 @@ dialogue(Sfio_t* mp, Sfio_t* lp, int delay, int timeout) } if (*s && !(master->prompt = vmstrdup(vm, s))) { - error(ERROR_SYSTEM|2, "out of space"); + error(ERROR_SYSTEM|2, "out of memory"); goto done; } break; @@ -1039,6 +1043,7 @@ b_pty(int argc, char** argv, Shbltin_t* context) continue; case 'l': log = opt_info.arg; + /* FALLTHROUGH */ case 'm': messages = opt_info.arg; continue; @@ -1058,17 +1063,26 @@ b_pty(int argc, char** argv, Shbltin_t* context) break; case '?': error(ERROR_usage(2), "%s", opt_info.arg); - break; + UNREACHABLE(); } break; } argv += opt_info.index; if (!argv[0]) + { error(ERROR_exit(1), "command must be specified"); + UNREACHABLE(); + } if (mkpty(&master, &minion) < 0) + { error(ERROR_system(1), "unable to create pty"); + UNREACHABLE(); + } if (!(mp = sfnew(NiL, 0, SF_UNBOUND, master, SF_READ|SF_WRITE))) + { error(ERROR_system(1), "cannot open master stream"); + UNREACHABLE(); + } if (stty) { n = 2; @@ -1076,7 +1090,7 @@ b_pty(int argc, char** argv, Shbltin_t* context) if (isspace(*s)) n++; if (!(ap = newof(0, Argv_t, 1, (n + 2) * sizeof(char*) + (s - stty + 1)))) - error(ERROR_system(1), "out of space"); + outofmemory(); ap->argc = n + 1; ap->argv = (char**)(ap + 1); ap->args = (char*)(ap->argv + n + 2); @@ -1096,9 +1110,15 @@ b_pty(int argc, char** argv, Shbltin_t* context) if (!log) lp = 0; else if (!(lp = sfopen(NiL, log, "w"))) + { error(ERROR_system(1), "%s: cannot write", log); + UNREACHABLE(); + } if (!(proc = runcmd(argv, minion, session))) + { error(ERROR_system(1), "unable run %s", argv[0]); + UNREACHABLE(); + } close(minion); if (messages) { @@ -1110,7 +1130,10 @@ b_pty(int argc, char** argv, Shbltin_t* context) else if ((fd = open(messages, O_CREAT|O_WRONLY, MODE_666)) >= 0) drop = 0; else + { error(ERROR_system(1), "%s: cannot redirect messages", messages); + UNREACHABLE(); + } close(2); dup(fd); if (drop) @@ -1119,6 +1142,9 @@ b_pty(int argc, char** argv, Shbltin_t* context) minion = (*fun)(mp, lp, delay, timeout); master = procclose(proc); if (lp && sfclose(lp)) + { error(ERROR_system(1), "%s: write error", log); + UNREACHABLE(); + } return minion ? minion : master; } diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY b/cde/programs/dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY index d62fdc545..f80020aea 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/COMPATIBILITY @@ -14,7 +14,7 @@ For more details, see the NEWS file and for complete details, see the git log. 1. Bytecode compiled by shcomp 93u+m will not run on older ksh versions. (However, bytecode compiled by older shcomp will run on ksh 93u+m.) -2. File name generation (a.k.a. pathname expansion, a.k.a. globbing) now +2. Pathname expansion (a.k.a. filename generation, a.k.a. globbing) now never matches the special navigational names '.' (current directory) and '..' (parent directory). This change makes a pattern like .* useful; it now matches all hidden 'dotfiles' in the current directory. @@ -22,7 +22,10 @@ For more details, see the NEWS file and for complete details, see the git log. 3. The bash-style &>foo redirection operator (shorthand for >foo 2>&1) can now always be used if -o posix is off, and not only in profile scripts. -4. Most predefined aliases have been converted to regular built-in +4. Redirections that store a file descriptor > 9 in a variable, such as + {var}>file, now continue to work if brace expansion is turned off. + +5. Most predefined aliases have been converted to regular built-in commands that work the same way. 'unalias' no longer removes these. To remove a built-in command, use 'builtin -d'. The 'history' and 'r' predefined aliases remain, but are now only set on interactive shells. @@ -32,64 +35,145 @@ For more details, see the NEWS file and for complete details, see the git log. message instead of terminating the shell. - 'suspend' now refuses to suspend a login shell, as there is probably no parent shell to return to and the login session would freeze. + If you really want to suspend a login shell, use 'kill -s STOP $$'. - 'times' now gives high precision output in a POSIX compliant format. -5. 'command' no longer expands aliases in its first argument, as this is - no longer required after change 3 above. In the unlikely event that you - still need this behavior, you can set: +6. 'command' and 'nohup' no longer expand aliases in their first argument, + as this is no longer required after the foregoing change. In the + unlikely event that you still need this behavior, you can set: alias command='command ' + alias nohup='nohup ' -6. The undocumented 'login' and 'newgrp' builtin commands have been - removed. These replaced your shell session with the external commands +7. The 'login' and 'newgrp' special built-in commands have been removed, + so it is no longer an error to define shell functions by these names. + These built-ins replaced your shell session with the external commands by the same name, as in 'exec'. If an error occurred (e.g. due to a - typo), you would end up immediately logged out. If you do want this + typo), you would end up immediately logged out, except on a few + commercial Unix systems whose 'login' and 'newgrp' cope with this + by starting a new shell session upon error. If you do want the old behavior, you can restore it by setting: alias login='exec login' alias newgrp='exec newgrp' -7. 'case' no longer retries to match patterns as literal strings if they +8. 'case' no longer retries to match patterns as literal strings if they fail to match as patterns. This undocumented behaviour broke validation use cases that are expected to work. For example: n='[0-9]' case $n in - [0-9]) echo "$n is a number" ;; + [0-9]) echo "$n is a digit" ;; esac - would output "[0-9] is a number". In the unlikely event that a script + would output "[0-9] is a digit". In the unlikely event that a script does rely on this behavior, it can be fixed like this: case $n in [0-9] | "[0-9]") - echo "$n is a number or the number pattern" ;; + echo "$n is a digit or the digit pattern" ;; esac -8. If 'set -u'/'set -o nounset' is active, then the shell now errors out +9. If 'set -u'/'set -o nounset' is active, then the shell now errors out if a nonexistent positional parameter such as $1, $2, ... is accessed. (This does *not* apply to "$@" and "$*".) -9. If 'set -u'/'set -o nounset' is active, then the shell now errors out +10. If 'set -u'/'set -o nounset' is active, then the shell now errors out if $! is accessed before the shell has launched any background process. -10. The 'print', 'printf' and 'echo' builtin commands now return a nonzero +11. The 'print', 'printf' and 'echo' built-in commands now return a nonzero exit status if an input/output error occurs. -11. Four obsolete date format specifiers for 'printf %(format)T' were +12. Four obsolete date format specifiers for 'printf %(format)T' were changed to make them compatible with modern date(1) commands: - %k and %l now return a blank-padded hour (24-hour and 12-hour clock). - %f now returns a date with the format '%Y.%m.%d-%H:%M:%S'. - %q now returns the quarter of the current year. -12. The 'typeset' builtin now properly detects and reports options that +13. The 'typeset' built-in now properly detects and reports options that cannot be used together if they are given as part of the same command. -13. The DEBUG trap has reverted to pre-93t behavior. It is now once again +14. The DEBUG trap has reverted to pre-93t behavior. It is now once again reset like other traps upon entering a subshell or ksh-style function, as documented, and it is no longer prone to crash or get corrupted. -14. 'command -x' now always runs an external command, bypassing built-ins. +15. 'command -x' now always runs an external command, bypassing built-ins. + +16. Unbalanced quotes and backticks now correctly produce a syntax error + in -c scripts, 'eval', and backtick-style command substitutions. + +17. -G/--globstar: Symbolic links to directories are now followed if they + match a normal (non-**) glob pattern. For example, if '/lnk' is a + symlink to a directory, '/lnk/**' and '/l?k/**' now work as expected. + +18. The variable name search expansions ${!prefix@} and ${!prefix*} now + also include the variable 'prefix' itself in the possible results. + +19. [[ -v var ]] is now properly equivalent to [[ -n ${var+set} ]]. + Undocumented special-casing for numeric types has been removed. + For example, the following no longer produces an unexpected error: + $ ksh -o nounset -c 'float n; [[ -v n ]] && echo $n' + +20. If the HOME variable is unset, the bare tilde ~ now expands to the + current user's system home directory instead of merely the username. + +21. On Windows/Cygwin, globbing is no longer case-insensitive by default. + Turning on the new --globcasedetect shell option restores + case-insensitive globbing for case-insensitive file systems. + +22. If $PWD or $OLDPWD are passed as invocation-local assignments to cd, + their values are no longer altered in the outer scope when cd finishes. + For example: + ksh -c 'OLDPWD=/bin; OLDPWD=/tmp cd - > /dev/null; echo $OLDPWD' + ksh -c 'cd /var; PWD=/tmp cd /usr; echo $PWD' + now prints '/bin' followed by '/var'. + +23. Path-bound built-ins (such as /opt/ast/bin/cat) can now be executed + by invoking the canonical path, so the following will now work: + $ /opt/ast/bin/cat --version + version cat (AT&T Research) 2012-05-31 + $ (PATH=/opt/ast/bin:$PATH; "$(whence -p cat)" --version) + version cat (AT&T Research) 2012-05-31 + In the event an external command by that path exists, the path-bound + built-in will now override it when invoked using the canonical path. + To invoke a possible external command at that path, you can still use + a non-canonical path, e.g.: /opt//ast/bin/cat or /opt/ast/./bin/cat + +24. The readonly attribute of ksh variables is no longer imported from + or exported to other ksh shell instances through the environment. + +25. Subshells (even if non-forked) now keep a properly separated state + of the pseudorandom generator used for $RANDOM, so that using + $RANDOM in a non-forked subshell no longer influences a reproducible + $RANDOM sequence in the parent environment. In addition, upon + invoking a subshell, $RANDOM is now reseeded (as mksh and bash do). + +26. The built-in arithmetic function int() has changed to round towards + zero instead of negative infinity. Previously, int() was an alias to + floor(), but now it behaves like trunc(). + +27. The '!' logical negation operator in the '[[' compound command now + correctly negates another '!', e.g., [[ ! ! 1 -eq 1 ]] now returns + 0/true. Note that this has always been the case for 'test'/'['. + +28. By default, arithmetic expressions in ksh no longer interpret a number + with a leading zero as octal in any context. Use 8#octalnumber instead. + Before, ksh would arbitrarily recognize the leading octal zero in some + contexts but not others. One of several examples is: + x=010; echo "$((x)), $(($x))" + would output '10, 8'. This now outputs '10, 10'. Arithmetic + expressions now also behave identically within and outside ((...)) + and $((...)). Setting the --posix compliance option turns on the + recognition of the leading octal zero for all arithmetic contexts. + +29. It is now an error for arithmetic expressions to assign an out-of-range + index value to a variable of an enumeration type created with 'enum'. + +30. For the 'return' built-in command, you can now freely specify any + return value that fits in a signed integer, typically a 32-bit value. + Note that $? is truncated to 8 bits when the current (sub)shell exits. ____________________________________________________________________________ KSH-93 VS. KSH-88 +(Written by David Korn for ksh 93u+ 2012-08-01) + The following is a list of known incompatibilities between ksh-93 and ksh-88. I have not included cases that are clearly bugs in ksh-88. I also have omitted features that are completely upward compatible. @@ -97,8 +181,10 @@ omitted features that are completely upward compatible. 1. Functions, defined with name() with ksh-93 are compatible with the POSIX standard, not with ksh-88. No local variables are permitted, and there is no separate scope. Functions defined - with the function name syntax, maintain compatibility. - This also affects function traces. + with the function name syntax have local variables as in ksh-88, + but are statically scoped as in C so that a function does not + automatically have access to local variables of the caller. + This change also affects function traces. 2. ! is now a reserved word. As a result, any command by that name will no longer work with ksh-93. @@ -119,7 +205,7 @@ omitted features that are completely upward compatible. for trap without arguments has a format that can be used as input. 6. With ksh-88, a dollar sign ($') followed by a single quote was - interpreted literally. Now it is an ANSI-C string. You + interpreted literally. Now it is an ANSI C string. You must quote the dollar sign to get the previous behavior. Also, a $ in front of a " indicates that the string needs to be translated for locales other than C or POSIX. The $ @@ -129,7 +215,7 @@ omitted features that are completely upward compatible. with ksh-93, ${foo-~} will cause tilde expansion if foo is not set. You need to escape the ~ for the previous behavior. -8. Some changes in the tokenizing rules where made that might +8. Some changes in the tokenizing rules were made that might cause some scripts with previously ambiguous use of quoting to produce syntax errors. @@ -176,6 +262,8 @@ omitted features that are completely upward compatible. 19. ksh-88 allowed unbalanced parentheses within ${name op val} whereas ksh-93 does not. Thus, ${foo-(} needs to be written as ${foo-\(} which works with both versions. + [2021 UPDATE: This is now once again allowed in ksh 93u+m. Note that + balanced parentheses ${foo-()} were also broken and are now fixed.] 20. kill -l in ksh-93 lists only the signal names, not their numerical values. @@ -215,10 +303,11 @@ omitted features that are completely upward compatible. the stty lnext character is set to control-v or is unset. The sequence escape control-v will display the shell version. -29. In ksh-88, DEBUG traps were executed. after each command. In ksh-93 +29. In ksh-88, DEBUG traps were executed after each command. In ksh-93 DEBUG traps are executed before each command. 30. In ksh-88, a redirection to a file name given by an empty string was ignored. In ksh-93, this is an error. + I am interested in expanding this list so please let me know if you uncover any others. diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/DESIGN b/cde/programs/dtksh/ksh93/src/cmd/ksh93/DESIGN index f8587b6aa..022d6870e 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/DESIGN +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/DESIGN @@ -46,7 +46,7 @@ Directory layout: Include directory: 1. argnod.h contains the type definitions for command nodes, io nodes, argument nodes, and for positional - parameters.a It defines the prototypes for + parameters. It defines the prototypes for all the positional parameters functions. 2. builtins.h contains prototypes for builtins as well as symbolic constants that refer to the name-pairs @@ -89,7 +89,7 @@ Include directory: functions. 19. terminal.h is a header file that includes the appropriate terminal include. - 20. test.h contains the definitions for the test and [[...]] + 20. test.h contains the definitions for the test and [[ ... ]] commands. 21. timeout.h contains the define constant for the maximum shell timeout. @@ -109,7 +109,7 @@ sh directory: 5. deparse.c contains code to generate shell script from a parse tree. 6. expand.c contains code for file name expansion and - file name generation. + pathname expansion. 7. fault.c contains code for signal processing, trap handling and termination. 8. fcin.c contains code for reading and writing a character diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/Mamfile b/cde/programs/dtksh/ksh93/src/cmd/ksh93/Mamfile index 490d55d7e..d604c138e 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/Mamfile +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/Mamfile @@ -10,12 +10,8 @@ note * http://web.archive.org/web/20041227143022/http://www2.research.att.com/~g note * setv INSTALLROOT ../../.. setv PACKAGE_ast_INCLUDE ${INSTALLROOT}/include/ast -setv PACKAGE_ast_LIB ${INSTALLROOT}/lib setv 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 @@ -23,31 +19,9 @@ setv KSH_SHOPTFLAGS setv CCFLAGS ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${mam_cc_OPTIMIZE}?} setv CCLDFLAGS ${-strip-symbols?1?${mam_cc_LD_STRIP}??} setv COTEMP $$ -setv CPIO cpio -setv CPIOFLAGS -setv CPP "${CC} -E" -setv F77 f77 -setv HOSTCC ${CC} setv IFFEFLAGS -setv IGNORE -setv LD ld setv LDFLAGS -setv LEX lex -setv LEXFLAGS -setv LPR lpr -setv LPRFLAGS -setv M4FLAGS -setv NMAKE nmake -setv NMAKEFLAGS -setv PR pr -setv PRFLAGS -setv SHELL /bin/sh -setv SILENT -setv TAR tar -setv YACC yacc -setv YACCFLAGS -d -make ${PACKAGEROOT}/lib/package/ast.lic -done ${PACKAGEROOT}/lib/package/ast.lic +setv SH_DICT \"libshell\" make install make ksh make SHOPT.sh implicit @@ -77,8 +51,8 @@ make install exec - esac exec - continue exec - elif test ! -f ${INSTALLROOT}/lib/lib$i.a - exec - then case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in - exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' $x ;} | sed -e 's/[][()+@?]/#/g' || :` in + exec - then case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -L${INSTALLROOT}/lib ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in + exec - *$x*) case `{ ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} -o 1.${COTEMP}.x 1.${COTEMP}.o -l$i 2>&1 || echo '' "$x" ;} | sed -e 's/[][()+@?]/#/g' || :` in exec - *$x*) continue ;; exec - esac exec - ;; @@ -95,89 +69,102 @@ make install bind -last bind -lm dontcare bind -lnsl dontcare - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/externs + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/externs done FEATURE/externs generated make include/shell.h implicit + make include/fault.h implicit + make FEATURE/sigfeatures implicit + meta FEATURE/sigfeatures features/%>FEATURE/% features/sigfeatures sigfeatures + make features/sigfeatures + done features/sigfeatures + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/sigfeatures + done FEATURE/sigfeatures dontcare generated + make FEATURE/setjmp implicit + meta FEATURE/setjmp features/%>FEATURE/% features/setjmp setjmp + make features/setjmp + done features/setjmp + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/setjmp + done FEATURE/setjmp dontcare generated + prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + make ${PACKAGE_ast_INCLUDE}/sig.h implicit + done ${PACKAGE_ast_INCLUDE}/sig.h dontcare + done include/fault.h dontcare + make ${PACKAGE_ast_INCLUDE}/stk.h implicit + make ${PACKAGE_ast_INCLUDE}/sfio.h implicit + make ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + done ${PACKAGE_ast_INCLUDE}/sfio_s.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_map.h dontcare + make ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${PACKAGE_ast_INCLUDE}/bytesex.h dontcare + done ${PACKAGE_ast_INCLUDE}/endian.h dontcare + done ${PACKAGE_ast_INCLUDE}/ast_common.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + make ${PACKAGE_ast_INCLUDE}/regex.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_api.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_api.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + make ${PACKAGE_ast_INCLUDE}/wctype.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + make ${PACKAGE_ast_INCLUDE}/wchar.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit + done ${PACKAGE_ast_INCLUDE}/wchar.h dontcare + done ${PACKAGE_ast_INCLUDE}/ast_wctype.h dontcare + done ${PACKAGE_ast_INCLUDE}/wctype.h dontcare + make ${PACKAGE_ast_INCLUDE}/stdio.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_stdio.h dontcare + done ${PACKAGE_ast_INCLUDE}/stdio.h dontcare + prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${PACKAGE_ast_INCLUDE}/regex.h dontcare + make ${PACKAGE_ast_INCLUDE}/getopt.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_getopt.h dontcare + done ${PACKAGE_ast_INCLUDE}/getopt.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_botch.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_limits.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_fs.h dontcare + done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit + make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit + prev ${PACKAGE_ast_INCLUDE}/getopt.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + prev ${PACKAGE_ast_INCLUDE}/endian.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_sys.h dontcare + make ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_lib.h dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${PACKAGE_ast_INCLUDE}/ast_std.h dontcare + done ${PACKAGE_ast_INCLUDE}/sfio.h dontcare + done ${PACKAGE_ast_INCLUDE}/stk.h dontcare + make include/history.h implicit + prev ${PACKAGE_ast_INCLUDE}/ast.h implicit + done include/history.h dontcare make ${PACKAGE_ast_INCLUDE}/cmd.h implicit make ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit done ${PACKAGE_ast_INCLUDE}/dlldefs.h dontcare make ${PACKAGE_ast_INCLUDE}/cmdext.h implicit make ${PACKAGE_ast_INCLUDE}/shcmd.h implicit - make ${PACKAGE_ast_INCLUDE}/prototyped.h implicit - done ${PACKAGE_ast_INCLUDE}/prototyped.h dontcare done ${PACKAGE_ast_INCLUDE}/shcmd.h dontcare - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/cmdext.h dontcare prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit make ${PACKAGE_ast_INCLUDE}/stak.h implicit - make ${PACKAGE_ast_INCLUDE}/stk.h implicit - make ${PACKAGE_ast_INCLUDE}/sfio.h implicit - make ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit - done ${PACKAGE_ast_INCLUDE}/sfio_s.h dontcare - make ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_map.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_map.h dontcare - make ${PACKAGE_ast_INCLUDE}/endian.h implicit - make ${PACKAGE_ast_INCLUDE}/bytesex.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - done ${PACKAGE_ast_INCLUDE}/bytesex.h dontcare - done ${PACKAGE_ast_INCLUDE}/endian.h dontcare - done ${PACKAGE_ast_INCLUDE}/ast_common.h dontcare - make ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - make ${PACKAGE_ast_INCLUDE}/regex.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_api.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_api.h dontcare - make ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit - make ${PACKAGE_ast_INCLUDE}/wctype.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_wctype.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h implicit - make ${PACKAGE_ast_INCLUDE}/wchar.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_wchar.h implicit - done ${PACKAGE_ast_INCLUDE}/wchar.h dontcare - done ${PACKAGE_ast_INCLUDE}/ast_wctype.h dontcare - done ${PACKAGE_ast_INCLUDE}/wctype.h dontcare - make ${PACKAGE_ast_INCLUDE}/stdio.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_stdio.h implicit - prev ${PACKAGE_ast_INCLUDE}/sfio_s.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_stdio.h dontcare - done ${PACKAGE_ast_INCLUDE}/stdio.h dontcare - prev ${PACKAGE_ast_INCLUDE}/stdio.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_wchar.h dontcare - prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit - done ${PACKAGE_ast_INCLUDE}/regex.h dontcare - make ${PACKAGE_ast_INCLUDE}/getopt.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_getopt.h dontcare - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit - done ${PACKAGE_ast_INCLUDE}/getopt.h dontcare - prev ${PACKAGE_ast_INCLUDE}/ast_map.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_botch.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_botch.h dontcare - make ${PACKAGE_ast_INCLUDE}/ast_limits.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_limits.h dontcare - make ${PACKAGE_ast_INCLUDE}/ast_fcntl.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_fs.h dontcare - done ${PACKAGE_ast_INCLUDE}/ast_fcntl.h dontcare - prev ${PACKAGE_ast_INCLUDE}/ast_getopt.h implicit - make ${PACKAGE_ast_INCLUDE}/ast_sys.h implicit - prev ${PACKAGE_ast_INCLUDE}/getopt.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h implicit - prev ${PACKAGE_ast_INCLUDE}/endian.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_sys.h dontcare - make ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_lib.h dontcare - prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit - done ${PACKAGE_ast_INCLUDE}/ast_std.h dontcare - done ${PACKAGE_ast_INCLUDE}/sfio.h dontcare - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit - done ${PACKAGE_ast_INCLUDE}/stk.h dontcare - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit + prev ${PACKAGE_ast_INCLUDE}/stk.h implicit done ${PACKAGE_ast_INCLUDE}/stak.h dontcare make ${PACKAGE_ast_INCLUDE}/error.h implicit make ${PACKAGE_ast_INCLUDE}/option.h implicit @@ -189,18 +176,18 @@ make install done ${PACKAGE_ast_INCLUDE}/vmalloc.h dontcare prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/ast.h dontcare - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/option.h dontcare prev ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/error.h dontcare prev ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/cmd.h dontcare prev ${PACKAGE_ast_INCLUDE}/shcmd.h implicit make include/nval.h implicit + make ${PACKAGE_ast_INCLUDE}/hash.h implicit + make ${PACKAGE_ast_INCLUDE}/hashpart.h implicit + done ${PACKAGE_ast_INCLUDE}/hashpart.h dontcare + done ${PACKAGE_ast_INCLUDE}/hash.h dontcare prev ${PACKAGE_ast_INCLUDE}/option.h implicit make ${PACKAGE_ast_INCLUDE}/cdt.h implicit prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit @@ -220,7 +207,7 @@ make install meta pmain.o %.c>%.o sh/pmain.c pmain prev sh/pmain.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/pmain.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/pmain.c done pmain.o generated make libshell.a archive prev shell.req @@ -230,12 +217,11 @@ make install meta FEATURE/time features/%>FEATURE/% features/time time make features/time done features/time - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/time + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/time make ${PACKAGE_ast_INCLUDE}/times.h implicit make ${PACKAGE_ast_INCLUDE}/ast_time.h implicit done ${PACKAGE_ast_INCLUDE}/ast_time.h dontcare prev ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/times.h dontcare done FEATURE/time generated make include/builtins.h implicit @@ -245,14 +231,14 @@ make install meta FEATURE/dynamic features/%>FEATURE/% features/dynamic dynamic make features/dynamic done features/dynamic - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/dynamic + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/dynamic prev ${PACKAGE_ast_INCLUDE}/dlldefs.h implicit done FEATURE/dynamic dontcare generated make FEATURE/options implicit meta FEATURE/options features/%>FEATURE/% features/options options make features/options done features/options - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/options + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/options done FEATURE/options dontcare generated prev ${PACKAGE_ast_INCLUDE}/option.h implicit done include/builtins.h @@ -268,27 +254,6 @@ make install make include/argnod.h implicit prev ${PACKAGE_ast_INCLUDE}/stak.h implicit done include/argnod.h dontcare - make include/fault.h implicit - make FEATURE/sigfeatures implicit - meta FEATURE/sigfeatures features/%>FEATURE/% features/sigfeatures sigfeatures - make features/sigfeatures - done features/sigfeatures - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/sigfeatures - done FEATURE/sigfeatures dontcare generated - make FEATURE/setjmp implicit - meta FEATURE/setjmp features/%>FEATURE/% features/setjmp setjmp - make features/setjmp - done features/setjmp - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/setjmp - done FEATURE/setjmp dontcare generated - prev ${PACKAGE_ast_INCLUDE}/sfio.h implicit - prev ${PACKAGE_ast_INCLUDE}/error.h implicit - make ${PACKAGE_ast_INCLUDE}/sig.h implicit - done ${PACKAGE_ast_INCLUDE}/sig.h dontcare - done include/fault.h dontcare - make include/history.h implicit - prev ${PACKAGE_ast_INCLUDE}/ast.h implicit - done include/history.h dontcare prev ${PACKAGE_ast_INCLUDE}/cdt.h implicit prev FEATURE/options implicit prev FEATURE/externs implicit @@ -300,23 +265,27 @@ make install meta alarm.o %.c>%.o bltins/alarm.c alarm prev bltins/alarm.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/alarm.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/alarm.c done alarm.o generated make cd_pwd.o make bltins/cd_pwd.c + make include/test.h implicit + prev include/shtable.h implicit + prev include/defs.h implicit + prev FEATURE/options implicit + done include/test.h make ${PACKAGE_ast_INCLUDE}/ls.h implicit make ${PACKAGE_ast_INCLUDE}/ast_mode.h implicit done ${PACKAGE_ast_INCLUDE}/ast_mode.h dontcare prev ${PACKAGE_ast_INCLUDE}/ast_fs.h implicit prev ${PACKAGE_ast_INCLUDE}/ast_std.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/ls.h prev include/builtins.h implicit prev include/name.h implicit make include/path.h implicit make FEATURE/acct implicit meta FEATURE/acct >FEATURE/% acct - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def acct + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def acct done FEATURE/acct dontcare generated prev include/defs.h implicit prev include/nval.h implicit @@ -326,6 +295,7 @@ make install prev FEATURE/dynamic implicit prev FEATURE/options implicit prev ${PACKAGE_ast_INCLUDE}/option.h implicit + prev include/nval.h implicit done include/variables.h prev ${PACKAGE_ast_INCLUDE}/error.h implicit prev ${PACKAGE_ast_INCLUDE}/stak.h implicit @@ -334,7 +304,7 @@ make install meta cd_pwd.o %.c>%.o bltins/cd_pwd.c cd_pwd prev bltins/cd_pwd.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_BLD_shell -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/cd_pwd.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/cd_pwd.c done cd_pwd.o generated make cflow.o make bltins/cflow.c @@ -350,30 +320,26 @@ make install meta cflow.o %.c>%.o bltins/cflow.c cflow prev bltins/cflow.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/cflow.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/cflow.c done cflow.o generated make deparse.o make sh/deparse.c - make include/test.h implicit - prev include/shtable.h implicit - prev include/defs.h implicit - prev FEATURE/options implicit - done include/test.h + prev include/test.h implicit prev include/shnodes.h implicit prev include/defs.h implicit done sh/deparse.c meta deparse.o %.c>%.o sh/deparse.c deparse prev sh/deparse.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/deparse.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/deparse.c done deparse.o generated make enum.o make bltins/enum.c - prev include/shell.h implicit + prev include/defs.h implicit done bltins/enum.c meta enum.o %.c>%.o bltins/enum.c enum prev bltins/enum.c - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=\""libshell"\" -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/enum.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CATALOG=${SH_DICT} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/enum.c prev SHOPT.sh done enum.o generated make getopts.o @@ -387,7 +353,7 @@ make install meta getopts.o %.c>%.o bltins/getopts.c getopts prev bltins/getopts.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/getopts.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/getopts.c done getopts.o generated make hist.o make bltins/hist.c @@ -399,7 +365,7 @@ make install meta FEATURE/ttys features/%>FEATURE/% features/ttys ttys make features/ttys done features/ttys - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/ttys + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/ttys done FEATURE/ttys dontcare generated done include/terminal.h dontcare prev FEATURE/setjmp implicit @@ -408,7 +374,7 @@ make install meta FEATURE/locale features/%>FEATURE/% features/locale locale make features/locale done features/locale - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/locale + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/locale done FEATURE/locale dontcare generated prev FEATURE/options implicit done include/edit.h dontcare @@ -428,10 +394,13 @@ make install meta hist.o %.c>%.o bltins/hist.c hist prev bltins/hist.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/hist.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/hist.c done hist.o generated make misc.o make bltins/misc.c + prev ${PACKAGE_ast_INCLUDE}/times.h implicit + prev FEATURE/time implicit + prev FEATURE/locale implicit make include/jobs.h implicit prev ${PACKAGE_ast_INCLUDE}/vmalloc.h implicit prev include/terminal.h implicit @@ -451,15 +420,26 @@ make install meta misc.o %.c>%.o bltins/misc.c misc prev bltins/misc.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c bltins/misc.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/misc.c done misc.o generated + make mkservice.o + make bltins/mkservice.c + prev ${PACKAGE_ast_INCLUDE}/cmd.h implicit + prev ${PACKAGE_ast_INCLUDE}/error.h implicit + prev include/nval.h implicit + prev include/defs.h implicit + done bltins/mkservice.c + meta mkservice.o %.c>%.o bltins/mkservice.c mkservice + prev bltins/mkservice.c + prev SHOPT.sh + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSH_DICT=${SH_DICT} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/mkservice.c + done mkservice.o generated make print.o make bltins/print.c make ${PACKAGE_ast_INCLUDE}/ccode.h implicit make ${PACKAGE_ast_INCLUDE}/ast_ccode.h implicit done ${PACKAGE_ast_INCLUDE}/ast_ccode.h dontcare prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/ccode.h make ${PACKAGE_ast_INCLUDE}/tmx.h implicit make ${PACKAGE_ast_INCLUDE}/tv.h implicit @@ -468,7 +448,6 @@ make install make ${PACKAGE_ast_INCLUDE}/tm.h implicit prev ${PACKAGE_ast_INCLUDE}/times.h implicit prev ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/tm.h dontcare done ${PACKAGE_ast_INCLUDE}/tmx.h make include/streval.h implicit @@ -491,7 +470,7 @@ make install meta print.o %.c>%.o bltins/print.c print prev bltins/print.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c bltins/print.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/print.c done print.o generated make read.o make bltins/read.c @@ -514,7 +493,7 @@ make install meta read.o %.c>%.o bltins/read.c read prev bltins/read.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/read.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/read.c done read.o generated make sleep.o make bltins/sleep.c @@ -522,7 +501,7 @@ make install meta FEATURE/poll features/%>FEATURE/% features/poll poll make features/poll done features/poll - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/poll done FEATURE/poll generated prev FEATURE/time implicit prev include/builtins.h implicit @@ -533,7 +512,7 @@ make install meta sleep.o %.c>%.o bltins/sleep.c sleep prev bltins/sleep.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/sleep.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/sleep.c done sleep.o generated make trap.o make bltins/trap.c @@ -544,7 +523,7 @@ make install meta trap.o %.c>%.o bltins/trap.c trap prev bltins/trap.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/trap.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/trap.c done trap.o generated make test.o make bltins/test.c @@ -563,7 +542,7 @@ make install meta test.o %.c>%.o bltins/test.c test prev bltins/test.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c bltins/test.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/test.c done test.o generated make typeset.o make bltins/typeset.c @@ -579,7 +558,7 @@ make install meta typeset.o %.c>%.o bltins/typeset.c typeset prev bltins/typeset.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/typeset.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/typeset.c done typeset.o generated make ulimit.o make bltins/ulimit.c @@ -588,7 +567,7 @@ make install meta FEATURE/rlimits features/%>FEATURE/% features/rlimits rlimits make features/rlimits done features/rlimits - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/rlimits + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/rlimits done FEATURE/rlimits dontcare generated prev FEATURE/time implicit done include/ulimit.h @@ -602,7 +581,7 @@ make install meta ulimit.o %.c>%.o bltins/ulimit.c ulimit prev bltins/ulimit.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c bltins/ulimit.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/ulimit.c done ulimit.o generated make umask.o make bltins/umask.c @@ -616,7 +595,7 @@ make install meta umask.o %.c>%.o bltins/umask.c umask prev bltins/umask.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/umask.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/umask.c done umask.o generated make whence.o make bltins/whence.c @@ -637,7 +616,7 @@ make install meta whence.o %.c>%.o bltins/whence.c whence prev bltins/whence.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/whence.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c bltins/whence.c done whence.o generated make main.o make sh/main.c @@ -648,15 +627,15 @@ make install prev FEATURE/externs implicit make FEATURE/execargs implicit meta FEATURE/execargs >FEATURE/% execargs - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def execargs + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def execargs done FEATURE/execargs generated make FEATURE/pstat implicit meta FEATURE/pstat >FEATURE/% pstat - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def pstat + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def pstat done FEATURE/pstat generated make FEATURE/setproctitle implicit meta FEATURE/setproctitle >FEATURE/% setproctitle - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def setproctitle + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : def setproctitle done FEATURE/setproctitle generated prev FEATURE/time implicit make include/timeout.h implicit @@ -680,10 +659,12 @@ make install meta main.o %.c>%.o sh/main.c main prev sh/main.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_TIMEOUT+-DSHOPT_TIMEOUT=${SHOPT_TIMEOUT}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_REMOTE+-DSHOPT_REMOTE=${SHOPT_REMOTE}} ${SHOPT_OLDTERMIO+-DSHOPT_OLDTERMIO=${SHOPT_OLDTERMIO}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}}${SH_DICT+-DSH_DICT=${SH_DICT}} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/main.c + exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_TIMEOUT+-DSHOPT_TIMEOUT=${SHOPT_TIMEOUT}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_REMOTE+-DSHOPT_REMOTE=${SHOPT_REMOTE}} ${SHOPT_OLDTERMIO+-DSHOPT_OLDTERMIO=${SHOPT_OLDTERMIO}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${DEBUG+-DDEBUG=${DEBUG}} -DSH_DICT=${SH_DICT} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/main.c done main.o generated make nvdisc.o make sh/nvdisc.c + prev include/shlex.h implicit + prev include/io.h implicit prev include/path.h implicit prev include/builtins.h implicit prev include/variables.h implicit @@ -692,7 +673,7 @@ make install meta nvdisc.o %.c>%.o sh/nvdisc.c nvdisc prev sh/nvdisc.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/nvdisc.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/nvdisc.c done nvdisc.o generated make nvtype.o make sh/nvtype.c @@ -703,7 +684,7 @@ make install meta nvtype.o %.c>%.o sh/nvtype.c nvtype prev sh/nvtype.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/nvtype.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/nvtype.c done nvtype.o generated make arith.o make sh/arith.c @@ -717,7 +698,7 @@ make install meta arith.o %.c>%.o sh/arith.c arith prev sh/arith.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/arith.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/arith.c done arith.o generated make args.o make sh/args.c @@ -727,13 +708,14 @@ make install prev include/edit.h implicit prev include/terminal.h implicit prev include/builtins.h implicit + prev include/jobs.h implicit prev include/path.h implicit prev include/defs.h implicit done sh/args.c meta args.o %.c>%.o sh/args.c args prev sh/args.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/args.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/args.c done args.o generated make array.o make sh/array.c @@ -744,7 +726,7 @@ make install meta array.o %.c>%.o sh/array.c array prev sh/array.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/array.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/array.c done array.o generated make completion.o make edit/completion.c @@ -759,7 +741,7 @@ make install meta completion.o %.c>%.o edit/completion.c completion prev edit/completion.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DKSHELL -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/completion.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c edit/completion.c done completion.o generated make defs.o make sh/defs.c @@ -772,10 +754,11 @@ make install meta defs.o %.c>%.o sh/defs.c defs prev sh/defs.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/defs.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/defs.c done defs.o generated make edit.o make edit/edit.c + prev include/shlex.h implicit prev include/edit.h implicit prev include/history.h implicit prev include/terminal.h implicit @@ -787,17 +770,18 @@ make install meta FEATURE/cmds features/%>FEATURE/% features/cmds cmds make features/cmds done features/cmds - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/cmds + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/cmds done FEATURE/cmds generated prev FEATURE/time implicit prev FEATURE/options implicit + prev include/fault.h implicit prev ${PACKAGE_ast_INCLUDE}/ccode.h implicit prev ${PACKAGE_ast_INCLUDE}/ast.h implicit done edit/edit.c meta edit.o %.c>%.o edit/edit.c edit prev edit/edit.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/edit.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/edit.c done edit.o generated make expand.o make sh/expand.c @@ -812,12 +796,10 @@ make install make dirlib.h implicit done dirlib.h dontcare virtual prev ${PACKAGE_ast_INCLUDE}/ast_lib.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/ast_dir.h prev ${PACKAGE_ast_INCLUDE}/stak.h implicit prev ${PACKAGE_ast_INCLUDE}/ls.h implicit make ${PACKAGE_ast_INCLUDE}/glob.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/glob.h prev ${PACKAGE_ast_INCLUDE}/ast.h implicit prev include/test.h implicit @@ -827,7 +809,7 @@ make install meta expand.o %.c>%.o sh/expand.c expand prev sh/expand.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/expand.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/expand.c done expand.o generated make regress.o make bltins/regress.c @@ -841,7 +823,7 @@ make install meta regress.o %.c>%.o bltins/regress.c regress prev bltins/regress.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c bltins/regress.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c bltins/regress.c done regress.o generated make fault.o make sh/fault.c @@ -860,7 +842,7 @@ make install meta fault.o %.c>%.o sh/fault.c fault prev sh/fault.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/fault.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/fault.c done fault.o generated make fcin.o make sh/fcin.c @@ -892,7 +874,7 @@ make install meta history.o %.c>%.o edit/history.c history prev edit/history.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c edit/history.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c edit/history.c done history.o generated make init.o make sh/init.c @@ -922,7 +904,7 @@ make install meta init.o %.c>%.o sh/init.c init prev sh/init.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/init.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/init.c done init.o generated make io.o make sh/io.c @@ -934,6 +916,7 @@ make install prev include/edit.h implicit prev include/history.h implicit prev include/shnodes.h implicit + prev include/shlex.h implicit prev include/jobs.h implicit prev include/io.h implicit prev include/path.h implicit @@ -946,7 +929,7 @@ make install meta io.o %.c>%.o sh/io.c io prev sh/io.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/io.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/io.c done io.o generated make jobs.o make sh/jobs.c @@ -957,14 +940,13 @@ make install make ${PACKAGE_ast_INCLUDE}/ast_wait.h implicit done ${PACKAGE_ast_INCLUDE}/ast_wait.h dontcare prev ${PACKAGE_ast_INCLUDE}/ast.h implicit - prev ${PACKAGE_ast_INCLUDE}/prototyped.h implicit done ${PACKAGE_ast_INCLUDE}/wait.h prev include/defs.h implicit done sh/jobs.c meta jobs.o %.c>%.o sh/jobs.c jobs prev sh/jobs.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/jobs.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/jobs.c done jobs.o generated make lex.o make sh/lex.c @@ -984,7 +966,7 @@ make install meta lex.o %.c>%.o sh/lex.c lex prev sh/lex.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c sh/lex.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/lex.c done lex.o generated make macro.o make sh/macro.c @@ -1004,7 +986,7 @@ make install meta macro.o %.c>%.o sh/macro.c macro prev sh/macro.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/macro.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/macro.c done macro.o generated make name.o make sh/name.c @@ -1021,7 +1003,7 @@ make install meta name.o %.c>%.o sh/name.c name prev sh/name.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/name.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c sh/name.c done name.o generated make nvtree.o make sh/nvtree.c @@ -1033,7 +1015,7 @@ make install meta nvtree.o %.c>%.o sh/nvtree.c nvtree prev sh/nvtree.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/nvtree.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/nvtree.c done nvtree.o generated make parse.o make sh/parse.c @@ -1051,7 +1033,7 @@ make install meta parse.o %.c>%.o sh/parse.c parse prev sh/parse.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/parse.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/parse.c done parse.o generated make path.o make sh/path.c @@ -1077,7 +1059,7 @@ make install meta path.o %.c>%.o sh/path.c path prev sh/path.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/path.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/path.c done path.o generated make string.o make sh/string.c @@ -1094,7 +1076,7 @@ make install meta string.o %.c>%.o sh/string.c string prev sh/string.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/string.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/string.c done string.o generated make streval.o make sh/streval.c @@ -1107,7 +1089,7 @@ make install meta streval.o %.c>%.o sh/streval.c streval prev sh/streval.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/streval.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/streval.c done streval.o generated make subshell.o make sh/subshell.c @@ -1124,7 +1106,7 @@ make install meta subshell.o %.c>%.o sh/subshell.c subshell prev sh/subshell.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/subshell.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/subshell.c done subshell.o generated make tdump.o make sh/tdump.c @@ -1137,7 +1119,7 @@ make install meta tdump.o %.c>%.o sh/tdump.c tdump prev sh/tdump.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/tdump.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/tdump.c done tdump.o generated make timers.o make sh/timers.c @@ -1152,7 +1134,7 @@ make install meta timers.o %.c>%.o sh/timers.c timers prev sh/timers.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c sh/timers.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/timers.c done timers.o generated make trestore.o make sh/trestore.c @@ -1165,7 +1147,7 @@ make install meta trestore.o %.c>%.o sh/trestore.c trestore prev sh/trestore.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -DKSHELL -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/trestore.c + exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_SYSRC+-DSHOPT_SYSRC=${SHOPT_SYSRC}} ${SHOPT_ACCT+-DSHOPT_ACCT=${SHOPT_ACCT}} ${SHOPT_SPAWN+-DSHOPT_SPAWN=${SHOPT_SPAWN}} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/trestore.c done trestore.o generated make waitevent.o make sh/waitevent.c @@ -1174,7 +1156,7 @@ make install meta waitevent.o %.c>%.o sh/waitevent.c waitevent prev sh/waitevent.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/waitevent.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/waitevent.c done waitevent.o generated make xec.o make sh/xec.c @@ -1198,7 +1180,7 @@ make install meta xec.o %.c>%.o sh/xec.c xec prev sh/xec.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -DKSHELL -c sh/xec.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/xec.c done xec.o generated make limits.o make data/limits.c @@ -1227,7 +1209,7 @@ make install meta msg.o %.c>%.o data/msg.c msg prev data/msg.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c data/msg.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/msg.c done msg.o generated make strdata.o make data/strdata.c @@ -1237,9 +1219,14 @@ make install make data/math.tab implicit done data/math.tab done features/math.sh dontcare - exec - iffe ${IFFEFLAGS} -v -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${LDFLAGS} ' ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab + exec - iffe ${IFFEFLAGS} -v -c "${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS}" ref ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -I${PACKAGE_ast_INCLUDE} -I${INSTALLROOT}/include ${mam_libdll} ${mam_libcmd} ${mam_libast} ${mam_libm} ${mam_libnsl} : run features/math.sh ${PACKAGEROOT}/src/cmd/ksh93/data/math.tab make ${PACKAGE_ast_INCLUDE}/ast_standards.h implicit done ${PACKAGE_ast_INCLUDE}/ast_standards.h dontcare + make ${INSTALLROOT}/src/lib/libast/FEATURE/float implicit + make ${INSTALLROOT}/src/lib/libast/FEATURE/standards implicit + done ${INSTALLROOT}/src/lib/libast/FEATURE/standards dontcare + prev ${PACKAGE_ast_INCLUDE}/ast_common.h implicit + done ${INSTALLROOT}/src/lib/libast/FEATURE/float dontcare done FEATURE/math generated prev include/streval.h implicit prev FEATURE/options implicit @@ -1248,7 +1235,7 @@ make install meta strdata.o %.c>%.o data/strdata.c strdata prev data/strdata.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} ${SH_DICT+-DSH_DICT=${SH_DICT}} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/strdata.c + exec - ${CC} ${mam_cc_FLAGS} ${SHOPT_P_SUID+-DSHOPT_P_SUID=${SHOPT_P_SUID}} ${SHOPT_REGRESS+-DSHOPT_REGRESS=${SHOPT_REGRESS}} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${-debug-symbols?1?${mam_cc_DEBUG} -D_BLD_DEBUG?${CCFLAGS.FORCE}?} ${SH_CMDLIB_DIR+-DSH_CMDLIB_DIR=${SH_CMDLIB_DIR}} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/strdata.c done strdata.o generated make testops.o make data/testops.c @@ -1259,7 +1246,7 @@ make install meta testops.o %.c>%.o data/testops.c testops prev data/testops.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/testops.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/testops.c done testops.o generated make keywords.o make data/keywords.c @@ -1270,7 +1257,7 @@ make install meta keywords.o %.c>%.o data/keywords.c keywords prev data/keywords.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c data/keywords.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/keywords.c done keywords.o generated make options.o make data/options.c @@ -1281,16 +1268,17 @@ make install meta options.o %.c>%.o data/options.c options prev data/options.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/options.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/options.c done options.o generated make signals.o make data/signals.c + prev include/jobs.h implicit prev include/defs.h implicit done data/signals.c meta signals.o %.c>%.o data/signals.c signals prev data/signals.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/signals.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/signals.c done signals.o generated make aliases.o make data/aliases.c @@ -1301,7 +1289,7 @@ make install meta aliases.o %.c>%.o data/aliases.c aliases prev data/aliases.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/aliases.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/aliases.c done aliases.o generated make builtins.o make data/builtins.c @@ -1317,7 +1305,7 @@ make install meta builtins.o %.c>%.o data/builtins.c builtins prev data/builtins.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -D_API_ast=20100309 -D_PACKAGE_ast -D_BLD_shell -DKSHELL -DERROR_CONTEXT_T=Error_context_t -c data/builtins.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -DSH_DICT=${SH_DICT} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c data/builtins.c done builtins.o generated make variables.o make data/variables.c @@ -1334,7 +1322,7 @@ make install meta variables.o %.c>%.o data/variables.c variables prev data/variables.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_BLD_shell -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/variables.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c data/variables.c done variables.o generated make lexstates.o make data/lexstates.c @@ -1360,7 +1348,7 @@ make install meta emacs.o %.c>%.o edit/emacs.c emacs prev edit/emacs.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_API_ast=20100309 -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/emacs.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/emacs.c done emacs.o generated make vi.o make edit/vi.c @@ -1377,7 +1365,7 @@ make install meta vi.o %.c>%.o edit/vi.c vi prev edit/vi.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DKSHELL -D_BLD_shell -DERROR_CONTEXT_T=Error_context_t -c edit/vi.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c edit/vi.c done vi.o generated make hexpand.o make edit/hexpand.c @@ -1387,9 +1375,9 @@ make install meta hexpand.o %.c>%.o edit/hexpand.c hexpand prev edit/hexpand.c prev SHOPT.sh - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DKSHELL -D_PACKAGE_ast -D_BLD_shell -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/hexpand.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -D_API_ast=20100309 -DERROR_CONTEXT_T=Error_context_t -c edit/hexpand.c done hexpand.o generated - exec - ${AR} rc libshell.a alarm.o cd_pwd.o cflow.o deparse.o enum.o getopts.o hist.o misc.o print.o read.o sleep.o trap.o test.o typeset.o ulimit.o umask.o whence.o main.o nvdisc.o nvtype.o arith.o args.o array.o completion.o defs.o edit.o expand.o regress.o fault.o fcin.o + exec - ${AR} rc libshell.a alarm.o cd_pwd.o cflow.o deparse.o enum.o getopts.o hist.o misc.o mkservice.o print.o read.o sleep.o trap.o test.o typeset.o ulimit.o umask.o whence.o main.o nvdisc.o nvtype.o arith.o args.o array.o completion.o defs.o edit.o expand.o regress.o fault.o fcin.o exec - ${AR} rc libshell.a history.o init.o io.o jobs.o lex.o macro.o name.o nvtree.o parse.o path.o string.o streval.o subshell.o tdump.o timers.o trestore.o waitevent.o xec.o limits.o msg.o strdata.o testops.o keywords.o options.o signals.o aliases.o builtins.o variables.o lexstates.o emacs.o vi.o hexpand.o exec - (ranlib libshell.a) >/dev/null 2>&1 || true done libshell.a generated @@ -1403,7 +1391,9 @@ make install make shcomp make shcomp.o make sh/shcomp.c + prev include/terminal.h implicit prev include/shnodes.h implicit + prev include/path.h implicit prev include/defs.h implicit prev include/shell.h implicit prev include/version.h implicit @@ -1411,19 +1401,13 @@ make install meta shcomp.o %.c>%.o sh/shcomp.c shcomp prev sh/shcomp.c prev SHOPT.sh - setv CC.DLL -UCC.DLL - setv SH_DICT -DSH_DICT="\"libshell\"" - setv _BLD_shell -U_BLD_shell - setv _BLD_DLL -U_BLD_DLL - exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSH_DICT=\""libshell"\" -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -DUSAGE_LICENSE=\""[-author?David Korn ][-copyright?Copyright (c) 1982-2012 AT&T Intellectual Property][-license?http://www.eclipse.org/org/documents/epl-v10.html][--catalog?libshell]"\" -c sh/shcomp.c + exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DSH_DICT=${SH_DICT} -D_API_ast=20100309 -D_PACKAGE_ast -DERROR_CONTEXT_T=Error_context_t -c sh/shcomp.c done shcomp.o generated prev libshell.a archive prev +ljobs prev +li prev ${mam_libsocket} prev ${mam_libsecdb} - setv CC.DLL -UCC.DLL - setv SH_DICT -DSH_DICT="\"libshell\"" exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o shcomp shcomp.o ${mam_libshell} ${mam_libnsl} ${mam_libast} done shcomp generated make suid_exec @@ -1439,15 +1423,12 @@ make install meta suid_exec.o %.c>%.o sh/suid_exec.c suid_exec prev sh/suid_exec.c prev SHOPT.sh - setv CC.DLL -UCC.DLL - setv _BLD_shell -U_BLD_shell exec - ${CC} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} -I. -Iinclude -I${PACKAGE_ast_INCLUDE} -DERROR_CONTEXT_T=Error_context_t -D_API_ast=20100309 -D_PACKAGE_ast -c sh/suid_exec.c done suid_exec.o generated prev +ljobs prev +li prev ${mam_libsocket} prev ${mam_libsecdb} - setv CC.DLL -UCC.DLL exec - ${CC} ${CCLDFLAGS} ${mam_cc_FLAGS} ${KSH_RELFLAGS} ${KSH_SHOPTFLAGS} ${CCFLAGS} ${LDFLAGS} -lm ${mam_cc_L+-L.} ${mam_cc_L+-L${INSTALLROOT}/lib} -o suid_exec suid_exec.o ${mam_libast} ${mam_libnsl} ${mam_libast} done suid_exec generated make shell @@ -1520,26 +1501,23 @@ make install make ${PACKAGE_ast_INCLUDE}/nval.h prev ${PACKAGE_ast_INCLUDE} prev include/nval.h - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/nval.h > 1.${COTEMP}.x - exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/nval.h 1.${COTEMP}.x - exec - then rm -f 1.${COTEMP}.x - exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/nval.h + exec - if cmp 2>/dev/null -s include/nval.h ${PACKAGE_ast_INCLUDE}/nval.h + exec - then : + exec - else ${STDCP} include/nval.h ${PACKAGE_ast_INCLUDE}/nval.h exec - fi done ${PACKAGE_ast_INCLUDE}/nval.h generated make ${PACKAGE_ast_INCLUDE}/shell.h prev include/shell.h - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/shell.h > 1.${COTEMP}.x - exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/shell.h 1.${COTEMP}.x - exec - then rm -f 1.${COTEMP}.x - exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/shell.h + exec - if cmp 2>/dev/null -s include/shell.h ${PACKAGE_ast_INCLUDE}/shell.h + exec - then : + exec - else ${STDCP} include/shell.h ${PACKAGE_ast_INCLUDE}/shell.h exec - fi done ${PACKAGE_ast_INCLUDE}/shell.h generated make ${PACKAGE_ast_INCLUDE}/history.h prev include/history.h - exec - proto -p -s -l ${PACKAGEROOT}/lib/package/ast.lic '-o since=1982,author=dgk' include/history.h > 1.${COTEMP}.x - exec - if cmp 2>/dev/null -s ${PACKAGE_ast_INCLUDE}/history.h 1.${COTEMP}.x - exec - then rm -f 1.${COTEMP}.x - exec - else mv 1.${COTEMP}.x ${PACKAGE_ast_INCLUDE}/history.h + exec - if cmp 2>/dev/null -s include/history.h ${PACKAGE_ast_INCLUDE}/history.h + exec - then : + exec - else ${STDCP} include/history.h ${PACKAGE_ast_INCLUDE}/history.h exec - fi done ${PACKAGE_ast_INCLUDE}/history.h generated make ${INSTALLROOT}/bin/suid_exec @@ -1559,19 +1537,16 @@ make install prev ${INSTALLROOT}/fun make fun/dirs done fun/dirs - setv mode -Dmode="+x" exec - test '' = 'fun/dirs' || ${STDCMP} 2>/dev/null -s fun/dirs ${INSTALLROOT}/fun/dirs || { ${STDMV} ${INSTALLROOT}/fun/dirs ${INSTALLROOT}/fun/dirs.old 2>/dev/null || true; ${STDCP} fun/dirs ${INSTALLROOT}/fun/dirs && chmod ugo+x ${INSTALLROOT}/fun/dirs ;} done ${INSTALLROOT}/fun/dirs generated make ${INSTALLROOT}/fun/popd make fun/popd done fun/popd - setv mode -Dmode="+x" exec - test '' = 'fun/popd' || ${STDCMP} 2>/dev/null -s fun/popd ${INSTALLROOT}/fun/popd || { ${STDMV} ${INSTALLROOT}/fun/popd ${INSTALLROOT}/fun/popd.old 2>/dev/null || true; ${STDCP} fun/popd ${INSTALLROOT}/fun/popd && chmod ugo+x ${INSTALLROOT}/fun/popd ;} done ${INSTALLROOT}/fun/popd generated make ${INSTALLROOT}/fun/pushd make fun/pushd done fun/pushd - setv mode -Dmode="+x" exec - test '' = 'fun/pushd' || ${STDCMP} 2>/dev/null -s fun/pushd ${INSTALLROOT}/fun/pushd || { ${STDMV} ${INSTALLROOT}/fun/pushd ${INSTALLROOT}/fun/pushd.old 2>/dev/null || true; ${STDCP} fun/pushd ${INSTALLROOT}/fun/pushd && chmod ugo+x ${INSTALLROOT}/fun/pushd ;} done ${INSTALLROOT}/fun/pushd generated done install virtual diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/OBSOLETE b/cde/programs/dtksh/ksh93/src/cmd/ksh93/OBSOLETE index 793d23f59..006e5de4c 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/OBSOLETE +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/OBSOLETE @@ -120,13 +120,13 @@ to re-execute the command. .LI The .B \-t -option to \fBalias\fR builtin is is obsolete. It +option to \fBalias\fR builtin is obsolete. It is used to set and list tracked aliases. There is no replacement. .LI The shell command line option .B \-t -is obsolete. This option cause the shell to exit after reading +is obsolete. This option causes the shell to exit after reading and executing one command. The is no replacement (although ending \&"command" with the exit builtin should have the same effect). .LI diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/PROMO.mm b/cde/programs/dtksh/ksh93/src/cmd/ksh93/PROMO.mm index def455224..f69795510 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/PROMO.mm +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/PROMO.mm @@ -14,7 +14,7 @@ performed at shell-level without a significant loss in performance. In addition, "sh" scripts can be run on KSH-93 without modification. .P The code should conform to the IEEE POSIX 1003.1 standard and to the -proposed ANSI-C standard so that it should be portable to all +proposed ANSI C standard so that it should be portable to all such systems. Like the previous version, KSH-88, it is designed to accept eight bit character sets transparently, thereby making it internationally compatible. @@ -95,14 +95,14 @@ way scripts are. Substring Capabilities: KSH-93 allows you to create a substring of any given string either by specifying the starting offset and length, or by stripping off leading -or trailing substrings during parameter substitution. +or trailing substrings during parameter expansion. You can also specify attributes, such as upper and lower case, field width, and justification to shell variables. .LI More pattern matching capabilities: KSH-93 allows you to specify extended regular expressions for file and string matches. .LI -KSH-93 uses a hierarchal name space for variables. +KSH-93 uses a hierarchical name space for variables. Compound variables can be defined and variables can be passed by reference. In addition, each variable can have one or more disciplines associated with @@ -137,5 +137,5 @@ be embedded into an application to allow scripting. Documentation for KSH-93 consists of an "Introduction to KSH-93", "Compatibility with the Bourne Shell" and a manual page and a README file. In addition, the "New KornShell Command and Programming -Language," book is available from Prentice Hall. +Language" book is available from Prentice Hall. diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/README b/cde/programs/dtksh/ksh93/src/cmd/ksh93/README index a6326cb50..949c49611 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/README +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/README @@ -1,5 +1,5 @@ This directory, and its subdirectories contain the source code -for ksh-93; the language described in the second addition of +for ksh-93; the language described in the second edition of the book, "The KornShell Command and Programming Language," by Morris Bolsky and David Korn which is published by Prentice Hall. ksh-93 has been compiled and run on several machines with several @@ -9,96 +9,196 @@ operating systems and machines that ksh-93 has been known to run on. Most of the source code for ksh is in the src/cmd/ksh93/sh directory. For information on what's where, see the file DESIGN. -A new '-o posix' shell option has been added to ksh 93u+m that makes the -ksh language more compatible with other shells by following the POSIX -standard more closely. See the manual page for details. It is enabled by -default if ksh is invoked as sh, otherwise it is disabled by default. +#### COMPILE-TIME OPTIONS #### -The Makefile file contains several compilation options that can be set +The SHOPT.sh file contains several compilation options that can be set before compiling ksh. Options are of the form SHOPT_option and become #define inside the code. These options are set to their recommended value and some of these may disappear as options in future releases. -A value of 0, or no value represents off, 1 represents on. -Note that == is needed, not =, because these are nmake state variables -and changing their value will cause all modules that could be affected -by this change to be recompiled. +A value of 0 represents off, 1 represents on, no value means probe. For +options where no feature probe is available, probe is the same as off. + The options have the following defaults and meanings: + + 2DMATCH on Two-dimensional ${.sh.match} for ${var//pat/str}. + ACCT off Shell accounting. + ACCTFILE off Enable per user accounting info. + AUDIT off For auditing specific users + AUDITFILE "/etc/ksh_audit" - APPEND on Allows var+=val string and array append. - BASH off Bash compatibility mode. It is not fully implemented - and is experimental. - BRACEPAT on C-shell type abc{d,e}f style file generation - CMDLIB_BLTIN off Makes all commands in libcmd.a builtins. The - SH_CMDLIB_DIR nmake state variable can be used to - specify a directory. - CMDLIB_DIR off Sets CMDLIB_BLTIN=1 and provides a default value - of "/opt/ast/bin" for SH_CMDLIB_DIR. - COMPOUND_ARRAY - on Allows all components of compound variables except the - first to be any string by enclosing in [...]. It also - allows components other than the last to be arrays. - This is experimental and only partially complete. + + BGX on Enables background job extensions. Noted by "J" in the + version string when enabled. (1) JOBMAX=n limits the + number of concurrent background jobs to n; the (n+1)th + background job will block until a running background job + completes. (2) SIGCHLD traps are queued so that each + completing background job gets its own trap; $! is set to + the job pid and $? is set to the job exit status at the + beginning of the trap. + + BRACEPAT on Brace expansion. Expands abc{d,e}f to abcdf abcef. + This feature was inspired by the C shell. + + CMDLIB_HDR "" + The header in which you can provide a custom list of + libcmd commands to provide as path-bound built-ins. + + CMDLIB_DIR "\"/opt/ast/bin\"" + The default virtual directory prefix for path-bound + built-ins. The value must include double quotes. + CRNL off treated as in shell grammar. + + DEVFD Use the more secure /dev/fd mechanism instead of FIFOs for + process substitutions. On by default on OSs with /dev/fd. + DYNAMIC on Dynamic loading of builtins. (Requires dlopen() interface.) + ECHOPRINT off Make echo equivalent to print. + + EDPREDICT off Enables history pattern search menu. As you begin a line + with a #, the following characters are treated as a shell + pattern and cause matching lines from the history file to + be displayed as a numbered list as you type. You can + scroll up and down this list or you can use nTAB to + make this the current line (n defaults to 1 if omitted). + Experimental. Bugs: https://github.com/ksh93/ksh/issues/233 + ESH on Compile with emacs command line editing. The original emacs line editor code was provided by Mike Veach at IH. + FILESCAN on Experimental option that allows fast reading of files using while < file;do ...; done and allowing fields in each line to be accessed as positional parameters. - KIA off Allow generation of shell cross reference database with -I. + + FIXEDARRAY on When using typeset, a name in the format NAME[N] + creates a fixed-size array and any attempt to access a + subscript N or higher is an error. Multidimensional + fixed-size arrays NAME[N1][N2]... are also supported. + + GLOBCASEDET Adds the 'globcasedetect' shell option. When this shell + option is turned on, pathname expansion (globbing) + and file name listing and completion automatically become + case-insensitive on file systems where the difference + between upper- and lowercase is ignored for file names. + This compile-time option is enabled by default on operating + systems that can support case-insensitive file systems. + + HISTEXPAND on Enable !-style history expansion similar to csh(1). + + KIA off Allow generation of shell cross-reference database with -R. + As of 2021-05-10, no tool that can parse this database is + known. If you know of any, please contact us. + MULTIBYTE on Multibyte character handling. Requires mblen() and mbctowc(). - NAMESPACE on Allows namespaces. This is experimental, incomplete - and undocumented. + + NAMESPACE on Adds a 'namespace' reserved word that allows defining name + spaces. Variables and functions defined within a block like + namespace ExampleSpace { commandlist; } + all have their names automatically prefixed with + '.ExampleSpace.' when defining or using them, creating a + separate space of names unique to the block. Outside of + the namespace block, they can be accessed using + .ExampleSpace.function or ${.ExampleSpace.variable}. + Name spaces within name spaces are also supported. + + MKSERVICE off Enables the 'mkservice' builtin which creates a TCP or UDP + server that is implemented by shell functions, and the + 'eloop' builtin which causes the shell to block waiting for + events to process. Experimental and probably insecure. + + NOECHOE off Disable the '-e' option to the 'echo' command, + unless SHOPT_ECHOPRINT is enabled. + OLDTERMIO off Use either termios or termio at runtime. - OO on Experimental object oriented extension. This option - should disappear soon. + OPTIMIZE on Optimize loop invariants for with for and while loops. + + PFSH off Compile with support for profile shell. (Solaris; obsolete) + P_SUID off If set, all real uids, greater than or equal to this value will require the -p flag to run suid/sgid scripts. - PFSH off Compile with support for profile shell. - RAWONLY off Turn on if the vi line mode doesn't work right unless + + RAWONLY on Turn on if the vi line mode doesn't work right unless you do a set -o viraw. - SEVENBIT off Strip the eighth bit from characters. - SPAWN off Use spawn as combined fork/exec. May improve speed on - some systems. + + REGRESS off Enable the __regress__ built-in command and instrumented + intercepts for testing. + + REMOTE off Set --rc (read profile scripts) even if ksh was invoked + with standard input on a socket, i.e. as a remote shell. + + SPAWN on Use posix_spawn(3) as combined fork/exec if job control + is not active. Improves speed. + STATS on Add .sh.stats compound variable. + SUID_EXEC on Execute /etc/suid_exec for setuid, setgid script. + + SYSRC Source /etc/ksh.kshrc on initializing an interactive + shell. This is on by default if /etc/ksh.kshrc or + /etc/bash.bashrc exists at compile time. + + TEST_L Add 'test -l' as an alias for 'test -L'. This is on by + default if the OS's external 'test' command supports it. + TIMEOUT off Set this to the number of seconds for timing out and exiting the shell when you don't enter a command. If non-zero, TMOUT can not be set larger than this value. + TYPEDEF on Enable typeset type definitions. + VSH on Compile with vi command line editing. The original vi line editor code was provided by Pat Sullivan at CB. -The following compile options are set automatically by the feature testing: - DEVFD Set when /dev/fd is a directory that names open files. - SHELLMAGIC - Set on systems that recognize script beginning with #! specially. +#### BUILDING KSH 93U+M #### +To build ksh (as well as libcmd and libast libraries on which ksh depends), +cd to the top directory and run: -In most instances, you will generate ksh from a higher level directory -which also generates libcmd and libast libraries on which ksh depends. -However, it is possible to generate ksh, with by running make -f ksh.mk -in this directory. The ksh.mk file was generated from the nmake Makefile. -If you do not have make or nmake, but do have a Version 7 UNIX compatible -shell, then you can run the script mamexec < Mamfile to build ksh. -If you have nmake, version 2.3 or later, you can use it without the -f ksh.mk. -In either case, ksh relies on libraries libast and libcmd which must be -built first. The binary for ksh becomes the file named ./ksh which can -be copied to where ever you install it. + bin/package make -If you use old make or the Mamfile, and you system has dynamic shared -libraries, then you should define the variables mam_cc_static and -mam_cc_dynanamic as the compiler options that request static linking -and dynamic linking respectively. This will decrease the number of -shared libraries that ksh need and cut startup time substantially. +The compiled binaries are stored in the arch directory, in a subdirectory +that corresponds to your architecture. The command 'bin/package host type' +outputs the name of this subdirectory. -The makefile should also generate shcomp, a program that will precompile +If you have trouble or want to tune the binaries, you may pass additional +compiler and linker flags. It is usually best to export these as environment +variables before running bin/package as they could change the name of the +build subdirectory of the arch directory, so exporting them is a convenient +way to keep them consistent between build and test commands. Note that this +system uses CCFLAGS instead of the usual CFLAGS. An example that makes +Solaris Studio cc produce a 64-bit binary: + + export CCFLAGS="-m64 -O" LDFLAGS="-m64" + bin/package make + +Alternatively you can append these to the command, and they will only be +used for that command. You can also specify an alternative shell in which to +run the build scripts this way. For example: + + bin/package make SHELL=/bin/bash CCFLAGS="-O2 -I/opt/local/include" \ + LDFLAGS="-L/opt/local/lib" + +For more information, run: + + bin/package help + +Many other commands in this repo self-document via the --help, --man and +--html options; those that do have no separate manual page. + +Automated installation is not supported yet. To install manually: + + cp arch/$(bin/package host type)/bin/ksh /usr/local/bin/ + cp src/cmd/ksh93/sh.1 /usr/local/share/man/man1/ksh.1 + +(adapting the destination directories as required). + +The build should also generate shcomp, a program that will precompile a script. ksh93 is able to recognize files in this format and process them as scripts. You can use shcomp to send out scripts when you don't want to give away the original script source. @@ -113,16 +213,19 @@ and want to be able to run setuid/setgid and execute only scripts, then you will have to change the source code file sh/suid_exec.c explicitly. If you do not have ksh in one of these secure locations, /bin/sh will be invoked with the -p options and will fail when you execute a setuid/setgid -and/or execute only script. Note, that ksh does not read the .profile -or $ENV file when it the real and effective user/group id's are not -equal. +and/or execute only script. Note that ksh does not read the .profile +or $ENV file when the real and effective user/group IDs are not equal. -The tests sub-directory contains a number of regression tests for ksh. +#### TESTING KSH #### + +The tests subdirectory contains a number of regression tests for ksh. To run all these tests with the shell you just built, run the command bin/shtests For help and more options, type bin/shtests --man +#### OTHER DOCUMENTATION #### + The file PROMO.mm is an advertisement that extolls the virtues of ksh. The file sh.1 contains the troff (man) description of this Shell. The file nval.3 contains the troff (man) description of the name-value @@ -130,42 +233,20 @@ pair library that is needed for writing built-ins that need to access shell variables. The file sh.memo contains a draft troff (mm) memo describing ksh. The -file RELEASE88 contains the changes made for ksh88. The file RELEASE93 -contains the changes made in this release since ksh-88. The file -RELEASE contains bug fixes made in this release since ksh-88. The file -COMPATIBILITY contains a list of incompatibilities with ksh-88. The -file bltins.mm is a draft troff (mm) memo describing how to write +file builtins.mm is a draft troff (mm) memo describing how to write built-in commands that can be loaded at run time. -Most of the work for internationalization has been done with ksh93. -The file ksh.msg is a generated file that contains error messages -that need to be translated. In addition, the function translate() -in sh/init.c has to be completed to interface with the dictionary -lookup. The translate function takes two argument, the string -that is to be translated and a type which is - 0 when a library string needs translation. - 1 when one of the error messages in ksh.msg needs translation. - 2 when a string in a script needs translation. You use a $ in front - of a double quoted string in a script to indicate that it - needs translation. The -D option for ksh builds the dictionary. -The translate routine needs to return the translated message. -For dictionaries that need to use a numeric key, it should be -possible to use the strhash() function to generate numbers to -go along with each of the messages and to use this number both -when generating the dictionary and when converting strings. -If you encounter error messages of type 1 that are not be translated via -this translate() function send mail to the address below. +The file NEWS in the top-level directory contains bug fixes and other +changes made in the ksh 93u+m fork and supporting libraries. The file +COMPATIBILITY contains a list of potential incompatibilities. -Please report any problems or suggestions to: +#### TESTED SYSTEMS #### -https://github.com/ksh93/ksh - - -ksh 93u+m 1.0.0 has been compiled and alpha tested on the following. +ksh 93u+m 1.0.0.beta-1 has been compiled and tested on the following. An asterisk signifies minor regression test failures (one or two minor things amiss), two asterisks signify moderate regression test failures (some functionality does not work), and three asterisks signify serious -failures (crashes, and/or essential functionality does not work). +failures (crashes, and/or important functionality does not work). * AIX 7.1 on RISC (PowerPC) * DragonFly BSD 5.8 on x86_64 @@ -178,15 +259,30 @@ failures (crashes, and/or essential functionality does not work). GNU/Linux: NixOS 19.09 on x86_64 GNU/Linux: Slackware 14.2 on x86_64 GNU/Linux: Ubuntu 16.04 on x86_64 + GNU/Linux: Ubuntu 18.04 on armv7l (32-bit) + GNU/Linux: Ubuntu 20.04 on arm64 + GNU/Linux: Void Linux (musl C library) on x86_64 *** HP-UX B.11.11 on pa-risc * illumos: OmniOS 2020-08-19 (gcc) on x86_64 + macOS 10.13.6 (High Sierra) on x86_64 macOS 10.14.6 (Mojave) on x86_64 -*** NetBSD 8.1 and 9.0 on x86_64 +* macOS 12.0.1 (Monterey) on arm64 +* NetBSD 8.1 on x86_64 +* NetBSD 9.2 on x86_64 * OpenBSD 6.8 on x86_64 +** QNX 6.5.0 on i386 * Solaris 11.4 (gcc) on x86_64 Solaris 11.4 (Solaris Studio 12.5 cc) on x86_64 * UnixWare 7.1.4 on x86 *** Windows 7 using Cygwin on x86 +*** Windows 10 using Cygwin on x86_64 +*** Windows 11 using Cygwin on x86_64 + +#### REPORTING BUGS #### + +Please report any problems or suggestions by opening an issue at: +https://github.com/ksh93/ksh +Alternatively, email martijn@inlv.org (timely response *not* promised). Good luck!! @@ -196,4 +292,3 @@ https://github.com/ksh93/ksh Originally written by: David Korn dgk@research.att.com - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE index 8b06db054..a5aa4944c 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE @@ -1,3 +1,7 @@ +This file is of historic interest. For recent changes in both ksh 93u+m and +the accompanying libraries, see the file NEWS in the top-level directory. +____ + 12-08-01 --- Release ksh93u+ --- 12-08-01 A bug that ignored interrupts for some builtins (e.g. cmdtst::grep) that read from stdin has been fixed. @@ -21,9 +25,9 @@ 12-07-02 A bug in which builtin name did now work for builtins found in a library added by builtin -f lib has been fixed. 12-07-02 A bug in the edit modes which after a directory did not refresh - the input line has been fixed. + the input line has been fixed. 12-07-02 A bug in which an exit status > 256 corresponding to a signal was - not returned by a function to indicate a signal exit has been fixed. + not returned by a function to indicate a signal exit has been fixed. 12-06-28 Fix ulimit -a to list (Kibytes) instead of (kbytes). 12-06-27 Fix uninitialized data reference for as first char in --vi mode. 12-06-26 The formatting of printf "%q" for multibyte locales has changed to @@ -56,9 +60,9 @@ could core dump has been fixed. 12-06-06 A bug in which unset of an associative array of compound variables did not completely unset the variable has been fixed. -12-06-06 A bug in which exporting left or right justified fields could loose +12-06-06 A bug in which exporting left or right justified fields could lose the field width has been fixed. -12-06-06 A bug on Solaris11 in which >; did not work for /dev/null was fixed. +12-06-06 A bug on Solaris 11 in which >; did not work for /dev/null was fixed. 12-06-05 A race condition which occurred when stopping a builtin command invoked from a subshell has been fixed. 12-06-05 A bug with appending elements to an empty indexed array has been @@ -69,7 +73,7 @@ directory if they are killed or stopped. 12-06-04 A bug in handling \\ in read has been fixed. 12-05-31 Use getrlimit64/setrlimit64 on systems that support it. -12-05-31 Fix 64 bit big-endian arithmetic bug that mishandled nan and inf. +12-05-31 Fix 64 bit big-endian arithmetic bug that mishandled NaN and Inf. 12-05-31 Handle ECONNRESET like EPIPE. 12-05-31 Change .paths parse to use only the last BUILTIN_LIB from the top and treat BUILTIN_LIB value as a ':' separated list of lib names. @@ -78,7 +82,7 @@ the compile test. 12-05-25 A command substitution containing a here-document that itself contains a here-document no longer hangs. -12-05-24 When the redirection operatory >; is directed to a symlink, it now +12-05-24 When the redirection operator >; is directed to a symlink, it now overwrites the file named by the link rather than the link. 12-05-21 +Added printf formats %(type)q where type can be html, url, pattern, ere, or csv. @@ -99,7 +103,7 @@ 12-05-15 Fixed a .paths bug in which only the first BUILTIN_LIB assignment worked. 12-05-14 Arithmetic expressions and subexpressions that are not floating point now treat -0 as 0, so that $((-0)) is 0 and $((-0.0)) is -0. -12-05-11 'unset .sh' now fails with readonly message instead of coredump. +12-05-11 'unset .sh' now fails with a readonly message instead of a coredump. 12-05-11 A bug which left an associative array arr containing one element in the wrong state after expanding with ${arr[@]} has been fixed. 12-05-10 A bug in which typeset -f did not display options that called getopts @@ -137,7 +141,7 @@ string when i was a valid subscript and j was <=0 rather than generating nothing has been fixed. 12-04-17 A bug in which read -d delim from a terminal did not respond to - interrupt and did not termrinate when the delimiter was entered + interrupt and did not terminate when the delimiter was entered has been fixed. 12-04-17 A bug in which a directory in PATH containing a .paths file that contains a line with FPATH=dir, where dir does not exist could @@ -153,7 +157,7 @@ are associated with the directory in PATH containing the .paths file. 12-04-09 Increased I/O buffer sizes for better performance. 12-04-09 A bug in which the leading 0 was stripped from $x, when $x contained - a heximadecimal constant inside an arithmetic expression inside + a hexadecimal constant inside an arithmetic expression inside a for or while loop. 12-04-06 Modified namespaces to hand variables FPATH, PATH, and OPTIND that are defined in name spaces appropriately. This also fixed OPTIND @@ -163,9 +167,9 @@ 12-04-02 Made some namespace changes and added a regression test. 12-03-30 A bug with namespaces in which PATH and FPATH set in a namespace was not restored when leaving the namespace has been fixed. -12-03-29 A bug in which appending an index array onto an array without elements +12-03-29 A bug in which appending an indexed array onto an array without elements caused the first element to be 1 rather than 0 has been fixed. -12-03-29 A bug which could cause a core dump when copying a large index array +12-03-29 A bug which could cause a core dump when copying a large indexed array has been fixed. 12-03-28 The shell now generates an error message when the sizes with L, Z, and R are > 32767 on 32 bit binaries instead of generating a core dump. @@ -185,7 +189,7 @@ ref is a name reference to arr[i] has been fixed. 12-03-21 A bug in which assigning a compound variable into arr[i], where arr[i] is an array variable did not work correctly has been fixed. -12-03-21 A bug with multi-dimenstional index arrays in which ${arr[i][j]} +12-03-21 A bug with multidimensional indexed arrays in which ${arr[i][j]} could generate a bogus error message when i was > 9 has been fixed. 12-03-21 A bug in which typeset v=foo, typeset -p v[0] generated a core dump has been fixed. @@ -207,7 +211,7 @@ error since a is not an assignment command. 12-03-16 A bug in which an unset discipline from a variable defined in a subshell is not invoked in the subshell has been fixed. -12-03-08 The assignment typeset -a (x=1 y=2) now creates an index array +12-03-08 The assignment typeset -a (x=1 y=2) now creates an indexed array of two elements rather than an array of one element which is a compound variable. 12-03-02 +The vi and emacs edit modes now list all the entries in a directory @@ -221,7 +225,7 @@ 12-02-29 --- Release ksh93u+ --- 12-02-29 A bug in which ~user expanded first in a subshell prevented it from expanding later in a program has been fixed. -12-02-29 A bug which could lead to a core dump when more that four shared +12-02-29 A bug which could lead to a core dump when more than four shared libraries were added with the builtin command has been fixed. 12-02-29 Fixed a few bugs which caused SIGCHLD to be blocked preventing background jobs from being reaped until a foreground job was run. @@ -243,7 +247,7 @@ that caused a core dump has been fixed. 12-02-08 A bug in which .sh.fun disciplines could be cleared after a function completes has been fixed. -12-02-08 A bug in job control in which the foregroup process group was not +12-02-08 A bug in job control in which the foreground process group was not set correctly after restarting a stopped pipeline has been fixed. 12-02-07 A bug in which numbers with leading zeros could be treated as octal constants outside of ((...)) has been fixed. @@ -251,17 +255,17 @@ array elements has been fixed. 12-02-02 A bug in the ulimit option table was fixed. 12-01-26 A bug in which a set command that did not change monitor could - effect the behavior of the monitor when monitor mode is on is fixed. + affect the behavior of the monitor when monitor mode is on is fixed. 12-01-21 +You can now test whether the shell implements a math function using typeset -f .sh.math.name, where name is the name of the function. 12-01-21 A bug in which typeset -L and typeset -R did not handle multibyte characters correctly has been fixed. 12-01-20 A bug that could cause the shell to hang waiting for an incorrect job pid has been fixed. -12-01-19 A memory leak which occurred for a nested command subtiution has been +12-01-19 A memory leak which occurred for a nested command substitution has been fixed. 12-01-17 A bug in which typeset -u PS1 could enable the uppercase attribute - for some other variables, for exampe, HISTFILE has been fixed. + for some other variables, for example, HISTFILE has been fixed. 12-01-16 A bug in which .sh.match was not correct after a substring match when the replacement string contained a substring match has been fixed. 12-01-12 +Files that are sourced from profile files are now read and executed @@ -287,7 +291,7 @@ been fixed. 11-12-07 I fixed a bug in which a variable expansion in a large here-document could be expanded to a null string. -11-12-06 An optimization to read was added in the case the the read command +11-12-06 An optimization to read was added in the case the read command was redirected from a file. 11-12-06 Changes were made to make the line limit for read unlimited by default. @@ -297,7 +301,7 @@ quote argument in a form suitable for a field in a .csv format file. 11-12-02 +A -S option was added to read to be able to read .csv format files. 11-11-28 A bug in which redirection of standard error in a function called from - command substitution caused standard error to be lost has ben fixed. + command substitution caused standard error to be lost has been fixed. 11-11-21 [[ (-n foo) ]] no longer requires a space before (. 11-11-11 The readonly attribute for a variable now applies to compound assignments to that variable. @@ -305,7 +309,7 @@ recursion. 11-10-10 +Added alternate flag to printf %H for encoding of URI's. 11-10-10 A bug which could lead to a core dump when the shell was invoked - with more than twenty five open files has been fixed. + with more than twenty-five open files has been fixed. 11-10-06 A bug in the scoping of name references in functions called by other functions has been fixed. 11-10-05 A bug in which wait on a pid may return the exit status of an @@ -317,7 +321,7 @@ 11-09-21 Added letoctal option that enables the let command to recognize octal constants starting with 0. 11-09-20 A bug in which ${var.} could cause a core dump has been fixed. -11-09-20 A bug with SHOPT_EDPREDICT when neither vi or emacs was enabled for +11-09-20 A bug with SHOPT_EDPREDICT when neither vi nor emacs was enabled for lines beginning with # when in a multibyte locale has been fixed. 11-09-20 A bug in emacs edit mode with SHOPT_EDPREDICT that would cause history searches matching comments lines to generate predictions @@ -353,9 +357,9 @@ jobs to complete has been fixed. 11-06-09 A bug which caused the options.sh regression test to fail on OS390 Linux has been fixed. The bug could also have affected other systems. -11-06-07 +A number of changes to support the still undocuments namespace option +11-06-07 +A number of changes to support the still undocumented namespace option have been added. -11-06-06 A bug in which command substitution of eval would hang when it had +11-06-06 A bug in which command substitution of eval would hang when it had standard error redirected to standard output has been fixed. 11-06-01 A bug in case statement fall through (;&) ignoring set -e was fixed. 11-06-01 A bug in which creating a left or right justified upper or lowercase @@ -373,7 +377,7 @@ variable core dumps has been fixed. 11-05-28 Two bugs in the display of arrays of compound variables with print -v have been fixed. -11-05-27 A bug with command substitution with the shift jis locale has been +11-05-27 A bug with command substitution in the Shift JIS locale has been fixed. 11-05-25 A bug in which unset -f foo, called within function foo could cause the shell to core dump has been fixed. @@ -402,7 +406,7 @@ an a core dump for not fixed arrays. 11-04-25 A bug in the references to two dimensional compound arrays has been fixed. -11-04-20 A bug in which a name reference to a multidimentional index array +11-04-20 A bug in which a name reference to a multidimensional indexed array index, nameref x=foo[3][4], did not work correctly has been fixed. 11-04-18 Changes were added to allow fixed size arrays of variable sized objects when the SHOPT_FIXEDARRAY compile option defined on 10-09-28. @@ -414,7 +418,7 @@ the match instance. 11-04-11 A bug in which readonly var, where var is exported could cause var to be unset has been fixed. -11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause in infinite +11-04-06 A tokenizer bug in which ${x/{3}(\d)/ } would cause an infinite loop has been fixed. 11-04-05 A bug in which ${!x.} could cause a core dump has been fixed. 11-04-04 A bug in which cleaning out the history file could terminate before @@ -436,7 +440,7 @@ 11-03-07 A bug in which reassigning a compound variable to an associative array index could incorrectly increase the count of the number of elements has been fixed. -11-03-04 +The tilde expansion on windows has been modified to handle user +11-03-04 +The tilde expansion on Windows has been modified to handle user names of the form domain/user so that ~domain/user now expands to the home directory of that domain user. 11-03-03 A bug in which the width of the prompt was calculated incorrectly @@ -493,7 +497,7 @@ signal. This prevents a core dump to be overwritten by the shell. 10-12-22 A bug in the expansion of ${A[@]} ${B[@]}, introduced in 10-12-01 when A="" B=B has been fixed. -10-12-21 +Use MS_3D in b_vpath() for setting win32 WoW mount defaults. +10-12-21 +Use MS_3D in b_vpath() for setting Win32 WoW mount defaults. 10-12-17 A bug in the expansion of ${var:i:j} which caused a core dump when i > ${#var} has been fixed. 10-12-16 +sleep now treats . as decimal point even in locales that use comma. @@ -517,12 +521,12 @@ variables. 10-11-29 An incorrect warning message was eliminated with the -n option for arithmetic expressions with associative arrays. -10-11-29 Some changes were made to slightly reduces startup time. +10-11-29 Some changes were made to slightly reduce startup time. 10-11-24 A bug in which a name reference is make to arr[0] when arr is not an array has been fixed. 10-11-23 If a type definition is made without a compound variable assignment it produces an error message and no longer shows up as a defined type. -10-11-22 The handling of \ inside [...] for for shell and ~(E) patterns has +10-11-22 The handling of \ inside [...] for shell and ~(E) patterns has been fixed. 10-11-22 A patch was made to pfsh to handle an error case. 10-11-22 +Modified types defined in namespace so that they do not clash with @@ -538,7 +542,7 @@ 10-11-18 Fixed a bug in which typeset -T foo; typeset -T could cause a core dump. 10-11-17 Fixed a bug in which the error message for set -u could come out - garbelled. + garbled. 10-11-17 Modified the parser so that typeset -a var=(...) no longer checks the first index for aliases and reserved words. 10-11-17 A bug in which a subshell command consisted of only a for or until @@ -616,10 +620,10 @@ 10-09-29 A bug in which loading a function from FPATH could leave a file descriptor open has been fixed. 10-09-28 +A new compile option SHOPT_FIXEDARRAY has been added and is being - evaluation. It allows fixed sized indexed arrays be to defined - using "typeset array[dim1][dim2]...[dimn]". Fixed sized arrays + evaluated. It allows fixed-size indexed arrays be to defined + using "typeset array[dim1][dim2]...[dimn]". Fixed-size arrays are used the same way indexed arrays are. Currently, only fixed - arrays of fixed objects (float, int, and justifies objects) are + arrays of fixed objects (float, int, and justified objects) are supported. 10-09-22 A bug which could cause an exception when a function with static variables was redefined has been fixed. @@ -641,7 +645,7 @@ has been fixed. 10-09-08 A bug in the processing of references to multidimensional arrays in arithmetic expressions has been fixed. -10-09-08 A bug in the handling of multi-dimensional arrays which caused +10-09-08 A bug in the handling of multidimensional arrays which caused the number of elements in each dimension to be incorrect has been fixed. 10-09-07 The change for messages on 10-08-09 did not handle message in @@ -711,12 +715,12 @@ was invoked on a two dimensional array, i.e., arr[5][9].discipline. 10-07-19 Fixed a buffering problem which occurred when running a script with ssh and the parent ssh process is killed. -10-07-14 Modified the parser to treat ((...)) inside [[...]] as ( (...) ) to +10-07-14 Modified the parser to treat ((...)) inside [[ ... ]] as ( (...) ) so that it is a nested (...). 10-07-09 A bug in the handling of process substitution inside command substitution as part of a pipeline has been fixed. 10-07-07 A bug in the output for compound variables containing - multi-dimensional arrays has been fixed. + multidimensional arrays has been fixed. 10-07-06 ksh now recovers from changes made by bash to the history file without losing history commands. 10-06-25 A bug in which a large here document containing command substitutions @@ -733,7 +737,7 @@ the variable had an attribute but did not have a value. 10-06-18 Modified trap handling so that if the same signal is received when executing the handler, it is deferred until the handler completes. -10-06-16 Fixed a bug in which ulimit -v was setting the the cpu limit +10-06-16 Fixed a bug in which ulimit -v was setting the CPU limit on Linux. 10-06-14 +The command 'typeset -T' now generates the list of type definitions in a format that can be used as input to the shell. @@ -789,7 +793,7 @@ 10-05-19 <<< with an empty string no longer gives an error. 10-05-19 A bug in arithmetic evaluation when a name reference to an array instance was used has been fixed. -10-05-14 A bug in which the shell treats a valid index array assignment, +10-05-14 A bug in which the shell treats a valid indexed array assignment, typeset -a x=(foo (x=3;y=4) bar) as a syntax error has been fixed. 10-05-13 A bug in creating name references to associative array variable after a lookup of one of its elements has been fixed. @@ -927,7 +931,7 @@ with radix char , and thousands separator . has been fixed. 09-12-28 A bug in the handling of SIGCLD on systems that generated SIGCLD while blocked waiting for process to complete has been fixed. -09-12-24 ast setlocale() reworked to differentiate env var changes from user +09-12-24 AST setlocale() reworked to differentiate env var changes from user override. 09-12-18 A bug with the SHOPT_BGX option set which disabled traps for signals < SIGCHLD when a trap for a signal > SIGCHLD was set has been fixed. @@ -982,7 +986,7 @@ in command completion has been fixed. 09-10-09 $PATH processing has been changed to delay dir stat() and .paths lookup until the directory is needed in the path search. -09-09-28 Call the ast setlocale() intercept on unset too. +09-09-28 Call the AST setlocale() intercept on unset too. 09-09-24 A bug in which LANG=foo; LC_ALL=foo; unset LC_ALL; did not revert LC_CTYPE etc. to the LANG value has been fixed. 09-09-17 A bug in which unsetting SVLVL could cause a script invoked by @@ -996,7 +1000,7 @@ 09-09-09 A bug in which a subshell containing a background process could block until the background process completed has been fixed. 09-09-04 A bug in handling ${var[sub]}, where var is a nameref has been fixed. -09-09-03 A bug which caused an index array to have the wrong number of elements +09-09-03 A bug which caused an indexed array to have the wrong number of elements when it was converted from a compound variable by adding an another element has been fixed. 09-09-03 Specifying export for a compound variable now generates an error. @@ -1045,7 +1049,7 @@ 09-06-19 Two bugs related to read -b for array variables has been fixed. 09-06-19 A bug with typeset for compound variables containing arrays of compound variables has been fixed. -09-06-18 A bug in appending a compound variable to a an indexed array of +09-06-18 A bug in appending a compound variable to an indexed array of compound variables has been fixed. 09-06-18 A bug which occurs when appending a compound variable to an indexed array element has been fixed. @@ -1088,7 +1092,7 @@ 09-04-07 The emacs edit command M-_ and M_. and the vi command _ was fixed to handle the case there there is no history file. 09-04-05 A bug in handling new-lines with read -n has been fixed. -09-04-05 The ENV variable defaults the the file named by $HOME/.kshrc rather +09-04-05 The ENV variable defaults to the file named by $HOME/.kshrc rather then to the string $HOME/.kshrc. 09-03-31 A bug in which a nested command substitution with redirections could leave a file descriptor open has been fixed. @@ -1142,9 +1146,9 @@ has been fixed. 09-01-19 A bug in which sending SIGWINCH to a process that reads from a pipe could cause a memory fault has been fixed. -09-01-16 +The -R unary operator was added to [[...]] and test to check whether - a variable is a name reference. -09-01-16 +The -v unary operator was added to [[...]] and test to check whether +09-01-16 +The -R unary operator was added to [[ ... ]] and test to check whether + a variable is a name reference. +09-01-16 +The -v unary operator was added to [[ ... ]] and test to check whether a variable is set. 09-01-14 The unset built-in was modified to return 0 exit status when unsetting a variable that was unset to conform with the POSIX @@ -1182,7 +1186,7 @@ instead of quoting the argument in single quotes. 08-12-07 A bug in typeset -m which occurred when the target node was an associative array element has been fixed. -08-12-07 A timing bug on some systems (for example darwin), that could +08-12-07 A timing bug on some systems (for example Darwin), that could cause the last process of a pipeline entered interactively to fail with an "Exec format error" has been fixed. 08-12-04 +SHOPT_BGX enables background job extensions. Noted by "J" in @@ -1261,7 +1265,7 @@ cases where the command caused the shell to fork has been fixed. 08-09-19 type, whence -v, and command -v were fixed to comply with POSIX by writing 'not found' diagnostics to the standard error. -08-09-18 test and [...] were fixed to comply with POSIX in the case +08-09-18 test and [ ... ] were fixed to comply with POSIX in the case of test '(' binop ')' where binop is a valid binary test operator. 08-09-16 +If a method discipline named create is specified when defining a type, this function will be called when an instance is created. @@ -1270,7 +1274,7 @@ 08-09-10 The shell now prints an error message when the type name specified for an indexed array subscript is not an enumeration type. 08-09-10 A bug in which a subshell that spawned a background process could - loose output that was produced after the foreground completed + lose output that was produced after the foreground completed has been fixed. 08-09-10 A timing bug on some systems that could cause coprocesses started by a subshell to not clean up and prevent other coprocesses has been fixed. @@ -1335,8 +1339,8 @@ jobs completed has been fixed. 08-06-23 _KSH_VERSION added as a name reference to .sh.version. 08-06-20 type now outputs 'special builtin' for special builtins. -08-06-19 A couple of bugs in multi-dimensional arrays have been fixed. -08-06-19 A bug in which a syntax error in a dot script could generated +08-06-19 A couple of bugs in multidimensional arrays have been fixed. +08-06-19 A bug in which a syntax error in a dot script could generate a syntax error in the next subsequent command has been fixed. 08-06-17 Reduced the maximum function call depth to 2048 to avoid exceptions on some architectures. @@ -1344,7 +1348,7 @@ specified variable was not set has been fixed. 08-06-16 +When typeset -p is followed by variable names, it now displays the attributes names and values for the specific names. -08-06-14 A bug that could effect the drawing of the screen from multiline +08-06-14 A bug that could affect the drawing of the screen from multiline emacs or gmacs mode when walking up the history file has been fixed. 08-06-13 A bug in which a compound variable defined in a subshell could have side effects into the parent shell has been fixed. @@ -1468,7 +1472,7 @@ 08-03-04 A bug in multiline mode in emacs and vi mode which could cause the cursor to be on the wrong line when interrupt was hit has been fixed. 08-03-03 The change made in ksh93s+ on 07-06-18 in which braces became - optional for ${a[i]} inside [[...]] was restored in the case + optional for ${a[i]} inside [[ ... ]] was restored in the case where the argument can be a pattern. 08-03-03 A bug in which creating a name reference to an associative array instance would fail when the subscript contained characters [ or @@ -1477,7 +1481,7 @@ files, generates the output in a temporary file and writes the specified file only of the command has completed successfully. 08-02-15 A bug in ${var/pattern/string} for patterns of the form ?(*) and +(*) - has bee fixed. + has been fixed. 08-02-07 A bug in which test \( ! -e \) produced an error has been fixed. 08-02-14 +The typeset -a option can now optionally be followed by the name of an enumeration type which allows subscripts to be enumerations. @@ -1496,7 +1500,7 @@ 07-10-03 A bug in which : was not allowed as part of an alias name has been fixed. 07-09-26 A bug in which appending a compound variable to a compound variable - or to an index array didn't work has been fixed. + or to an indexed array didn't work has been fixed. 07-09-19 In both emacs and vi edit mode, the escape sequence \E[A (usually cursor up, when the cursor is at the end of the line will fetch the most recent line starting with the current line. @@ -1525,7 +1529,7 @@ 08-04-11 A bug which caused $(exec > /dev/null) to go into an infinite loop has been fixed. 08-03-27 A bug in which typeset -LZ was being treated as -RZ has been fixed. -08-03-06 A bug with ksh -P on systems that support the the profile shell, +08-03-06 A bug with ksh -P on systems that support the profile shell, in which it would exit after running a non-builtin has been fixed. 08-01-31 A bug in which command substitution inside ((...)) could cause syntax errors or lead to core dumps has been fixed. @@ -1543,7 +1547,7 @@ returned by a process that catches the SIGCONT signal is stopped and then continued. 07-12-13 A race condition in which a program that has been stopped and then - continued could loose the exit status has been fixed. + continued could lose its exit status has been fixed. 07-12-12 Code to check for file system out of space write errors for all writes has been added. 07-12-11 A bug in the macro expander for multibyte characters in which @@ -1568,19 +1572,19 @@ 07-11-15 A bug in which "hash -- name" treated "--" as an invalid name operand has been fixed. 07-11-15 typeset now handles "-t -- [-r] [--]" for s5r4 hash(1) compatibility. -07-11-15 A bug in which the umask builtin mis-handled symbolic mode operands +07-11-15 A bug in which the umask builtin mishandled symbolic mode operands has been fixed. -07-11-15 Bugs in which shell arithmetic and the printf builtin mis-handled the +07-11-15 Bugs in which shell arithmetic and the printf builtin mishandled the signs of { -NaN -Inf -0.0 } have been fixed. 07-11-15 +The full { SIGRTMIN SIGRTMIN+1 ... SIGRTMAX-1 SIGRTMAX } range of signals, determined at runtime, are now supported. -07-11-15 A bug in which creating an index array with only subscript 0 created +07-11-15 A bug in which creating an indexed array with only subscript 0 created only a simple variable has been fixed. 07-11-14 A bug in which appending to an indexed array using the form name+=([sub]=value) could cause the array to become an associative array has been fixed. 07-11-14 A bug in which typeset without arguments could coredump if a - variable is declared as in indexed array and has no elements has + variable is declared as an indexed array and has no elements has been fixed. 07-11-14 A bug in which creating a local SECONDS variable with typeset in a function could corrupt memory has been fixed. @@ -1598,7 +1602,7 @@ 07-09-20 A bug in which a nameref to a compound variable that was local to the calling function would not expand correctly when displaying is value has been fixed. -07-09-19 A bug which cause cause a core dump if .sh.edchar returned +07-09-19 A bug which could cause a core dump if .sh.edchar returned 80 characters or more from a keyboard trap has been fixed. 07-09-14 A bug in which could cause a core dump when more than 8 file descriptors were in use has been fixed. @@ -1618,7 +1622,7 @@ has been fixed. 07-08-08 A bug in which a trap ignored in a subshell caused it to be ignored by the parent has been fixed. -07-08-07 A bug in which the set command would generated erroneous output +07-08-07 A bug in which the set command would generate erroneous output for a variable with the -RZ attribute if the variable name had been passed to a function has been fixed. 07-08-02 A bug in which read x[1] could core dump has been fixed. @@ -1636,13 +1640,13 @@ 07-06-25 A bug in the expansion of ${var/pattern/rep} when pattern or rep contained a left parenthesis in single quotes has been fixed. 07-06-18 The braces for a subscripted variable with ${var[sub]} are now - optional when inside [[...]], ((...)) or as a subscript. + optional when inside [[ ... ]], ((...)) or as a subscript. 07-05-28 A bug in brace expansion in which single and double quotes did not treat the comma as a literal character has been fixed. 07-05-24 The -p option of whence now disables -v. 07-05-23 Several bug fixes in compound variables and arrays of arrays have been made. -07-05-15 A bug in which the %B format of printf was affected by the +07-05-15 A bug in which the %B format of printf was affected by the locale has been fixed. 07-05-14 A bug in which \ was not removed in the replacement pattern with ${var/pattern/rep} when it was not followed by \ or a digit has @@ -1693,7 +1697,7 @@ 06-11-20 A bug in which "${foo[@]:1}}" expands a null argument (instead of no argument), when foo[0] is not empty has been fixed. 06-11-16 The discipline functions have been modified to allow each subscript - to act independently. Currently the discipline function will not + to act independently. Currently, the discipline function will not be called when called from a discipline function of the same variable. 06-11-14 A bug which could cause a core dump if a file descriptor for an internal file was closed from with a subshell has been fixed. @@ -1788,7 +1792,7 @@ 06-05-19 +Modified arithmetic so that conversions to strings default to the maximum number of precision digits. 06-05-16 Bug fixes for multibyte locales. -06-05-10 The =~ operator was added to [[...]] and [[ string ~= ERE ]] +06-05-10 The =~ operator was added to [[ ... ]] and [[ string ~= ERE ]] is equivalent to [[ string == ~(E)ERE ]]. 06-04-25 A bug in the vi edit mode which could cause the shell to core dump when switching from emacs mode. @@ -1853,7 +1857,7 @@ 05-08-31 +In the case that IFS contains to adjacent new-lines so that new-line is not treated as a space delimiter, only a single new-line is deleted at the end of a command substitution. -05-08-19 +When a tilde substitution expands to the / directory and is +05-08-19 +When a tilde expansion expands to the / directory and is followed by a /, it is replaced by the empty string. 05-08-16 A bug in which n<&m did not synchronize m has been fixed. 05-08-16 A bug in which process substitution ( <() and >() ) was not @@ -1880,7 +1884,7 @@ 05-05-18 A bug in which the line number for errors was not correct for functions loaded from FPATH has been fixed. 05-04-18 A bug in which the exit status $? is not set when a trap triggered - by the [[...]] command is executed has been fixed. + by the [[ ... ]] command is executed has been fixed. 05-04-08 +Redirection operators can be directly preceded with {varname} with no intervening space, where varname is a variable name which allows the shell to select a file descriptor > 10 and store it @@ -1955,7 +1959,7 @@ the shared library named by libname will first be searched for a built-in version of the command. 04-09-03 <<< here documents now handle quotes in the word token correctly. -04-08-08 +The maximum size for read -n and and read -N was increased from +04-08-08 +The maximum size for read -n and read -N was increased from 4095 to 32M. 04-08-04 +printf %q was modified so that if an no operand was supplied, no no output would be generated rather than a quoted empty string. @@ -2065,7 +2069,7 @@ 03-08-07 A bug in which the KEYBD trap was not being invoked when characters with the 8th bit set has been fixed. 03-08-02 A parser bug introduced in ksh93o which caused the character - after () in a Posix function definition to be skipped + after () in a POSIX function definition to be skipped when reading from standard input has been fixed. 03-08-01 A bug in which "${foo#pattern}(x)" treated (x) as if it were part of the pattern has been fixed. @@ -2075,7 +2079,7 @@ work as expected. 03-07-20 --- Release ksh93o+ --- -03-07-20 A bug in which could cause memory corruption when a posix +03-07-20 A bug in which could cause memory corruption when a POSIX function invoked another one has been fixed. 03-07-15 A bug in which a file descriptor>2 could be closed before executing a script has been fixed. @@ -2122,7 +2126,7 @@ would go to the standard output of the invoking command when uname was invoked with a non-standard option has been fixed. 03-05-19 A job control bug which would cause the shell to exit because - it hadn't take back the terminal has been fixed. The bug + it hadn't taken back the terminal has been fixed. The bug could occur when running a function that contained a pipeline whose last element was a function. 03-05-19 A job control timing bug introduced in ksh93o on some systems @@ -2144,7 +2148,7 @@ did not follow x has been fixed. 03-03-18 --- Release ksh93o --- -03-03-18 +A -N unary operator was added to test and [[...]] which returns +03-03-18 +A -N unary operator was added to test and [[ ... ]] which returns true if the file exists and the file has been modified since it was last read. 03-03-18 +The TIMEFORMAT variable was added to control the format for @@ -2168,7 +2172,7 @@ displays the function name followed by a comment containing the line number and the path name for the file that defined this function. 03-02-28 A bug in which the value of $LINENO was not correct when executing - command contained inside mult-line command substitutions has been + command contained inside multi-line command substitutions has been fixed. 03-02-19 +Since some existing ksh88 scripts use the undocumented and unintended ability to insert a : in front of the % and # parameter @@ -2373,14 +2377,14 @@ 01-09-25 +The exponentiation operator ** was added to the shell arithmetic evaluation. It has higher precedence than * and is left associative. -01-09-25 The code was modified to use the ast multibyte macros +01-09-25 The code was modified to use the AST multibyte macros and functions for handling multibyte locales. 01-09-25 +The expansion ${parameter:offset:length} now handles negative offsets which cause offsets to be measured from the end. 01-09-25 Some spelling errors in the documentation were corrected. 01-09-24 +The /dev/tcp/host/port and /dev/udp/host/port now allow the ports to be specified by service name. -01-09-24 +The change staring with ksh93g in which the the appropriate +01-09-24 +The change starting with ksh93g in which the appropriate library path variable is prepended with a corresponding library directory has been modified. With the new method, only the library path defined in the file named .paths in the directory @@ -2437,7 +2441,7 @@ long integers to floating point variables has been fixed. 01-06-18 A bug in the handling of unsigned integers (typeset -ui) has been fixed. -01-06-04 The evaluation of the PS1 prompt no longer effects the value +01-06-04 The evaluation of the PS1 prompt no longer affects the value of the $? variable. 01-06-01 A small memory leak from subshells has been fixed. 01-05-22 A bug in which attributes for variables that did not have @@ -2505,13 +2509,13 @@ command and copies the remainder so that it can be used for standard input. 01-04-30 +The shcomp command was modified so that it can work in an - EBCIDIC environment and that binary scripts are portable + EBCDIC environment and that binary scripts are portable across environments. 01-04-30 A bug in the handling of a trailing : in PATH has been fixed. 01-04-30 A bug in which the builtin version of a command would get invoked even though the full pathname for the command was specified has been fixed. -01-04-30 A bug in which read would loose the last character when +01-04-30 A bug in which read would lose the last character when reading the last line of a file that did not contain a new-line character has been fixed. 01-04-23 A bug on some systems in which in vi mode the end of file @@ -2625,7 +2629,7 @@ checking name to see if it was a name reference has been fixed. 00-09-26 A bug in the multibyte version in which the width of for non-printing characters was not correct has been fixed. -00-09-12 +Made changes to get multibyte editing work on UWIN for windows +00-09-12 +Made changes to get multibyte editing work on UWIN for Windows. 00-09-12 A bug in which multibyte characters would be displayed incorrectly has been fixed. 00-08-08 Removed build dependency on iswprint() and iswalph(). @@ -2639,7 +2643,7 @@ jobs have completed has been fixed. 00-06-21 A bug in which backspace did not work correctly during the R replace directive in vi-mode has been fixed. -00-06-12 +Added variable name completion/expansion/listing to the set of +00-06-12 +Added variable name completion/expansion/listing to the set of completions. Variable name completions begin with $ or "$ followed by a letter. 00-05-09 --- Release ksh93j --- @@ -2660,7 +2664,7 @@ 00-03-30 +Code was modified in several places to support automatic generation of C locale dictionaries. 00-03-28 A bug in which the set and trap commands invoked with --name - type arguments would terminate the invoking script has + type arguments would terminate the invoking script has been fixed. 00-03-27 A bug in which the library path variable was not updated correctly on some systems as described in the 'g' point @@ -2703,7 +2707,7 @@ 99-03-31 +The TAB key can be used for completion in emacs and viraw mode. 99-03-31 A bug in setting .sh.editchar during the KEYBD trap for the MULTIBYTE option was fixed in release ksh93h. -99-03-31 A bug in shcomp for compilation of unary operators with [[...]] +99-03-31 A bug in shcomp for compilation of unary operators with [[ ... ]] has been fixed. 99-03-31 A bug in which the value of $? was changed when executing a keyboard trap has been fixed. @@ -2711,7 +2715,7 @@ trap is not triggered while executing trap commands to avoid recursive trap calls. 99-03-31 A bug in which a local variable in a function declared readonly - would generated an error when the function went out of + would generate an error when the function went out of scope has been fixed. 99-03-31 A bug in which \ entered from the keyboard with the KEYBD trap enabled has been fixed. @@ -2754,7 +2758,7 @@ the variable it references was the subject of a compound assignment has been fixed. 98-04-30 A bug which in which assignment to array variables in - a subshell could effect the parent shell has been + a subshell could affect the parent shell has been fixed. 98-04-30 read name?prompt was putting a 0 byte at the end of the prompt on standard error. @@ -2853,7 +2857,7 @@ 96-07-31 A bug in right to left arithmetic assignment for which the arithmetic expression (( y = x = 1.5 )) did not yield 1 for y when x was declared typeset -i was fixed. -96-07-31 printf has been fixed to handle format containing \0 +96-07-31 printf has been fixed to handle format containing \0 and/or \0145 correctly. In addition, characters following %b in the format string are no longer displayed when the operand contains \c. @@ -2861,7 +2865,7 @@ produce unnormalized results has been fixed. 96-07-31 A bug which causes some arithmetic expressions to be incorrectly evaluated as integer expressions rather - that floating point has been fixed. + than floating point has been fixed. 96-07-31 Functions defined inside a subshell no longer remain defined when the subshell completes. 96-07-31 The error message from sh -c ';echo foo' has been @@ -2871,7 +2875,7 @@ 96-07-31 A bug that caused side effects in subscript evaluation when tracing was enabled for subscripts using ++ or -- has been fixed. -96-07-31 To conform to the Posix standard getopts has been changed +96-07-31 To conform to the POSIX standard getopts has been changed so that the option char is set to ? when it returns with a non-zero exit status. 96-07-31 The handling of \} inside ${name...} has been fixed so @@ -2889,7 +2893,7 @@ 96-07-31 The error message for ksh -o unknown was incorrect. 96-07-31 Functions invoked as name=value name, did not use values from the calling scope when evaluating value. -96-07-31 A bug in which the shell would reexecute previously +96-07-31 A bug in which the shell would re-execute previously executed code when a shell script or coprocess was run in the background has been fixed. 96-07-31 A bug in which an empty here-document would leave @@ -3043,7 +3047,7 @@ the job list as required by the POSIX standard. 94-12-31 The value of OPTARG when an option that required an argument but didn't have one was incorrect in the - case the the option string began with a :. + case the option string began with a :. 94-12-31 A bug which caused the terminal to get into a bad state with some KEYBD traps in vi-mode has been fixed. 94-12-31 A bug which caused an invalid trap to cause a script diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE88 b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE88 index d2e8e88c6..ac6d817a0 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE88 +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE88 @@ -1,3 +1,7 @@ +This file is of historic interest. For recent changes in both ksh 93u+m and +the accompanying libraries, see the file NEWS in the top-level directory. +____ + This is a list of changes that have been made since the 11/16/88 version of ksh. @@ -38,7 +42,7 @@ of ksh. 6. ${@:expr1:expr2} expands to at most expr2 positional parameters starting at expr1. 7. ${!name} expands to the name of the variable named by name. - It will expand to name unless name is reference variable. + It will expand to name unless name is a reference variable. 8. ${!name[sub]} expands to the name of the subscript of the given variable. If sub is @ or * the list of subscripts is generated. @@ -54,7 +58,7 @@ of ksh. 13. ${name/%pattern/string} Same as above but the pattern to be replaced must match at the end. 14. ${name//pattern/string} expands to the value of name with - the each occurrence of pattern replaced by string. + each occurrence of pattern replaced by string. With aggregates (@ or *) this operation is applied to each. d. The name space for variables has been extended. The character '.' @@ -62,7 +66,7 @@ of ksh. within a name. However, to create a name of the form, foo.bar, the variable foo must exist. The namespace starting with .sh is reserved for shell implementation variables. Exported - variable cannot contain a '.'. + variables cannot contain a '.'. e. Compound assignments. The assignment syntax, varname=value, has been extended to allow assignments of the form @@ -103,7 +107,7 @@ of ksh. h. On systems that support dynamic loading with dlopen(), it is now possible to add built-in commands at runtime with the - a builtin command named builtin. + builtin command named 'builtin'. i. The following builtins have been added: 1. command name [ ... ] @@ -114,9 +118,9 @@ of ksh. j. An addition format for literal strings, $'....' can be used where ever literal strings are valid. The string - inside the single quotes will be converted using the ANSI-C + inside the single quotes will be converted using the ANSI C escape conventions. Additionally, the escape sequence \E - expands to the escape character (default \033) whenever ANSI-C + expands to the escape character (default \033) whenever ANSI C escape sequences are recognized. k. A typeset -n option has been added which causes the value of a @@ -182,7 +186,7 @@ of ksh. that the string needs translation but is otherwise ignored. This means that if a message catalog of all $"..." strings is generated, then a program such as print $"hello world" - could display "bonjour monde" in the french locale. + could display "bonjour monde" in the French locale. q. Backreferences have been added to pattern matching. The sequence \d, where d is a digit from 1-9, matches the same string as the d-th previous parenthesis group. Backreferences @@ -202,7 +206,7 @@ of ksh. characters are quoted in a manner that then can be re-input. 4. The trace output puts quotes around the output so that it can be reused as input. - 5. The output for trap is in a format that can be reinput the + 5. The output for trap is in a format that can be reinput to the shell to restore the traps. 6. kill -l lists the signal names without numbers as required by the POSIX standard. @@ -258,7 +262,7 @@ of ksh. 2. The -C option is equivalent to -o noclobber. Files are created with O_EXCL when -C is on. - h. The following changes have been made to [[...]]: + h. The following changes have been made to [[ ... ]]: 1. A string by itself is equivalent to -n string. 2. -e has been added as equivalent to -a. 3. == has been added as equivalent =. @@ -286,7 +290,7 @@ of ksh. corresponds to the give extended regular expression. 6. For numerical fields, the arguments can be arithmetic expressions which will be evaluated. - 7. The %n format works as described in ANSI-C. + 7. The %n format works as described in ANSI C. k. The following changes have been made to fc: 1. It has been renamed hist. fc is now a predefined alias. @@ -395,7 +399,7 @@ of ksh. the FEATURE mechanism of nmake. Other options are set in the OPTIONS file. - c. The are several new compile time options. See the README + c. There are several new compile time options. See the README file for details. Some of the old ones have been removed. d. The install script is a Mamfile that is generated by diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE93 b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE93 index 2e282012e..afd108065 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE93 +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/RELEASE93 @@ -1,3 +1,7 @@ +This file is of historic interest. For recent changes in both ksh 93u+m and +the accompanying libraries, see the file NEWS in the top-level directory. +____ + This is a list of changes that have been made since the 12/28/93 version of ksh. @@ -131,7 +135,7 @@ of ksh. the job list as required by the POSIX standard. l. The value of OPTARG when an option that required an argument but didn't have one was incorrect in the - case the the option string began with a :. + case the option string began with a :. m. A bug which caused the terminal to get into a bad state with some KEYBD traps in vi-mode has been fixed. n. A bug which caused an invalid trap to cause a script @@ -229,7 +233,7 @@ of ksh. c. A bug in right to left arithmetic assignment for which the arithmetic expression (( y = x = 1.5 )) did not yield 1 for y when x was declared typeset -i was fixed. - d. printf has been fixed to handle format containing \0 + d. printf has been fixed to handle format containing \0 and/or \0145 correctly. In addition, characters following %b in the format string are no longer displayed when the operand contains \c. @@ -265,7 +269,7 @@ of ksh. r. The error message for ksh -o unknown was incorrect. s. Functions invoked as name=value name, did not use values from the calling scope when evaluating value. - t. A bug in which the shell would reexecute previously + t. A bug in which the shell would re-execute previously executed code when a shell script or coprocess was run in the background has been fixed. u. A bug in which an empty here-document would leave @@ -359,7 +363,7 @@ of ksh. were split across buffer boundaries has been fixed. 14. Bugs fixed in 12/28/93h for default OPTIONS - a. I bug in shcomp for compilation of unary operators with [[...]] + a. I bug in shcomp for compilation of unary operators with [[ ... ]] has been fixed. b. A bug in which the value of $? was changed when executing a keyboard trap has been fixed. @@ -452,4 +456,3 @@ of ksh. 18. Incompatibilities with 12/28/93 version. None intentional. - diff --git a/cde/programs/dtksh/ksh93/src/cmd/ksh93/SHOPT.sh b/cde/programs/dtksh/ksh93/src/cmd/ksh93/SHOPT.sh index f03f8b762..23a6ec0a0 100644 --- a/cde/programs/dtksh/ksh93/src/cmd/ksh93/SHOPT.sh +++ b/cde/programs/dtksh/ksh93/src/cmd/ksh93/SHOPT.sh @@ -2,6 +2,8 @@ # Compile-time SHOPT_* options for ksh93. # 1 to enable, 0 to disable, empty value to probe. # +# For a more complete description of the options, see src/cmd/ksh93/README. +# SHOPT 2DMATCH=1 # two dimensional ${.sh.match} for ${var//pat/str} SHOPT ACCT= # accounting @@ -13,28 +15,32 @@ SHOPT BRACEPAT=1 # C-shell {...,...} expansions (, required) SHOPT CMDLIB_HDR= # '' # custom -lcmd list for path-bound builtins SHOPT CMDLIB_DIR= # '\"/opt/ast/bin\"' # virtual directory prefix for path-bound builtins SHOPT CRNL= # accept MS Windows newlines () for +SHOPT DEVFD= # use /dev/fd instead of FIFOs for process substitutions SHOPT DYNAMIC=1 # dynamic loading for builtins SHOPT ECHOPRINT= # make echo equivalent to print -SHOPT EDPREDICT=1 # predictive editing +SHOPT EDPREDICT=0 # History pattern search menu (type #, then ESC TAB). Experimental. SHOPT ESH=1 # emacs/gmacs edit mode SHOPT FILESCAN=1 # fast file scan SHOPT FIXEDARRAY=1 # fixed dimension indexed array +SHOPT GLOBCASEDET= # -o globcasedetect: adapt globbing/completion to case-insensitive file systems SHOPT HISTEXPAND=1 # csh-style history file expansions SHOPT KIA= # ksh -R