svn commit: r367465 - in head: contrib/bmake contrib/bmake/filemon contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests

Simon J. Gerraty sjg at FreeBSD.org
Sat Nov 7 21:46:29 UTC 2020


Author: sjg
Date: Sat Nov  7 21:46:27 2020
New Revision: 367465
URL: https://svnweb.freebsd.org/changeset/base/367465

Log:
  Update to bmake-20201101
  
  Lots of new unit-tests increase code coverage.
  
  Lots of refactoring, cleanup and simlpification to reduce
  code size.
  
  Fixes for Bug 223564 and 245807
  
  Updates to dirdeps.mk and meta2deps.py

Added:
  head/contrib/bmake/unit-tests/cond-cmp-unary.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-unary.exp
  head/contrib/bmake/unit-tests/cond-cmp-unary.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/cond-cmp-unary.mk
  head/contrib/bmake/unit-tests/cond-undef-lint.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/cond-undef-lint.exp
  head/contrib/bmake/unit-tests/cond-undef-lint.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/cond-undef-lint.mk
  head/contrib/bmake/unit-tests/counter-append.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/counter-append.exp
  head/contrib/bmake/unit-tests/counter-append.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/counter-append.mk
  head/contrib/bmake/unit-tests/dep-colon-bug-cross-file.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/dep-colon-bug-cross-file.exp
  head/contrib/bmake/unit-tests/dep-colon-bug-cross-file.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/dep-colon-bug-cross-file.mk
  head/contrib/bmake/unit-tests/dep-double-colon-indep.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/dep-double-colon-indep.exp
  head/contrib/bmake/unit-tests/dep-double-colon-indep.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/dep-double-colon-indep.mk
  head/contrib/bmake/unit-tests/dep-percent.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/dep-percent.exp
  head/contrib/bmake/unit-tests/dep-percent.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/dep-percent.mk
  head/contrib/bmake/unit-tests/depsrc-end.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/depsrc-end.exp
  head/contrib/bmake/unit-tests/depsrc-end.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/depsrc-end.mk
  head/contrib/bmake/unit-tests/deptgt-end-jobs.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/deptgt-end-jobs.exp
  head/contrib/bmake/unit-tests/deptgt-end-jobs.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/deptgt-end-jobs.mk
  head/contrib/bmake/unit-tests/directive-dinclude.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-dinclude.exp
  head/contrib/bmake/unit-tests/directive-dinclude.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-dinclude.mk
  head/contrib/bmake/unit-tests/directive-export-gmake.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-export-gmake.exp
  head/contrib/bmake/unit-tests/directive-export-gmake.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-export-gmake.mk
  head/contrib/bmake/unit-tests/directive-hyphen-include.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-hyphen-include.exp
  head/contrib/bmake/unit-tests/directive-hyphen-include.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-hyphen-include.mk
  head/contrib/bmake/unit-tests/directive-include-fatal.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-include-fatal.exp
  head/contrib/bmake/unit-tests/directive-include-fatal.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-include-fatal.mk
  head/contrib/bmake/unit-tests/directive-include.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-include.exp
  head/contrib/bmake/unit-tests/directive-include.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-include.mk
  head/contrib/bmake/unit-tests/directive-sinclude.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-sinclude.exp
  head/contrib/bmake/unit-tests/directive-sinclude.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/directive-sinclude.mk
  head/contrib/bmake/unit-tests/hanoi-include.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/hanoi-include.exp
  head/contrib/bmake/unit-tests/hanoi-include.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/hanoi-include.mk
  head/contrib/bmake/unit-tests/job-output-long-lines.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/job-output-long-lines.exp
  head/contrib/bmake/unit-tests/job-output-long-lines.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/job-output-long-lines.mk
  head/contrib/bmake/unit-tests/opt-debug-all.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-all.exp
  head/contrib/bmake/unit-tests/opt-debug-all.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-all.mk
  head/contrib/bmake/unit-tests/opt-debug-archive.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-archive.exp
  head/contrib/bmake/unit-tests/opt-debug-archive.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-archive.mk
  head/contrib/bmake/unit-tests/opt-debug-cond.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-cond.exp
  head/contrib/bmake/unit-tests/opt-debug-cond.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-cond.mk
  head/contrib/bmake/unit-tests/opt-debug-curdir.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-curdir.exp
  head/contrib/bmake/unit-tests/opt-debug-curdir.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-curdir.mk
  head/contrib/bmake/unit-tests/opt-debug-dir.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-dir.exp
  head/contrib/bmake/unit-tests/opt-debug-dir.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-dir.mk
  head/contrib/bmake/unit-tests/opt-debug-errors.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-errors.exp
  head/contrib/bmake/unit-tests/opt-debug-errors.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-errors.mk
  head/contrib/bmake/unit-tests/opt-debug-file.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-file.exp
  head/contrib/bmake/unit-tests/opt-debug-file.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-file.mk
  head/contrib/bmake/unit-tests/opt-debug-for.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-for.exp
  head/contrib/bmake/unit-tests/opt-debug-for.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-for.mk
  head/contrib/bmake/unit-tests/opt-debug-graph1.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph1.exp
  head/contrib/bmake/unit-tests/opt-debug-graph1.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph1.mk
  head/contrib/bmake/unit-tests/opt-debug-graph2.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph2.exp
  head/contrib/bmake/unit-tests/opt-debug-graph2.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph2.mk
  head/contrib/bmake/unit-tests/opt-debug-graph3.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph3.exp
  head/contrib/bmake/unit-tests/opt-debug-graph3.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-graph3.mk
  head/contrib/bmake/unit-tests/opt-debug-hash.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-hash.exp
  head/contrib/bmake/unit-tests/opt-debug-hash.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-hash.mk
  head/contrib/bmake/unit-tests/opt-debug-jobs.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-jobs.exp
  head/contrib/bmake/unit-tests/opt-debug-jobs.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-jobs.mk
  head/contrib/bmake/unit-tests/opt-debug-lint.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-lint.exp
  head/contrib/bmake/unit-tests/opt-debug-lint.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-lint.mk
  head/contrib/bmake/unit-tests/opt-debug-loud.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-loud.exp
  head/contrib/bmake/unit-tests/opt-debug-loud.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-loud.mk
  head/contrib/bmake/unit-tests/opt-debug-making.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-making.exp
  head/contrib/bmake/unit-tests/opt-debug-making.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-making.mk
  head/contrib/bmake/unit-tests/opt-debug-meta.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-meta.exp
  head/contrib/bmake/unit-tests/opt-debug-meta.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-meta.mk
  head/contrib/bmake/unit-tests/opt-debug-no-rm.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-no-rm.exp
  head/contrib/bmake/unit-tests/opt-debug-no-rm.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-no-rm.mk
  head/contrib/bmake/unit-tests/opt-debug-parse.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-parse.exp
  head/contrib/bmake/unit-tests/opt-debug-parse.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-parse.mk
  head/contrib/bmake/unit-tests/opt-debug-suff.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-suff.exp
  head/contrib/bmake/unit-tests/opt-debug-suff.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-suff.mk
  head/contrib/bmake/unit-tests/opt-debug-targets.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-targets.exp
  head/contrib/bmake/unit-tests/opt-debug-targets.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-targets.mk
  head/contrib/bmake/unit-tests/opt-debug-var.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-var.exp
  head/contrib/bmake/unit-tests/opt-debug-var.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-var.mk
  head/contrib/bmake/unit-tests/opt-debug-varraw.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-varraw.exp
  head/contrib/bmake/unit-tests/opt-debug-varraw.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-varraw.mk
  head/contrib/bmake/unit-tests/opt-debug-x-trace.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-x-trace.exp
  head/contrib/bmake/unit-tests/opt-debug-x-trace.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/opt-debug-x-trace.mk
  head/contrib/bmake/unit-tests/parse-var.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/parse-var.exp
  head/contrib/bmake/unit-tests/parse-var.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/parse-var.mk
  head/contrib/bmake/unit-tests/shell-csh.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-csh.exp
  head/contrib/bmake/unit-tests/shell-csh.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-csh.mk
  head/contrib/bmake/unit-tests/shell-custom.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-custom.exp
  head/contrib/bmake/unit-tests/shell-custom.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-custom.mk
  head/contrib/bmake/unit-tests/shell-ksh.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-ksh.exp
  head/contrib/bmake/unit-tests/shell-ksh.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-ksh.mk
  head/contrib/bmake/unit-tests/shell-sh.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-sh.exp
  head/contrib/bmake/unit-tests/shell-sh.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/shell-sh.mk
  head/contrib/bmake/unit-tests/suff-add-later.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-add-later.exp
  head/contrib/bmake/unit-tests/suff-add-later.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-add-later.mk
  head/contrib/bmake/unit-tests/suff-clear-regular.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-clear-regular.exp
  head/contrib/bmake/unit-tests/suff-clear-regular.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-clear-regular.mk
  head/contrib/bmake/unit-tests/suff-clear-single.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-clear-single.exp
  head/contrib/bmake/unit-tests/suff-clear-single.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-clear-single.mk
  head/contrib/bmake/unit-tests/suff-lookup.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-lookup.exp
  head/contrib/bmake/unit-tests/suff-lookup.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-lookup.mk
  head/contrib/bmake/unit-tests/suff-main.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-main.exp
  head/contrib/bmake/unit-tests/suff-main.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-main.mk
  head/contrib/bmake/unit-tests/suff-rebuild.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-rebuild.exp
  head/contrib/bmake/unit-tests/suff-rebuild.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-rebuild.mk
  head/contrib/bmake/unit-tests/suff-transform-endless.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-transform-endless.exp
  head/contrib/bmake/unit-tests/suff-transform-endless.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-transform-endless.mk
  head/contrib/bmake/unit-tests/suff-transform-expand.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-transform-expand.exp
  head/contrib/bmake/unit-tests/suff-transform-expand.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-transform-expand.mk
  head/contrib/bmake/unit-tests/suff-transform-select.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-transform-select.exp
  head/contrib/bmake/unit-tests/suff-transform-select.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/suff-transform-select.mk
  head/contrib/bmake/unit-tests/var-op-sunsh.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/var-op-sunsh.exp
  head/contrib/bmake/unit-tests/var-op-sunsh.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/var-op-sunsh.mk
  head/contrib/bmake/unit-tests/var-recursive.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/var-recursive.exp
  head/contrib/bmake/unit-tests/var-recursive.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/var-recursive.mk
  head/contrib/bmake/unit-tests/varname-make_print_var_on_error-jobs.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varname-make_print_var_on_error-jobs.exp
  head/contrib/bmake/unit-tests/varname-make_print_var_on_error-jobs.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varname-make_print_var_on_error-jobs.mk
  head/contrib/bmake/unit-tests/varname-makefile.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varname-makefile.exp
  head/contrib/bmake/unit-tests/varname-makefile.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varname-makefile.mk
  head/contrib/bmake/unit-tests/varparse-mod.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varparse-mod.exp
  head/contrib/bmake/unit-tests/varparse-mod.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varparse-mod.mk
  head/contrib/bmake/unit-tests/varparse-undef-partial.exp
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varparse-undef-partial.exp
  head/contrib/bmake/unit-tests/varparse-undef-partial.mk
     - copied unchanged from r367461, vendor/NetBSD/bmake/dist/unit-tests/varparse-undef-partial.mk
