Commit Graph

651 Commits

Author SHA1 Message Date
Timothy Sample 95545c9269 Fix building from an external directory.
* Makefile.am (scripts/gash): Make sure the 'scripts' directory exists
in the build tree.
(SH_LOG_COMPILER): Call 'test.sh' from the source tree.
* test.sh: Change the default test shell from 'scripts/gash' to
'gash'; export a 'TEST_TMP' variable that tells tests where to store
temporary files; and make sure all output is written to the build
directory.
tests/50-redirect-append.sh: Use the 'TEST_TMP' variable.
tests/60-subst.sh: Ditto.
2019-05-20 18:07:47 -04:00
Timothy Sample d257dac0c6 Rewrite README.
* README: Rewrite with more information.
2019-05-20 18:07:47 -04:00
Timothy Sample 38c832a8e2 Add missing copyright headers.
* gash/pattern.scm,
gash/shell.scm,
tests/bootstrap/bash-without-bash.scm,
tests/spec/oil.scm,
tests/unit/config.scm.in: Add missing copyright header.
2019-05-20 18:07:47 -04:00
Timothy Sample 8998143286 Add missing '!' to 'pre-inst-env' shebang.
* build-aux/pre-inst-env.in: Add missing '!' to shebang.
2019-05-20 18:07:47 -04:00
Timothy Sample 3d80f05940 Fix readline-related compiler warnings.
* gash/gash.scm: Use the readline module at expansion time too, so
that the compiler can see it.
2019-05-20 18:07:47 -04:00
Timothy Sample e86623b642 Clean up version text.
* gash/gash.scm (display-version): Clean up output.
2019-05-20 18:07:47 -04:00
Timothy Sample 669c414116 Prefer 'if-guile-version-below' to 'cond-expand'.
* gash/compat.scm: Use 'if-guile-version-below' over 'cond-expand'.
* gash/compat/textual-ports.scm: Ditto.
2019-05-20 18:07:47 -04:00
Timothy Sample 2d46b8b43e Move 'setvbuf' shim to '(gash compat)'.
* tests/unit/shell.scm: Mode 'setvbuf' shim...
* gash/compat.scm: ...here.
2019-05-20 18:07:47 -04:00
Timothy Sample 2d19d82444 Make the bootstrap test more realistic.
Instead of building regular Bash using regular Gash, we now build
minimal Bash using the bootstrap build inputs, with bootstrap Bash
replaced by bootstrap Gash.

* tests/bootstrap/bash-without-bash.scm (gash-with-links): Rename this...
(%bootstrap-gash): ...to this, and use nothing but the bootstrap Guile
to build and run it.
(%bootstrap-coreutils&co-without-bash): New variable.
(%bootstrap-coreutils&co?): New function.
(%boot0-inputs): New variable.
2019-05-20 18:07:47 -04:00
Timothy Sample 0c57fc9ef9 Move 'textual-ports' under 'compat'.
* gash/textual-ports.scm: Move this...
* gash/compat/textual-ports.scm: ...here.
* Makefile.am, gash/lexer.scm, gash/parser.scm, gash/shell.scm,
tests/unit/shell.scm: Update references.
2019-05-20 18:07:47 -04:00
Timothy Sample 878b9c3dca Add support for Guile 2.0.9.
* gash/compat.scm: New file.
* gash/compat/hash-table.scm: New file.
* Makefile.am: Add them.
* .dir-locals.scm: Add indentation for 'if-guile-version-below'.
* guix.scm (guile-2.0.9): New variable.
* gash/built-ins/echo.scm (escape->control): Use '#\esc'.
* gash/environment.scm: Use '(gash compat hash-table)'.
* gash/built-ins/break.scm,
gash/built-ins/cd.scm,
gash/built-ins/command.scm,
gash/built-ins/continue.scm,
gash/built-ins/dot.scm,
gash/built-ins/exec.scm,
gash/built-ins/exit.scm,
gash/built-ins/pwd.scm,
gash/built-ins/return.scm,
gash/built-ins/set.scm,
gash/built-ins/shift.scm,
gash/built-ins/trap.scm,
gash/built-ins/type.scm,
gash/built-ins/umask.scm,
gash/eval.scm,
tests/unit/automake.scm: Use '(gash compat)'.

squash! Add support for Guile 2.0.9.
2019-05-20 18:07:47 -04:00
Timothy Sample 3f745ae39e Turn off auto-compile while compiling.
This prevents Guile from complaining when compiling the project from
within the Guix build environment.

* build-aux/guile-rules.am: Set 'GUILE_AUTO_COMPILE' to '0' when
compiling.
2019-05-20 18:07:47 -04:00
Timothy Sample 7e65eae774 Remove extra shells from the spec tests.
* tests/spec/oil.scm: Patch out all reference shells from the test
suite expect for Bash.
2019-05-20 18:07:47 -04:00
Timothy Sample c61b1d6fef Make the Guix package work without Git.
This commit generates a '.tarball-manifest' file that gets placed in
the distribution tarball and simply lists all the files that are in
the Git tree.  It is used to determine which files should be
considered source files when building the package using Guix.