Deleted:
  head/contrib/bmake/strlist.c
  head/contrib/bmake/strlist.h
  head/contrib/bmake/unit-tests/cond2.exp
  head/contrib/bmake/unit-tests/cond2.mk
  head/contrib/bmake/unit-tests/hash.exp
  head/contrib/bmake/unit-tests/hash.mk
  head/contrib/bmake/unit-tests/misc.exp
  head/contrib/bmake/unit-tests/misc.mk
  head/contrib/bmake/unit-tests/opt-debug-g1.exp
  head/contrib/bmake/unit-tests/opt-debug-g1.mk
  head/contrib/bmake/unit-tests/suffixes.exp
  head/contrib/bmake/unit-tests/suffixes.mk
  head/contrib/bmake/unit-tests/sysv.exp
  head/contrib/bmake/unit-tests/sysv.mk
Modified:
  head/contrib/bmake/ChangeLog
  head/contrib/bmake/FILES
  head/contrib/bmake/Makefile
  head/contrib/bmake/VERSION
  head/contrib/bmake/arch.c
  head/contrib/bmake/bmake.1
  head/contrib/bmake/bmake.cat1
  head/contrib/bmake/boot-strap
  head/contrib/bmake/buf.c
  head/contrib/bmake/buf.h
  head/contrib/bmake/compat.c
  head/contrib/bmake/cond.c
  head/contrib/bmake/configure
  head/contrib/bmake/configure.in
  head/contrib/bmake/dir.c
  head/contrib/bmake/dir.h
  head/contrib/bmake/enum.c
  head/contrib/bmake/enum.h
  head/contrib/bmake/filemon/filemon.h
  head/contrib/bmake/filemon/filemon_ktrace.c
  head/contrib/bmake/for.c
  head/contrib/bmake/hash.c
  head/contrib/bmake/hash.h
  head/contrib/bmake/job.c
  head/contrib/bmake/job.h
  head/contrib/bmake/lst.c
  head/contrib/bmake/lst.h
  head/contrib/bmake/main.c
  head/contrib/bmake/make-bootstrap.sh.in
  head/contrib/bmake/make-conf.h
  head/contrib/bmake/make.1
  head/contrib/bmake/make.c
  head/contrib/bmake/make.h
  head/contrib/bmake/make_malloc.c
  head/contrib/bmake/make_malloc.h
  head/contrib/bmake/meta.c
  head/contrib/bmake/meta.h
  head/contrib/bmake/metachar.c
  head/contrib/bmake/metachar.h
  head/contrib/bmake/mk/ChangeLog
  head/contrib/bmake/mk/dirdeps-cache-update.mk
  head/contrib/bmake/mk/dirdeps.mk
  head/contrib/bmake/mk/install-mk
  head/contrib/bmake/mk/meta2deps.py
  head/contrib/bmake/mk/meta2deps.sh
  head/contrib/bmake/mk/sys.vars.mk
  head/contrib/bmake/nonints.h
  head/contrib/bmake/parse.c
  head/contrib/bmake/str.c
  head/contrib/bmake/suff.c
  head/contrib/bmake/targ.c
  head/contrib/bmake/trace.c
  head/contrib/bmake/trace.h
  head/contrib/bmake/unit-tests/Makefile
  head/contrib/bmake/unit-tests/archive.exp
  head/contrib/bmake/unit-tests/archive.mk
  head/contrib/bmake/unit-tests/comment.exp
  head/contrib/bmake/unit-tests/comment.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-eq.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric-eq.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-ge.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-gt.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-le.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-lt.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric-ne.mk
  head/contrib/bmake/unit-tests/cond-cmp-numeric.exp
  head/contrib/bmake/unit-tests/cond-cmp-numeric.mk
  head/contrib/bmake/unit-tests/cond-cmp-string.exp
  head/contrib/bmake/unit-tests/cond-cmp-string.mk
  head/contrib/bmake/unit-tests/cond-func-commands.mk
  head/contrib/bmake/unit-tests/cond-func-defined.mk
  head/contrib/bmake/unit-tests/cond-func-empty.mk
  head/contrib/bmake/unit-tests/cond-func-exists.mk
  head/contrib/bmake/unit-tests/cond-func-make.exp
  head/contrib/bmake/unit-tests/cond-func-make.mk
  head/contrib/bmake/unit-tests/cond-func-target.mk
  head/contrib/bmake/unit-tests/cond-func.mk
  head/contrib/bmake/unit-tests/cond-op-and.exp
  head/contrib/bmake/unit-tests/cond-op-and.mk
  head/contrib/bmake/unit-tests/cond-op-not.mk
  head/contrib/bmake/unit-tests/cond-op-or.exp
  head/contrib/bmake/unit-tests/cond-op-or.mk
  head/contrib/bmake/unit-tests/cond-op.exp
  head/contrib/bmake/unit-tests/cond-op.mk
  head/contrib/bmake/unit-tests/cond-short.mk
  head/contrib/bmake/unit-tests/cond-token-number.exp
  head/contrib/bmake/unit-tests/cond-token-number.mk
  head/contrib/bmake/unit-tests/cond-token-plain.exp
  head/contrib/bmake/unit-tests/cond-token-plain.mk
  head/contrib/bmake/unit-tests/cond-token-var.mk
  head/contrib/bmake/unit-tests/cond1.exp
  head/contrib/bmake/unit-tests/cond1.mk
  head/contrib/bmake/unit-tests/counter.exp
  head/contrib/bmake/unit-tests/counter.mk
  head/contrib/bmake/unit-tests/dep-colon.exp
  head/contrib/bmake/unit-tests/dep-colon.mk
  head/contrib/bmake/unit-tests/dep-double-colon.mk
  head/contrib/bmake/unit-tests/dep-var.exp
  head/contrib/bmake/unit-tests/dep-var.mk
  head/contrib/bmake/unit-tests/dep-wildcards.exp
  head/contrib/bmake/unit-tests/dep-wildcards.mk
  head/contrib/bmake/unit-tests/depsrc-exec.exp
  head/contrib/bmake/unit-tests/depsrc-exec.mk
  head/contrib/bmake/unit-tests/depsrc-made.exp
  head/contrib/bmake/unit-tests/depsrc-made.mk
  head/contrib/bmake/unit-tests/depsrc-make.exp
  head/contrib/bmake/unit-tests/depsrc-make.mk
  head/contrib/bmake/unit-tests/depsrc-notmain.exp
  head/contrib/bmake/unit-tests/depsrc-notmain.mk
  head/contrib/bmake/unit-tests/depsrc-optional.exp
  head/contrib/bmake/unit-tests/depsrc-optional.mk
  head/contrib/bmake/unit-tests/depsrc-phony.exp
  head/contrib/bmake/unit-tests/depsrc-phony.mk
  head/contrib/bmake/unit-tests/depsrc-recursive.exp
  head/contrib/bmake/unit-tests/depsrc-recursive.mk
  head/contrib/bmake/unit-tests/depsrc-wait.exp
  head/contrib/bmake/unit-tests/depsrc-wait.mk
  head/contrib/bmake/unit-tests/deptgt-delete_on_error.exp
  head/contrib/bmake/unit-tests/deptgt-delete_on_error.mk
  head/contrib/bmake/unit-tests/deptgt-end.exp
  head/contrib/bmake/unit-tests/deptgt-end.mk
  head/contrib/bmake/unit-tests/deptgt-makeflags.exp
  head/contrib/bmake/unit-tests/deptgt-makeflags.mk
  head/contrib/bmake/unit-tests/deptgt-silent.exp
  head/contrib/bmake/unit-tests/deptgt-silent.mk
  head/contrib/bmake/unit-tests/deptgt-suffixes.exp
  head/contrib/bmake/unit-tests/deptgt.exp
  head/contrib/bmake/unit-tests/deptgt.mk
  head/contrib/bmake/unit-tests/dir.exp
  head/contrib/bmake/unit-tests/dir.mk
  head/contrib/bmake/unit-tests/directive-else.mk
  head/contrib/bmake/unit-tests/directive-export-literal.exp
  head/contrib/bmake/unit-tests/directive-export-literal.mk
  head/contrib/bmake/unit-tests/directive-export.mk
  head/contrib/bmake/unit-tests/directive-for.exp
  head/contrib/bmake/unit-tests/directive-for.mk
  head/contrib/bmake/unit-tests/directive-ifndef.exp
  head/contrib/bmake/unit-tests/directive-ifndef.mk
  head/contrib/bmake/unit-tests/directive-ifnmake.exp
  head/contrib/bmake/unit-tests/directive-ifnmake.mk
  head/contrib/bmake/unit-tests/directive-undef.mk
  head/contrib/bmake/unit-tests/directive-unexport.exp
  head/contrib/bmake/unit-tests/directive-unexport.mk
  head/contrib/bmake/unit-tests/directives.mk
  head/contrib/bmake/unit-tests/doterror.mk
  head/contrib/bmake/unit-tests/dotwait.mk
  head/contrib/bmake/unit-tests/envfirst.mk
  head/contrib/bmake/unit-tests/error.exp
  head/contrib/bmake/unit-tests/error.mk
  head/contrib/bmake/unit-tests/escape.mk
  head/contrib/bmake/unit-tests/export-all.mk
  head/contrib/bmake/unit-tests/export-env.mk
  head/contrib/bmake/unit-tests/export-variants.mk
  head/contrib/bmake/unit-tests/export.exp
  head/contrib/bmake/unit-tests/export.mk
  head/contrib/bmake/unit-tests/forloop.exp
  head/contrib/bmake/unit-tests/forloop.mk
  head/contrib/bmake/unit-tests/forsubst.mk
  head/contrib/bmake/unit-tests/include-main.exp
  head/contrib/bmake/unit-tests/include-main.mk
  head/contrib/bmake/unit-tests/include-sub.mk
  head/contrib/bmake/unit-tests/include-subsub.mk
  head/contrib/bmake/unit-tests/lint.exp
  head/contrib/bmake/unit-tests/lint.mk
  head/contrib/bmake/unit-tests/make-exported.exp
  head/contrib/bmake/unit-tests/make-exported.mk
  head/contrib/bmake/unit-tests/moderrs.exp
  head/contrib/bmake/unit-tests/moderrs.mk
  head/contrib/bmake/unit-tests/modmatch.mk
  head/contrib/bmake/unit-tests/modmisc.mk
  head/contrib/bmake/unit-tests/modts.mk
  head/contrib/bmake/unit-tests/modword.exp
  head/contrib/bmake/unit-tests/modword.mk
  head/contrib/bmake/unit-tests/opt-debug.exp
  head/contrib/bmake/unit-tests/opt-debug.mk
  head/contrib/bmake/unit-tests/opt-ignore.exp
  head/contrib/bmake/unit-tests/opt-ignore.mk
  head/contrib/bmake/unit-tests/opt-keep-going.exp
  head/contrib/bmake/unit-tests/opt-keep-going.mk
  head/contrib/bmake/unit-tests/phony-end.mk
  head/contrib/bmake/unit-tests/posix.mk
  head/contrib/bmake/unit-tests/posix1.mk
  head/contrib/bmake/unit-tests/qequals.mk
  head/contrib/bmake/unit-tests/recursive.mk
  head/contrib/bmake/unit-tests/sh-dots.exp
  head/contrib/bmake/unit-tests/sh-dots.mk
  head/contrib/bmake/unit-tests/sunshcmd.mk
  head/contrib/bmake/unit-tests/ternary.mk
  head/contrib/bmake/unit-tests/unexport-env.mk
  head/contrib/bmake/unit-tests/unexport.mk
  head/contrib/bmake/unit-tests/var-class-local.exp
  head/contrib/bmake/unit-tests/var-class-local.mk
  head/contrib/bmake/unit-tests/var-op-append.exp
  head/contrib/bmake/unit-tests/var-op-append.mk
  head/contrib/bmake/unit-tests/var-op-assign.mk
  head/contrib/bmake/unit-tests/varcmd.mk
  head/contrib/bmake/unit-tests/vardebug.exp
  head/contrib/bmake/unit-tests/vardebug.mk
  head/contrib/bmake/unit-tests/varmisc.mk
  head/contrib/bmake/unit-tests/varmod-assign.exp
  head/contrib/bmake/unit-tests/varmod-assign.mk
  head/contrib/bmake/unit-tests/varmod-defined.mk
  head/contrib/bmake/unit-tests/varmod-edge.mk
  head/contrib/bmake/unit-tests/varmod-exclam-shell.mk
  head/contrib/bmake/unit-tests/varmod-gmtime.exp
  head/contrib/bmake/unit-tests/varmod-gmtime.mk
  head/contrib/bmake/unit-tests/varmod-hash.mk
  head/contrib/bmake/unit-tests/varmod-ifelse.exp
  head/contrib/bmake/unit-tests/varmod-ifelse.mk
  head/contrib/bmake/unit-tests/varmod-l-name-to-value.mk
  head/contrib/bmake/unit-tests/varmod-localtime.exp
  head/contrib/bmake/unit-tests/varmod-localtime.mk
  head/contrib/bmake/unit-tests/varmod-loop.exp
  head/contrib/bmake/unit-tests/varmod-loop.mk
  head/contrib/bmake/unit-tests/varmod-match-escape.exp
  head/contrib/bmake/unit-tests/varmod-match-escape.mk
  head/contrib/bmake/unit-tests/varmod-match.exp
  head/contrib/bmake/unit-tests/varmod-match.mk
  head/contrib/bmake/unit-tests/varmod-order-reverse.mk
  head/contrib/bmake/unit-tests/varmod-order-shuffle.mk
  head/contrib/bmake/unit-tests/varmod-order.mk
  head/contrib/bmake/unit-tests/varmod-quote.mk
  head/contrib/bmake/unit-tests/varmod-range.exp
  head/contrib/bmake/unit-tests/varmod-range.mk
  head/contrib/bmake/unit-tests/varmod-subst-regex.mk
  head/contrib/bmake/unit-tests/varmod-subst.mk
  head/contrib/bmake/unit-tests/varmod-sysv.exp
  head/contrib/bmake/unit-tests/varmod-sysv.mk
  head/contrib/bmake/unit-tests/varmod-to-lower.mk
  head/contrib/bmake/unit-tests/varmod-to-separator.exp
  head/contrib/bmake/unit-tests/varmod-to-separator.mk
  head/contrib/bmake/unit-tests/varmod-to-upper.mk
  head/contrib/bmake/unit-tests/varmod-undefined.mk
  head/contrib/bmake/unit-tests/varmod.exp
  head/contrib/bmake/unit-tests/varmod.mk
  head/contrib/bmake/unit-tests/varname-dot-curdir.mk
  head/contrib/bmake/unit-tests/varname-dot-includes.mk
  head/contrib/bmake/unit-tests/varname-dot-libs.mk
  head/contrib/bmake/unit-tests/varname-dot-newline.mk
  head/contrib/bmake/unit-tests/varname-dot-parsedir.exp
  head/contrib/bmake/unit-tests/varname-dot-parsedir.mk
  head/contrib/bmake/unit-tests/varname-dot-parsefile.exp
  head/contrib/bmake/unit-tests/varname-dot-parsefile.mk
  head/contrib/bmake/unit-tests/varname-dot-path.mk
  head/contrib/bmake/unit-tests/varname-dot-shell.exp
  head/contrib/bmake/unit-tests/varname-dot-shell.mk
  head/contrib/bmake/unit-tests/varname-empty.exp
  head/contrib/bmake/unit-tests/varname-empty.mk
  head/contrib/bmake/unit-tests/varname-make_print_var_on_error.exp
  head/contrib/bmake/unit-tests/varname-make_print_var_on_error.mk
  head/contrib/bmake/unit-tests/varname.mk
  head/contrib/bmake/unit-tests/varparse-dynamic.mk
  head/contrib/bmake/unit-tests/varshell.exp
  head/contrib/bmake/unit-tests/varshell.mk
  head/contrib/bmake/util.c
  head/contrib/bmake/var.c
  head/usr.bin/bmake/Makefile
  head/usr.bin/bmake/Makefile.config
  head/usr.bin/bmake/config.h
  head/usr.bin/bmake/unit-tests/Makefile
Directory Properties:
  head/contrib/bmake/   (props changed)

Modified: head/contrib/bmake/ChangeLog
==============================================================================
--- head/contrib/bmake/ChangeLog	Sat Nov  7 21:17:49 2020	(r367464)
+++ head/contrib/bmake/ChangeLog	Sat Nov  7 21:46:27 2020	(r367465)
@@ -1,3 +1,267 @@
+2020-11-01  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201101
+	Merge with NetBSD make, pick up
+	o negate NoExecute to GNode_ShouldExecute
+	o job.c: rename JobMatchShell to FindShellByName
+	extract EscapeShellDblQuot from JobPrintCommand
+	extract ParseRunOptions from JobPrintCommand
+	o var.c: extract ApplyModifiersIndirect from ApplyModifiers
+	treat malformed :range, :ts and :[...] as errors
+	add tests for the variable modifiers :[words] and :range
+
+2020-10-31  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201031
+	Merge with NetBSD make, pick up
+	o format #include directives consistently
+	o do not look up local variables like .TARGET anywhere else
+	o main.c: Main_SetObjdir is first called for curdir which may be
+	readonly
+	reduce the scope where recursive expressions are detected
+	remove redundant :tl from getBoolean
+	clean up mkTempFile
+	o meta.c: simplify memory allocation in meta_create and meta_oodate
+	o parse.c: extract loadedfile_mmap from loadfile
+	o trace.c: document possible undefined behavior with .CURDIR
+	o var.c: make parsing of the :gmtime and :localtime modifiers stricter
+	rename ismeta to is_shell_metachar
+	remove debug logging for the :Q variable modifier
+	rename VarIsDynamic to VarnameIsDynamic
+	use consistent parameter order in varname parsing functions
+	extract ParseVarnameLong from Var_Parse
+	extract ParseVarnameShort from Var_Parse
+	fix type of ParseModifierPart parameter delim
+	extract IsEscapedModifierPart from ParseModifierPart
+	clean up ModifyWords
+	add test for combining the :@ and :? variable modifiers
+	
+2020-10-30  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201030
+	Merge with NetBSD make, pick up
+	o change char * to void * in Var_Value
+	o make iterating over HashTable simpler
+	o rename VAR_CMD to VAR_CMDLINE
+	o cond.c: clean up is_separator
+	fix parse error in string literal in conditional
+	o main.c: do not use objdir that is not writable
+	in lint mode, exit with error status on errors
+	o  parse.c: clean up StrContainsWord
+	fix out-of-bounds pointer in ParseTrackInput
+	o var.c: rename Str_SYSVMatch and its parameters
+	remove unsatisfiable conditions in Var_Set_with_flags
+	document where the variable name is expanded
+	fix documentation for VARP_SUB_ONE
+	rename VAR_EXPORTED_YES to VAR_EXPORTED_SOME
+	document VAR_READONLY
+	prevent appending to read-only variables
+	extract MayExport from Var_Export1
+	remove redundant evaluations in VarFind
+	replace VarFindFlags with a simple Boolean
+	rename FIND_CMD to FIND_CMDLINE, to match VAR_CMDLINE
+
+2020-10-28  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201028
+	Merge with NetBSD make, pick up
+	o rename defIncPath to defSysIncPath
+	o initialize all CmdOpts fields
+	o lst.c: inline Vector_Get
+	o main.c: refactor main extract
+	InitMaxJobs,InitObjdir,InitVarMake,InitRandom,
+	ReadMakefiles,CleanUp,InitVpath,ReadBuiltinRules,
+	InitDefIncPath,CmdOpts_Init,UnlimitFiles
+	o parse.c: merge curFile into includes
+	rename predecessor to order_pred
+	sort ParseSpecial alphabetically
+	remove unused, undocumented .NOEXPORT
+	rename ParseSpecial enum values consistently
+	rename some fields of struct IFile
+
+2020-10-26  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201026
+	Merge with NetBSD make, pick up
+	o group the command line options and arguments into a struct
+	o rename GNode.cmgn to youngestChild
+	o rename hash functions to identify the type name
+	o negate OP_NOP and rename it to GNode_IsTarget
+	o add GNode_Path to access the path of a GNode
+	o remove macros MIN and MAX
+	o remove unused Lst_Find and Lst_FindFrom
+	o arch.c: and make Arch_FindLib simpler
+	clean up code layout
+	make Arch_ParseArchive simpler
+	o cond.c: inline CondFindStrMatch into FuncMake
+	o dir.c: replace Dir_CopyDir with Dir_CopyDirSearchPath
+	omit trailing space in debug output for expanding file patterns
+	refactor DirMatchFiles
+	document that the SearchPath of Dir_FindFile may be NULL
+	remove UNCONST from Dir_Expand
+	inline DirFindName
+	o for.c: clean up code for handling .for loops
+	o hash.c: print hash in debug log with fixed width
+	clean up hash table functions
+	reduce amount of string hashing
+	o job.c: refactor JobDeleteTarget
+	use proper enum constants for aborting
+	convert result of JobStart from macros to enum
+	convert abort reason macros to enum
+	rework Job_CheckCommands to reduce indentation
+	rename Shell fields
+	add field names in declaration of DEFSHELL_CUSTOM
+	convert JobState and JobFlags to enum types
+	move handling of the "..." command to JobPrintCommands
+	o lst.c: clean up
+	refactor LstNodeNew
+	remove Lst_Open, Lst_Next, Lst_Close
+	remove code for circular lists from Lst_Next
+	o main.c: do not attempt to read .MAKE.DEPENFILE if set to
+	/dev/null or anything starting with "no"
+	convert macros for debug flags into enum
+	o make.c: inline Lst_Copy in Make_ExpandUse
+	o meta.c: inline Lst_Find in meta_oodate
+	make Lst_RemoveIf simpler in meta_oodate
+	o parse.c: convert error level for Parse_Error to an enum
+	o suff.c: properly terminate debug output with newline
+	add more details to DEBUG_SRC log
+	replace Dir_CopyDir with Dir_CopyDirSearchPath
+	don't modify GNode name while rebuilding the suffix graph
+	o var.c: reduce duplicate code in VarFind
+	
+2020-10-22  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201022
+	Merge with NetBSD make, pick up
+	o more refactoring and simplification to reduce code size
+	o var.c: extract CanonicalVarname from VarFind
+	o make.c: extract UpdateImplicitParentsVars from Make_Update
+	o main.c: extract PrintVar from doPrintVars
+	extract HandlePWD from main
+	o lst.c: inline simple Lst getters
+	remove unused Lst_ForEach
+	o job.c: move struct Shell from job.h to job.c
+	o more unit tests
+
+2020-10-19  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* configure.in: remove inappropriate use of AC_INCLUDES_DEFAULT
+
+2020-10-18  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201018
+	Merge with NetBSD make, pick up
+	o remove USE_IOVEC
+	o rename some Hash_* apis to Hash*
+	o replace execError with execDie
+	o rename Lst_Init to Lst_New
+	o add tags to enum types
+	o rename Stack to Vector
+	o parse.c: more refactoring
+	o unit-tests: make some tests use line buffered stdout
+	o unit-tests/Makefile: in meta mode do not make all tests depend on
+	Makefile, it isn't necessary.
+
+2020-10-10  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* main.c: check for CTL_HW being defined.
+	* unit-tests/Makefile: ensure export tests output are POSIX compliant
+	disable opt-debug-jobs test until it works on ubuntu
+
+	* VERSION (_MAKE_VERSION): 20201010
+	Merge with NetBSD make, pick up
+	o dir.c: remove pathname limit for Dir_FindHereOrAbove
+	o hash.c: replace strcpy with memcpy in Hash_CreateEntry
+	o main.c: extract init_machine and init_machine_arch from main
+	allow to disable debug logging options
+	o parse.c: enable format string truncation warnings
+	extract parsing of sources from ParseDoDependency
+	split ParseDoSrc into smaller functions
+	hide implementation details from Parse_DoVar
+	clean up parsing of variable assignments
+	split Parse_DoVar into manageable pieces
+	don't modify the given line during Parse_DoVar
+	fix out-of-bounds memory access in Parse_DoVar
+	fix parsing of the :sh assignment modifier
+	o var.c: rework memory allocation for the name of variables
+	extract ApplyModifier_Literal into separate function
+	in lint mode, reject modifiers without delimiter
+	do not export variable names starting with '-'
+	o fix double-free bug in -DCLEANUP mode
+	o more cleanup to enable higher warnings level
+	o more unit tests
+
+2020-10-02  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201002
+	Merge with NetBSD make, pick up
+	o dir.c: use hash table for looking up open directories by name
+	o main.c: clean up option handling
+	o parse.c: add missing const for Parse_AddIncludeDir
+	o var.c: ApplyModifier_To, update pp in each branch
+	o remove redundant function prototypes
+	o more unit tests
+
+2020-10-01  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20201001
+	Merge with NetBSD make, pick up
+	o compat.c: comment about "..."
+
+2020-09-30  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20200930
+	Merge with NetBSD make, pick up
+	o job.c: split Job.jobPipe into 2 separate fields
+	replace Lst_Open with direct iteration
+	o lst.c: remove redundant assertions
+	o targ.c: replace Lst_Open with direct iteration
+	o var.c: fix bug in evaluation of indirect variable modifiers
+	extract ApplyModifier_Quote into separate function
+	o make debug logging simpler
+
+2020-09-27  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20200927
+	Merge with NetBSD make, pick up
+	o parse.c: ensure parse errors result in 'stopped in' message.
+	o compat.c: make parameter of Compat_RunCommand const
+	o main.c: extract InitVarTarget from main
+	o parse.c: rename ParseFinishLine to FinishDependencyGroup
+	refactor ParseDoDependency
+	o var.c: Var_Subst no longer returns string result
+	rename Var_ParsePP back to Var_Parse
+	in lint mode, improve error handling for undefined variables
+	extract ParseVarname from Var_Parse
+	o rename Lst_ForEach to Lst_ForEachUntil
+	o inline Lst_ForEachUntil in several cases
+	o clean up API for finding and creating GNodes
+	o fix assertion failure in -j mode with .END node
+	o inline and remove LstNode_Prev and LstNode_Next
+	o use fine-grained type names for lists and their nodes
+	o more unit tests
+
+2020-09-11  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* VERSION (_MAKE_VERSION): 20200911
+	Merge with NetBSD make, pick up
+	o cond.c: split EvalComparison into smaller functions
+	reorder parameters of condition parsing functions
+	reduce code size in CondParser_Eval
+	rename CondGetString to CondParser_String
+	add CondLexer_SkipWhitespace
+	group the condition parsing state into a struct
+	in CondGetString, replace repeated Buf_Add with Buf_AddStr
+	o migrate Var_Parse to Var_ParsePP
+	o add wrappers around ctype.h functions
+	o lst.c: use a stack instead of a list for the nested include path
+	o more unit tests
+
+2020-09-04  Simon J Gerraty  <sjg at beast.crufty.net>
+
+	* make-bootstrap.sh.in: adjust object list
+
 2020-09-02  Simon J Gerraty  <sjg at beast.crufty.net>
 
 	* VERSION (_MAKE_VERSION): 20200902