* guix.scm (make-select): Fall back on reading from
'.tarball-manifest' if a Git repository is not available.
2019-05-20 18:07:47 -04:00
Timothy Sample 511dae3577 Add missing files to the distribution tarball.
* Makefile.am (EXTRA_DIST): Add various scripts, metadata, helpful
files, and tests.
2019-05-20 18:07:47 -04:00
Timothy Sample fcf32d1cad Setup documentation generation.
* Makefile.am (info_TEXINFOS, gash_TEXINFOS): New targets.
* guix.scm: Add 'texinfo' to build inputs.
* doc/gash.info: Delete file.
* .gitignore: Ignore generated documentation files.
2019-05-20 18:07:47 -04:00
Timothy Sample 6283a632ba Fix test data filename.
* tests/for-done-subshell.stdout: Rename this...
* tests/11-for-done-subshell.stdout: ...to this.
2019-05-20 18:07:47 -04:00
Timothy Sample 2e51c3f9ab Add missing tests to the Makefile.
* Makefile.am (FULL_TESTS): Add tests/05-assignment-backtick.sh,
tests/10-if-line.sh, tests/10-if-redirect.sh, and
tests/20-pipe-sed-cat.sh.
2019-05-20 18:07:47 -04:00
Timothy Sample 6383159503 Remove the bootstrap phase from the Guix package.
This phase has been part of the upstream build system for a while now.

* guix.scm: Remove bootstrap phase.
2019-05-20 18:07:47 -04:00
Timothy Sample 536319194f Delete unused test data.
* tests/data/basename.sed,
tests/data/fooRbar,
tests/data/ro.tar: Delete files.
2019-05-20 18:07:47 -04:00
Timothy Sample ea7266e8f1 Add missing '.PHONY' indicator to Makefile.
* Makefile.am (test-list): Mark as phony.
2019-05-20 18:07:32 -04:00
Timothy Sample 0f6eb40f44 Reorder Makefile and add section comments.
* Makefile.am: Reorder rules and add section header comments to
make the structure clear.
2019-05-20 01:18:54 -04:00
Timothy Sample 315815bbd6 Factor out and update the usual Guile rules.
* build-aux/guile-rules.am: New file.
* .gitignore: Do not ignore it.
* Makefile.am: Include it, remove the rules it replaces, update
changed variable names, and use appending for 'EXTRA_DIST' and
'CLEANFILES'.
2019-05-20 01:18:54 -04:00
Timothy Sample 7e3dd750b1 Remove 'foreign' Automake option.
* configure.ac (AM_INIT_AUTOMAKE): Remove 'foreign' option.
2019-05-20 01:18:54 -04:00
Timothy Sample c2d647a04f Add a NEWS file.
* NEWS: New file.
2019-05-20 01:18:54 -04:00
Timothy Sample 28093b843e Clean up '.dir-locals.el'.
* .dir-locals.el: Change indentation, and make sure that tabs are used
when editing Makefiles.
2019-05-20 01:18:54 -04:00
Timothy Sample 7c1c3ad5c8 Setup ChangeLog generation.
Use the 'gitlog-to-changelog' script from Gnulib to generate a
ChangeLog from the Git commit log when creating the distribution
tarball.

* build-aux/gitlog-to-changelog: New file.
* .gitignore: Do not ignore it.
* Makefile.am (gen-ChangeLog): New target.
(dist-hook): Depend on it.
* ChangeLog: New file.
2019-05-20 01:18:54 -04:00
Timothy Sample 9f48cea00e Use the standard GNU INSTALL file.
* INSTALL: Use text from the standard GNU INSTALL file.
2019-05-20 01:18:54 -04:00
Timothy Sample 5ffb3413de Move 'pre-inst-env.in' to 'build-aux'.
* pre-inst-env.in: Move this...
* build-aux/pre-inst-env.in: ...here.
* configure.ac: Update reference.
* .gitignore: Do not ignore it, and remove a duplicate 'pre-inst-env'.
2019-05-20 01:18:54 -04:00
Timothy Sample 4b664dd050 Add a more robust check for 'guild'.
* configure.ac: Add a more robust check for 'guild'.
* build-aux/gitlab-ci.yml: Do not make a 'guild' symlink.
2019-05-20 01:18:54 -04:00
Timothy Sample 95ed6f409e Update package metadata.
* configure.ac (AC_INIT): Update title, bug report address, and
tarball name.
2019-05-20 01:18:54 -04:00
Timothy Sample b024fcaab7 Remove compression utility configuration.
* configure.ac: Do not look for bzip2, compress, gzip, or xz.
* gash/config.scm.in (exec-internal-compress): Delete function.
(%bzip2, %compress, %gzip, %xz): Delete variables.
2019-05-20 01:18:54 -04:00
Timothy Sample 55ba522d38 Delete test output files when cleaning.
* Makefile.am (CLEANFILES): Include the '.1' and '.2' output files
from the integration tests.
2019-05-20 01:18:54 -04:00
Timothy Sample 7ddcf2a81e Clean up .gitignore.
* .gitignore: Remove old '/bin' entries; sort lines; and make things
absolute where that makes sense.
2019-05-20 01:18:54 -04:00
Timothy Sample 7b1a70002a Update AUTHORS file.
* AUTHORS: Remove references to deleted files and add Jan as an
author.
2019-05-20 01:18:54 -04:00
Timothy Sample c677ed85cc Clean up module imports in 'gash.scm'.
* gash/gash.scm: Sort the '#:use-module' lines and remove a duplicate
'(gash environment)'.
2019-05-20 01:18:54 -04:00
Timothy Sample 315322e6ca Remove 'debug' and 'prefer-builtins' options.
These were not working anyway.