Modified: head/contrib/bmake/FILES
==============================================================================
--- head/contrib/bmake/FILES	Sat Nov  7 21:17:49 2020	(r367464)
+++ head/contrib/bmake/FILES	Sat Nov  7 21:46:27 2020	(r367465)
@@ -65,18 +65,16 @@ sigcompat.c
 str.c
 stresep.c
 strlcpy.c
-strlist.c
-strlist.h
 suff.c
 targ.c
 trace.c
 trace.h
 unit-tests/Makefile
 unit-tests/Makefile.config.in
-unit-tests/archive.exp
-unit-tests/archive.mk
 unit-tests/archive-suffix.exp
 unit-tests/archive-suffix.mk
+unit-tests/archive.exp
+unit-tests/archive.mk
 unit-tests/cmd-interrupt.exp
 unit-tests/cmd-interrupt.mk
 unit-tests/cmdline.exp
@@ -99,8 +97,8 @@ unit-tests/cond-cmp-numeric.exp
 unit-tests/cond-cmp-numeric.mk
 unit-tests/cond-cmp-string.exp
 unit-tests/cond-cmp-string.mk
-unit-tests/cond-func.exp
-unit-tests/cond-func.mk
+unit-tests/cond-cmp-unary.exp
+unit-tests/cond-cmp-unary.mk
 unit-tests/cond-func-commands.exp
 unit-tests/cond-func-commands.mk
 unit-tests/cond-func-defined.exp
@@ -113,6 +111,8 @@ unit-tests/cond-func-make.exp
 unit-tests/cond-func-make.mk
 unit-tests/cond-func-target.exp
 unit-tests/cond-func-target.mk
+unit-tests/cond-func.exp
+unit-tests/cond-func.mk
 unit-tests/cond-late.exp
 unit-tests/cond-late.mk
 unit-tests/cond-op-and.exp
@@ -135,26 +135,36 @@ unit-tests/cond-token-string.exp
 unit-tests/cond-token-string.mk
 unit-tests/cond-token-var.exp
 unit-tests/cond-token-var.mk
+unit-tests/cond-undef-lint.exp
+unit-tests/cond-undef-lint.mk
 unit-tests/cond1.exp
 unit-tests/cond1.mk
-unit-tests/cond2.exp
-unit-tests/cond2.mk
+unit-tests/counter-append.exp
+unit-tests/counter-append.mk
 unit-tests/counter.exp
 unit-tests/counter.mk
+unit-tests/dep-colon-bug-cross-file.exp
+unit-tests/dep-colon-bug-cross-file.mk
 unit-tests/dep-colon.exp
 unit-tests/dep-colon.mk
+unit-tests/dep-double-colon-indep.exp
+unit-tests/dep-double-colon-indep.mk
 unit-tests/dep-double-colon.exp
 unit-tests/dep-double-colon.mk
 unit-tests/dep-exclam.exp
 unit-tests/dep-exclam.mk
 unit-tests/dep-none.exp
 unit-tests/dep-none.mk
+unit-tests/dep-percent.exp
+unit-tests/dep-percent.mk
 unit-tests/dep-var.exp
 unit-tests/dep-var.mk
 unit-tests/dep-wildcards.exp
 unit-tests/dep-wildcards.mk
 unit-tests/dep.exp
 unit-tests/dep.mk
+unit-tests/depsrc-end.exp
+unit-tests/depsrc-end.mk
 unit-tests/depsrc-exec.exp
 unit-tests/depsrc-exec.mk
 unit-tests/depsrc-ignore.exp
@@ -185,10 +195,10 @@ unit-tests/depsrc-silent.exp
 unit-tests/depsrc-silent.mk
 unit-tests/depsrc-use.exp
 unit-tests/depsrc-use.mk
-unit-tests/depsrc-usebefore.exp
-unit-tests/depsrc-usebefore.mk
 unit-tests/depsrc-usebefore-double-colon.exp
 unit-tests/depsrc-usebefore-double-colon.mk
+unit-tests/depsrc-usebefore.exp
+unit-tests/depsrc-usebefore.mk
 unit-tests/depsrc-wait.exp
 unit-tests/depsrc-wait.mk
 unit-tests/depsrc.exp