* gash/gash.scm (%debug-level, %prefer-builtins): Remove variables.
(display-help, main): Remove 'debug' and 'prefer-builtins'.
2019-05-20 01:18:54 -04:00
Timothy Sample e39abd1566 Stop 'make clean' from deleting tests.
* Makefile.am (CLEANFILES): Fix the string replacements so that useful
tests do not get deleted.
2019-05-20 01:18:54 -04:00
Timothy Sample ff34039b62 Remove unused modules.
* gash/builtins.scm,
gash/io.scm,
gash/job.scm,
gash/pipe.scm,
gash/script.scm,
gash/shell-utils.scm,
gash/util.scm: Delete files.
* Makefile.am: Remove them.
* gash/gash.scm (main, prompt): Remove calls to deleted job control
procedures.
2019-05-20 01:18:54 -04:00
Timothy Sample 589b92e430 Remove unneeded files.
* HACKING,
TODO,
bin/builtin.in,
sh.bnf,
todo/*: Delete files.
2019-05-20 01:18:54 -04:00
Timothy Sample df43ca7215 Add support for Guile 2.0.
* configure.ac (GUILE_PKG): Add 2.0.
* gash/textual-ports.scm: New file.
* Makefile.am: Add it.
* gash/lexer.scm, gash/parser.scm, gash/shell.scm: Use it in place of
'(ice-9 textual-ports)'.
* tests/unit/shell.scm: Use it in place of '(ice-9 textual-ports)';
replace '(ice-9 textual-ports)' with '(rnrs io ports)' in sub-scripts;
and add a shim for 'setvbuf'.
2019-05-20 01:18:54 -04:00
Timothy Sample 9af8bb2832 Remove 'setvbuf' in string port redirect test.
This was only relevant to an older implementation of redirects, and
does not make much sense for us now.

* tests/unit/shell.scm (Redirects here-document to standard input):
Remove call to 'setvbuf'.
2019-05-20 01:18:54 -04:00
Timothy Sample 5b236ceef3 Structure 'echo' like all the other built-ins.
* gash/built-ins/echo.scm (echo): Rename this...
(main): ...to this, and do not export it.
* gash/built-ins.scm: Reference the 'main' function of the 'echo'
module using '@@'.
2019-05-20 01:18:54 -04:00
Timothy Sample 10400ed2ad Remove PEG modules and the PEG-based parser.
* gash/grammar.scm,
gash/peg.scm,
gash/peg/cache.scm,
gash/peg/codegen.scm,
gash/peg/simplify-tree.scm,
gash/peg/string-peg.scm,
gash/peg/using-parsers.scm: Delete files.
Makefile.am: Remove them.
2019-05-20 01:18:54 -04:00
Timothy Sample 0b73a0e70f Remove 'gash.guix.scm'.
* gash.guix.scm: Delete file.
2019-05-20 01:18:54 -04:00
Timothy Sample 874d165b11 Remove the unused 'geesh' module.
* gash/geesh.scm: Delete file.
* Makefile.am: Do not compile it.
* gash/gash.scm (%geesh-parser?): Remove unused variable.
(parse, parse-string, file-to-ast): Remove unused procedures.
2019-05-20 01:18:54 -04:00
Jan Nieuwenhuizen 5b74c6426a echo: Implement escapes.
* gash/built-ins/echo.scm (escape->control): New function.
(echo): Support '-e' and '-E' options even when clumped.
* Makefile.am (XFAIL_TESTS): Remove tests/20-pipe-sed.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 1cd6f963ea Allow setting the status with a Boolean.
* gash/environment.scm (set-status!): Allow numerical or boolean input.
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 18aefdda18 tests: Add 100-test-false.sh.
* tests/100-test-false.sh: New file.
* Makefile.am (FULL_TESTS): Add it.
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 06099ddead tests: Add 43-trap-subshell.sh.
* tests/43-trap-subshell.sh: New file.
* tests/43-trap-subshell.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/43-trap-subshell.sh.
2019-05-20 01:18:48 -04:00