@@ -199,6 +209,8 @@ unit-tests/deptgt-default.exp
 unit-tests/deptgt-default.mk
 unit-tests/deptgt-delete_on_error.exp
 unit-tests/deptgt-delete_on_error.mk
+unit-tests/deptgt-end-jobs.exp
+unit-tests/deptgt-end-jobs.mk
 unit-tests/deptgt-end.exp
 unit-tests/deptgt-end.mk
 unit-tests/deptgt-error.exp
@@ -239,10 +251,12 @@ unit-tests/deptgt-suffixes.exp
 unit-tests/deptgt-suffixes.mk
 unit-tests/deptgt.exp
 unit-tests/deptgt.mk
-unit-tests/dir.exp
-unit-tests/dir.mk
 unit-tests/dir-expand-path.exp
 unit-tests/dir-expand-path.mk
+unit-tests/dir.exp
+unit-tests/dir.mk
+unit-tests/directive-dinclude.exp
+unit-tests/directive-dinclude.mk
 unit-tests/directive-elif.exp
 unit-tests/directive-elif.mk
 unit-tests/directive-elifdef.exp
@@ -261,14 +275,18 @@ unit-tests/directive-error.exp
 unit-tests/directive-error.mk
 unit-tests/directive-export-env.exp
 unit-tests/directive-export-env.mk
+unit-tests/directive-export-gmake.exp
+unit-tests/directive-export-gmake.mk
 unit-tests/directive-export-literal.exp
 unit-tests/directive-export-literal.mk
 unit-tests/directive-export.exp
 unit-tests/directive-export.mk
-unit-tests/directive-for.exp
-unit-tests/directive-for.mk
 unit-tests/directive-for-generating-endif.exp
 unit-tests/directive-for-generating-endif.mk
+unit-tests/directive-for.exp
+unit-tests/directive-for.mk
+unit-tests/directive-hyphen-include.exp
+unit-tests/directive-hyphen-include.mk
 unit-tests/directive-if.exp
 unit-tests/directive-if.mk
 unit-tests/directive-ifdef.exp
@@ -279,8 +297,14 @@ unit-tests/directive-ifndef.exp
 unit-tests/directive-ifndef.mk
 unit-tests/directive-ifnmake.exp
 unit-tests/directive-ifnmake.mk
+unit-tests/directive-include-fatal.exp
+unit-tests/directive-include-fatal.mk
+unit-tests/directive-include.exp
+unit-tests/directive-include.mk
 unit-tests/directive-info.exp
 unit-tests/directive-info.mk
+unit-tests/directive-sinclude.exp
+unit-tests/directive-sinclude.mk
 unit-tests/directive-undef.exp
 unit-tests/directive-undef.mk
 unit-tests/directive-unexport-env.exp
@@ -317,20 +341,20 @@ unit-tests/forloop.exp
 unit-tests/forloop.mk
 unit-tests/forsubst.exp
 unit-tests/forsubst.mk
-unit-tests/hash.exp
-unit-tests/hash.mk
+unit-tests/hanoi-include.exp
+unit-tests/hanoi-include.mk
 unit-tests/impsrc.exp
 unit-tests/impsrc.mk
 unit-tests/include-main.exp
 unit-tests/include-main.mk
 unit-tests/include-sub.mk
 unit-tests/include-subsub.mk
+unit-tests/job-output-long-lines.exp
+unit-tests/job-output-long-lines.mk
 unit-tests/lint.exp
 unit-tests/lint.mk
 unit-tests/make-exported.exp
 unit-tests/make-exported.mk
-unit-tests/misc.exp
-unit-tests/misc.mk
 unit-tests/moderrs.exp
 unit-tests/moderrs.mk
 unit-tests/modmatch.exp
@@ -345,10 +369,56 @@ unit-tests/opt-backwards.exp
 unit-tests/opt-backwards.mk
 unit-tests/opt-chdir.exp
 unit-tests/opt-chdir.mk
+unit-tests/opt-debug-all.exp
+unit-tests/opt-debug-all.mk
+unit-tests/opt-debug-archive.exp
+unit-tests/opt-debug-archive.mk
+unit-tests/opt-debug-cond.exp
+unit-tests/opt-debug-cond.mk
+unit-tests/opt-debug-curdir.exp
+unit-tests/opt-debug-curdir.mk
+unit-tests/opt-debug-dir.exp
+unit-tests/opt-debug-dir.mk
+unit-tests/opt-debug-errors.exp
+unit-tests/opt-debug-errors.mk
+unit-tests/opt-debug-file.exp
+unit-tests/opt-debug-file.mk
+unit-tests/opt-debug-for.exp
+unit-tests/opt-debug-for.mk
+unit-tests/opt-debug-graph1.exp
+unit-tests/opt-debug-graph1.mk
+unit-tests/opt-debug-graph2.exp
+unit-tests/opt-debug-graph2.mk
+unit-tests/opt-debug-graph3.exp
+unit-tests/opt-debug-graph3.mk
+unit-tests/opt-debug-hash.exp
+unit-tests/opt-debug-hash.mk
+unit-tests/opt-debug-jobs.exp
+unit-tests/opt-debug-jobs.mk
+unit-tests/opt-debug-lint.exp
+unit-tests/opt-debug-lint.mk
+unit-tests/opt-debug-loud.exp
+unit-tests/opt-debug-loud.mk
+unit-tests/opt-debug-making.exp
+unit-tests/opt-debug-making.mk
+unit-tests/opt-debug-meta.exp
+unit-tests/opt-debug-meta.mk
+unit-tests/opt-debug-no-rm.exp
+unit-tests/opt-debug-no-rm.mk
+unit-tests/opt-debug-parse.exp
+unit-tests/opt-debug-parse.mk
+unit-tests/opt-debug-suff.exp
+unit-tests/opt-debug-suff.mk
+unit-tests/opt-debug-targets.exp
+unit-tests/opt-debug-targets.mk
+unit-tests/opt-debug-var.exp
+unit-tests/opt-debug-var.mk
+unit-tests/opt-debug-varraw.exp
+unit-tests/opt-debug-varraw.mk
+unit-tests/opt-debug-x-trace.exp
+unit-tests/opt-debug-x-trace.mk
 unit-tests/opt-debug.exp
 unit-tests/opt-debug.mk
-unit-tests/opt-debug-g1.exp
-unit-tests/opt-debug-g1.mk
 unit-tests/opt-define.exp
 unit-tests/opt-define.mk
 unit-tests/opt-env.exp
@@ -395,6 +465,8 @@ unit-tests/opt.exp
 unit-tests/opt.mk
 unit-tests/order.exp
 unit-tests/order.mk
+unit-tests/parse-var.exp
+unit-tests/parse-var.mk
 unit-tests/phony-end.exp
 unit-tests/phony-end.mk
 unit-tests/posix.exp
@@ -425,12 +497,34 @@ unit-tests/sh-single-line.exp
 unit-tests/sh-single-line.mk
 unit-tests/sh.exp
 unit-tests/sh.mk
-unit-tests/suffixes.exp
-unit-tests/suffixes.mk
+unit-tests/shell-csh.exp
+unit-tests/shell-csh.mk
+unit-tests/shell-custom.exp
+unit-tests/shell-custom.mk
+unit-tests/shell-ksh.exp
+unit-tests/shell-ksh.mk
+unit-tests/shell-sh.exp
+unit-tests/shell-sh.mk
+unit-tests/suff-add-later.exp
+unit-tests/suff-add-later.mk
+unit-tests/suff-clear-regular.exp
+unit-tests/suff-clear-regular.mk
+unit-tests/suff-clear-single.exp
+unit-tests/suff-clear-single.mk
+unit-tests/suff-lookup.exp
+unit-tests/suff-lookup.mk
+unit-tests/suff-main.exp
+unit-tests/suff-main.mk
+unit-tests/suff-rebuild.exp
+unit-tests/suff-rebuild.mk
+unit-tests/suff-transform-endless.exp
+unit-tests/suff-transform-endless.mk
+unit-tests/suff-transform-expand.exp
+unit-tests/suff-transform-expand.mk
+unit-tests/suff-transform-select.exp
+unit-tests/suff-transform-select.mk
 unit-tests/sunshcmd.exp
 unit-tests/sunshcmd.mk
-unit-tests/sysv.exp
-unit-tests/sysv.mk
 unit-tests/ternary.exp
 unit-tests/ternary.mk
 unit-tests/unexport-env.exp
@@ -461,8 +555,12 @@ unit-tests/var-op-expand.exp
 unit-tests/var-op-expand.mk
 unit-tests/var-op-shell.exp
 unit-tests/var-op-shell.mk
+unit-tests/var-op-sunsh.exp
+unit-tests/var-op-sunsh.mk
 unit-tests/var-op.exp
 unit-tests/var-op.mk
+unit-tests/var-recursive.exp
+unit-tests/var-recursive.mk
 unit-tests/varcmd.exp
 unit-tests/varcmd.mk
 unit-tests/vardebug.exp
@@ -555,12 +653,12 @@ unit-tests/varname-dot-alltargets.exp
 unit-tests/varname-dot-alltargets.mk
 unit-tests/varname-dot-curdir.exp
 unit-tests/varname-dot-curdir.mk
-unit-tests/varname-dot-includes.exp
-unit-tests/varname-dot-includes.mk
 unit-tests/varname-dot-includedfromdir.exp
 unit-tests/varname-dot-includedfromdir.mk
 unit-tests/varname-dot-includedfromfile.exp
 unit-tests/varname-dot-includedfromfile.mk
+unit-tests/varname-dot-includes.exp
+unit-tests/varname-dot-includes.mk
 unit-tests/varname-dot-libs.exp
 unit-tests/varname-dot-libs.mk
 unit-tests/varname-dot-make-dependfile.exp
@@ -623,8 +721,12 @@ unit-tests/varname-empty.exp
 unit-tests/varname-empty.mk
 unit-tests/varname-make.exp
 unit-tests/varname-make.mk
+unit-tests/varname-make_print_var_on_error-jobs.exp
+unit-tests/varname-make_print_var_on_error-jobs.mk
 unit-tests/varname-make_print_var_on_error.exp
 unit-tests/varname-make_print_var_on_error.mk
+unit-tests/varname-makefile.exp
+unit-tests/varname-makefile.mk
 unit-tests/varname-makeflags.exp
 unit-tests/varname-makeflags.mk
 unit-tests/varname-pwd.exp
@@ -635,6 +737,10 @@ unit-tests/varname.exp
 unit-tests/varname.mk
 unit-tests/varparse-dynamic.exp
 unit-tests/varparse-dynamic.mk
+unit-tests/varparse-mod.exp
+unit-tests/varparse-mod.mk
+unit-tests/varparse-undef-partial.exp
+unit-tests/varparse-undef-partial.mk
 unit-tests/varquote.exp
 unit-tests/varquote.mk
 unit-tests/varshell.exp

Modified: head/contrib/bmake/Makefile
==============================================================================
--- head/contrib/bmake/Makefile	Sat Nov  7 21:17:49 2020	(r367464)
+++ head/contrib/bmake/Makefile	Sat Nov  7 21:46:27 2020	(r367465)
@@ -1,4 +1,4 @@
-#	$Id: Makefile,v 1.112 2020/08/28 16:26:17 sjg Exp $
+#	$Id: Makefile,v 1.113 2020/10/26 17:55:09 sjg Exp $
 
 PROG=	bmake
 
@@ -20,7 +20,6 @@ SRCS= \
 	metachar.c \
 	parse.c \
 	str.c \
-	strlist.c \
 	suff.c \
 	targ.c \
 	trace.c \

Modified: head/contrib/bmake/VERSION
==============================================================================
--- head/contrib/bmake/VERSION	Sat Nov  7 21:17:49 2020	(r367464)
+++ head/contrib/bmake/VERSION	Sat Nov  7 21:46:27 2020	(r367465)
@@ -1,2 +1,2 @@
 # keep this compatible with sh and make
-_MAKE_VERSION=20200902
+_MAKE_VERSION=20201101

Modified: head/contrib/bmake/arch.c
==============================================================================
--- head/contrib/bmake/arch.c	Sat Nov  7 21:17:49 2020	(r367464)
+++ head/contrib/bmake/arch.c	Sat Nov  7 21:46:27 2020	(r367465)
@@ -1,4 +1,4 @@
-/*	$NetBSD: arch.c,v 1.107 2020/08/30 11:15:05 rillig Exp $	*/
+/*	$NetBSD: arch.c,v 1.151 2020/10/31 18:41:07 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -68,19 +68,6 @@
  * SUCH DAMAGE.
  */
 
-#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.107 2020/08/30 11:15:05 rillig Exp $";
-#else
-#include <sys/cdefs.h>
-#ifndef lint
-#if 0
-static char sccsid[] = "@(#)arch.c	8.2 (Berkeley) 1/2/94";
-#else
-__RCSID("$NetBSD: arch.c,v 1.107 2020/08/30 11:15:05 rillig Exp $");
-#endif
-#endif /* not lint */
-#endif
-
 /*-
  * arch.c --
  *	Functions to manipulate libraries, archives and their members.
@@ -92,52 +79,53 @@ __RCSID("$NetBSD: arch.c,v 1.107 2020/08/30 11:15:05 r
  * is referenced.
  *
  * The interface to this module is:
- *	Arch_ParseArchive   	Given an archive specification, return a list
- *	    	  	    	of GNode's, one for each member in the spec.
- *	    	  	    	FALSE is returned if the specification is
- *	    	  	    	invalid for some reason.
+ *	Arch_ParseArchive
+ *			Given an archive specification, return a list
+ *			of GNode's, one for each member in the spec.
+ *			FALSE is returned if the specification is
+ *			invalid for some reason.
  *
- *	Arch_Touch	    	Alter the modification time of the archive
- *	    	  	    	member described by the given node to be
- *	    	  	    	the current time.
+ *	Arch_Touch	Alter the modification time of the archive
+ *			member described by the given node to be
+ *			the current time.
  *
- *	Arch_TouchLib	    	Update the modification time of the library
- *	    	  	    	described by the given node. This is special
- *	    	  	    	because it also updates the modification time
- *	    	  	    	of the library's table of contents.
+ *	Arch_TouchLib	Update the modification time of the library
+ *			described by the given node. This is special
+ *			because it also updates the modification time
+ *			of the library's table of contents.
  *
- *	Arch_MTime	    	Find the modification time of a member of
- *	    	  	    	an archive *in the archive*. The time is also
- *	    	  	    	placed in the member's GNode. Returns the
- *	    	  	    	modification time.
+ *	Arch_MTime	Find the modification time of a member of
+ *			an archive *in the archive*. The time is also
+ *			placed in the member's GNode. Returns the
+ *			modification time.
  *
- *	Arch_MemTime	    	Find the modification time of a member of
- *	    	  	    	an archive. Called when the member doesn't
- *	    	  	    	already exist. Looks in the archive for the
- *	    	  	    	modification time. Returns the modification
- *	    	  	    	time.
+ *	Arch_MemTime	Find the modification time of a member of
+ *			an archive. Called when the member doesn't
+ *			already exist. Looks in the archive for the
+ *			modification time. Returns the modification
+ *			time.
  *
- *	Arch_FindLib	    	Search for a library along a path. The
- *	    	  	    	library name in the GNode should be in
- *	    	  	    	-l<name> format.
+ *	Arch_FindLib	Search for a library along a path. The
+ *			library name in the GNode should be in
+ *			-l<name> format.
  *
- *	Arch_LibOODate	    	Special function to decide if a library node
- *	    	  	    	is out-of-date.
+ *	Arch_LibOODate	Special function to decide if a library node
+ *			is out-of-date.
  *
- *	Arch_Init 	    	Initialize this module.
+ *	Arch_Init	Initialize this module.
  *
- *	Arch_End 	    	Cleanup this module.
+ *	Arch_End	Clean up this module.
  */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
-#include    <sys/types.h>
-#include    <sys/stat.h>
-#include    <sys/time.h>
-#include    <sys/param.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/param.h>
 #ifdef HAVE_AR_H
-#include    <ar.h>
+#include <ar.h>
 #else
 struct ar_hdr {
         char ar_name[16];               /* name */
@@ -153,18 +141,18 @@ struct ar_hdr {
 };
 #endif
 #if defined(HAVE_RANLIB_H) && !(defined(__ELF__) || defined(NO_RANLIB))
-#include    <ranlib.h>
+#include <ranlib.h>
 #endif
-#include    <stdio.h>
-#include    <stdlib.h>
 #ifdef HAVE_UTIME_H
-#include    <utime.h>
+#include <utime.h>
 #endif
 
-#include    "make.h"
-#include    "hash.h"
-#include    "dir.h"
+#include "make.h"
+#include "dir.h"
 
+/*	"@(#)arch.c	8.2 (Berkeley) 1/2/94"	*/
+MAKE_RCSID("$NetBSD: arch.c,v 1.151 2020/10/31 18:41:07 rillig Exp $");
+
 #ifdef TARGET_MACHINE
 #undef MAKE_MACHINE
 #define MAKE_MACHINE TARGET_MACHINE
@@ -174,17 +162,19 @@ struct ar_hdr {
 #define MAKE_MACHINE_ARCH TARGET_MACHINE_ARCH
 #endif
 
-static Lst	  archives;   /* Lst of archives we've already examined */
+typedef struct List ArchList;
+typedef struct ListNode ArchListNode;
 
+static ArchList *archives;	/* The archives we've already examined */
+
 typedef struct Arch {
-    char	  *name;      /* Name of archive */
-    Hash_Table	  members;    /* All the members of the archive described
-			       * by <name, struct ar_hdr *> key/value pairs */
-    char	  *fnametab;  /* Extended name table strings */
-    size_t	  fnamesize;  /* Size of the string table */
+    char *name;			/* Name of archive */
+    HashTable members;		/* All the members of the archive described
+				 * by <name, struct ar_hdr *> key/value pairs */
+    char *fnametab;		/* Extended name table strings */
+    size_t fnamesize;		/* Size of the string table */
 } Arch;
 
-static struct ar_hdr *ArchStatMember(const char *, const char *, Boolean);
 static FILE *ArchFindMember(const char *, const char *,
 			    struct ar_hdr *, const char *);
 #if defined(__svr4__) || defined(__SVR4) || defined(__ELF__)
@@ -219,25 +209,22 @@ static int ArchSVR4Entry(Arch *, char *, size_t, FILE 
 # define SARMAG	8
 #endif
 
-#define AR_MAX_NAME_LEN	    (sizeof(arh.AR_NAME)-1)
 
 #ifdef CLEANUP
 static void
 ArchFree(void *ap)
 {
-    Arch *a = (Arch *)ap;
-    Hash_Search	  search;
-    Hash_Entry	  *entry;
+    Arch *a = ap;
+    HashIter hi;
 
     /* Free memory from hash entries */
-    for (entry = Hash_EnumFirst(&a->members, &search);
-	 entry != NULL;
-	 entry = Hash_EnumNext(&search))
-	free(Hash_GetValue(entry));
+    HashIter_Init(&hi, &a->members);
+    while (HashIter_Next(&hi) != NULL)
+	free(hi.entry->value);
 
     free(a->name);
     free(a->fnametab);
-    Hash_DeleteTable(&a->members);
+    HashTable_Done(&a->members);
     free(a);
 }
 #endif
@@ -262,46 +249,49 @@ ArchFree(void *ap)
  *-----------------------------------------------------------------------
  */
 Boolean
-Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *ctxt)
+Arch_ParseArchive(char **linePtr, GNodeList *nodeLst, GNode *ctxt)
 {
-    char	    *cp;	    /* Pointer into line */
-    GNode	    *gn;     	    /* New node */
-    char	    *libName;  	    /* Library-part of specification */
-    char	    *memName;  	    /* Member-part of specification */
-    char	    saveChar;  	    /* Ending delimiter of member-name */
-    Boolean 	    subLibName;	    /* TRUE if libName should have/had
-				     * variable substitution performed on it */
+    char *cp;			/* Pointer into line */
+    GNode *gn;			/* New node */
+    char *libName;		/* Library-part of specification */
+    char *memName;		/* Member-part of specification */
+    char saveChar;		/* Ending delimiter of member-name */
+    Boolean subLibName;		/* TRUE if libName should have/had
+				 * variable substitution performed on it */
 
     libName = *linePtr;
 
     subLibName = FALSE;
 
-    for (cp = libName; *cp != '(' && *cp != '\0'; cp++) {
+    for (cp = libName; *cp != '(' && *cp != '\0';) {
 	if (*cp == '$') {
 	    /*
 	     * Variable spec, so call the Var module to parse the puppy
 	     * so we can safely advance beyond it...
 	     */
-	    int 	length;
-	    void	*result_freeIt;
-	    const char	*result;
+	    const char *nested_p = cp;
+	    void *result_freeIt;
+	    const char *result;
 	    Boolean isError;
 
-	    result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
-			       &length, &result_freeIt);
+	    (void)Var_Parse(&nested_p, ctxt, VARE_UNDEFERR|VARE_WANTRES,
+			    &result, &result_freeIt);
+	    /* TODO: handle errors */
 	    isError = result == var_Error;
 	    free(result_freeIt);
 	    if (isError)
 		return FALSE;
 
 	    subLibName = TRUE;
-	    cp += length - 1;
-	}
+	    cp += nested_p - cp;
+	} else
+	    cp++;
     }
 
     *cp++ = '\0';
     if (subLibName) {
-	libName = Var_Subst(libName, ctxt, VARE_UNDEFERR|VARE_WANTRES);
+	(void)Var_Subst(libName, ctxt, VARE_UNDEFERR|VARE_WANTRES, &libName);
+	/* TODO: handle errors */
     }
 
 
@@ -311,25 +301,25 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *
 	 * place and skip to the end of it (either white-space or
 	 * a close paren).
 	 */
-	Boolean	doSubst = FALSE; /* TRUE if need to substitute in memName */
+	Boolean doSubst = FALSE; /* TRUE if need to substitute in memName */
 
-	while (*cp != '\0' && *cp != ')' && isspace ((unsigned char)*cp)) {
-	    cp++;
-	}
+	pp_skip_whitespace(&cp);
+
 	memName = cp;
-	while (*cp != '\0' && *cp != ')' && !isspace ((unsigned char)*cp)) {
+	while (*cp != '\0' && *cp != ')' && !ch_isspace(*cp)) {
 	    if (*cp == '$') {
 		/*
 		 * Variable spec, so call the Var module to parse the puppy
 		 * so we can safely advance beyond it...
 		 */
-		int 	length;
-		void	*freeIt;
+		void *freeIt;
 		const char *result;
 		Boolean isError;
+		const char *nested_p = cp;
 
-		result = Var_Parse(cp, ctxt, VARE_UNDEFERR|VARE_WANTRES,
-				   &length, &freeIt);
+		(void)Var_Parse(&nested_p, ctxt, VARE_UNDEFERR|VARE_WANTRES,
+				&result, &freeIt);
+		/* TODO: handle errors */
 		isError = result == var_Error;
 		free(freeIt);
 
@@ -337,7 +327,7 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *
 		    return FALSE;
 
 		doSubst = TRUE;
-		cp += length;
+		cp += nested_p - cp;
 	    } else {
 		cp++;
 	    }
@@ -376,11 +366,13 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *
 	 * later.
 	 */
 	if (doSubst) {
-	    char    *buf;
-	    char    *sacrifice;
-	    char    *oldMemName = memName;
+	    char *buf;
+	    char *sacrifice;
+	    char *oldMemName = memName;
 
-	    memName = Var_Subst(memName, ctxt, VARE_UNDEFERR | VARE_WANTRES);
+	    (void)Var_Subst(memName, ctxt, VARE_UNDEFERR|VARE_WANTRES,
+			    &memName);
+	    /* TODO: handle errors */
 
 	    /*
 	     * Now form an archive spec and recurse to deal with nested
@@ -395,85 +387,48 @@ Arch_ParseArchive(char **linePtr, Lst nodeLst, GNode *
 		 * Just create an ARCHV node for the thing and let
 		 * SuffExpandChildren handle it...
 		 */
-		gn = Targ_FindNode(buf, TARG_CREATE);
+		gn = Targ_GetNode(buf);
+		gn->type |= OP_ARCHV;
+		Lst_Append(nodeLst, gn);
 
-		if (gn == NULL) {
-		    free(buf);
-		    return FALSE;
-		} else {
-		    gn->type |= OP_ARCHV;
-		    Lst_Append(nodeLst, gn);
-		}
 	    } else if (!Arch_ParseArchive(&sacrifice, nodeLst, ctxt)) {
-		/*
-		 * Error in nested call -- free buffer and return FALSE
-		 * ourselves.
-		 */
+		/* Error in nested call. */
 		free(buf);
 		return FALSE;
 	    }
-	    /*
-	     * Free buffer and continue with our work.
-	     */
 	    free(buf);
-	} else if (Dir_HasWildcards(memName)) {
-	    Lst members = Lst_Init();
-	    Buffer nameBuf;
 
-	    Buf_Init(&nameBuf, 0);
+	} else if (Dir_HasWildcards(memName)) {
+	    StringList *members = Lst_New();
 	    Dir_Expand(memName, dirSearchPath, members);
+
 	    while (!Lst_IsEmpty(members)) {
 		char *member = Lst_Dequeue(members);
-

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-all mailing list