Commit Graph

525 Commits

Author SHA1 Message Date
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
Jan Nieuwenhuizen bbb74ab958 Delete merge leftover.
* check.sh: Delete file.
2019-05-20 01:18:48 -04:00
Jan Nieuwenhuizen 7640a09382 Support redirects with empty commands.
* gash/eval.scm (exp->thunk): Return 'noop' if 'exp' is '#f'.
* tests/50-redirect-clobber.sh: New file.
* tests/50-redirect-clobber.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/50-redirect-clobber.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:36 -04:00
Jan Nieuwenhuizen 6808c941f1 Respect '--parse' flag for files and non-TTY inputs.
* gash/gash.scm (main): Include 'parse?' in all calls to 'run-repl'.
2019-05-20 01:18:36 -04:00
Jan Nieuwenhuizen 13f43973f5 Do not export unset variables.
* gash/environment.scm (get-environ): Filter out unset variables.
* tests/42-sh-export-new.sh: New file.
* tests/42-sh-export-new.stdout: New file.
* Makefile.am (FULL_TESTS): Add tests/42-sh-export-new.sh.
(XFAIL_TESTS): Remove tests/42-export-new.sh and tests/42-sh-export.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:22 -04:00
Jan Nieuwenhuizen 25597a4bec set: Support clumped flags, e.g. set -eux.
* gash/built-ins/set.scm (main): Support clumped flags.
2019-05-20 01:18:22 -04:00
Timothy Sample 50473ac9d4 Add copyright sign to headers.
* gash/built-ins/*, gash/environment.scm, gash/eval.scm,
gash/lexer.scm, gash/parser.scm, gash/repl.scm, gash/word.scm,
tests/unit/*, tools/coverage.in: Add copyright sign to headers.
2019-05-20 01:18:22 -04:00
Jan Nieuwenhuizen 9f57723fb6 Make 'set -x' print commands.
* gash/shell.scm (sh:exec-let): Respect the 'xtrace' option.
2019-05-20 01:18:22 -04:00
Jan Nieuwenhuizen 05f3880419 Remove accidentally committed files.
* 07-variable-or-slash.stdout: Delete file.
* 70-slash-string-slash.stdout: Delete file.
2019-05-20 01:18:22 -04:00
Jan Nieuwenhuizen 2e4e078975 Fix some environment-dependent tests.
* gash/environment.scm (initial-variables): Add 'SHELL' and 'SHELLOPTS'.
* tests/100-cd.sh, tests/100-cd.stdout: Use '/tmp' instead of '/bin'.
* tests/50-redirect-in-out.sh, tests/50-redirect-space.sh,
tests/50-redirect.sh: Use '/tmp' and PID for temporary files.
* tests/50-redirect-sed.sh: Make sure 'DESTDIR' is unset and use
'/bin/GASH' in place of '/bin/gash'.
* tests/50-redirect-sed.stdout, tests/data/diff.scm: Use '/bin/GASH' in
place of '/bin/gash'.
* Makefile.am (FULL_TESTS): Add tests/50-redirect-sed.sh,
tests/50-redirect-space.sh, and tests/100-cd.sh; remove
tests/50-redirect-merge.sh.
(BROKEN_TESTS): Remove tests/10-if-redirect.sh,
tests/50-redirect-sed.sh, tests/50-redirect-space.sh, and
tests/100-cd.sh; add tests/50-redirect-merge.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:18:07 -04:00
Jan Nieuwenhuizen 56610b0669 Add export test.
* tests/42-export-new.sh: New file.
* tests/42-export-new.stdout: New file.
* Makefile.am (FULL_TESTS, XFAIL_TESTS): Add 42-export-new.sh.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:57 -04:00
Timothy Sample e87f351f3e Add missing copyright headers.
* gash/gash.scm, gash/grammar.scm, gash/io.scm, gash/job.scm,
gash/pipe.scm, gash/script.scm: Add missing copyright header.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2019-05-20 01:17:48 -04:00
Timothy Sample 1bd92e2893 Remove (almost) all references to Geesh.
gash/environment.scm: Remove file.
geesh/*: Move these files into the 'gash' folder and replace all
instances of the word 'geesh'.
scripts/geesh.in: Remove file.
HACKING, INSTALL, Makefile.am, configure.ac, guix.scm,
tests/bootstrap/bash-without-bash.scm, tests/spec/Makefile.am,
tests/spec/check-spec, tests/spec/oil.scm, tests/unit/*,
tools/coverage.in: Replace all instances of the word 'geesh'.

Co-authored-by: Jan Nieuwenhuizen <janneke@gnu.org>
2019-05-20 01:17:40 -04:00
Timothy Sample f387269c0b Only use readline for TTYs.
* gash/gash.scm: Hide the readline interface behind a check for
'isatty?', and default to just running the plain REPL.
2019-05-20 01:17:40 -04:00
Jan Nieuwenhuizen 7fcfe66407 Add the 'command' built-in.
* geesh/built-ins/command.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Add 'command'.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:30 -04:00
Jan Nieuwenhuizen 57e8e3bd64 Add the 'type' built-in.
* geesh/built-ins/type.scm: New file.
* Makefile.am: Add it.
* geesh/built-ins.scm (*built-ins*): Add 'type'.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:22 -04:00
Timothy Sample f4dd0feb77 Do not clobber status before 'cond' expressions.
This spurious status reset must have been an attempt to make sure that
when no branch is taken, the status ends up as zero.  It is not
necessary and causes problems when trying to branch based on the value
of '$?'.

* geesh/shell.scm (sh:cond): Remove spurious 'set-status!'.
2019-05-20 01:17:22 -04:00
Timothy Sample ae769985be Reset signal and exit handlers in subshells.
* geesh/shell.scm (%subshell): In the child process, restore all
signal handlers to their original actions and unset the current
'atexit' handler.
2019-05-20 01:17:22 -04:00
Timothy Sample c169a90753 Use default value when unpacking variable vector.
* geesh/environment.scm (getvar): Use 'dflt' when we have a vector but
'value' is '#f'.
2019-05-20 01:17:22 -04:00
Timothy Sample 64aa779315 lexer: Do not let comments delimit words.
The '#' character only introduces a comment if it occurs where a word
would begin.  If it occurs within a word, it is not treated specially.

* geesh/lexer.scm (get-word): Do not treat '#' specially.
2019-05-20 01:17:22 -04:00
Timothy Sample 4d1e0c96a4 shell: Make 'continue' work in while loops.
* geesh/shell.scm (sh:while): Use 'call-with-continue' when invoking
the body thunk.
2019-05-20 01:17:22 -04:00
Timothy Sample 0dc3f63cad Handle '$LINENO'.
* geesh/lexer.scm (get-parameter-expansion): Include the current line
number with the variable name if it is 'LINENO'.
(call-with-metered-input-port): Set the line number of the soft port.
* geesh/word.scm (parameter-ref): Unpack the included line number when
the parameter name is 'LINENO'.
2019-05-20 01:17:22 -04:00
Jan Nieuwenhuizen c6a3d13c69 word: Add context to "not implemented" errors.
* geesh/word.scm (word->qword): Include the word form in "not
implemented" error messages.
2019-05-20 01:17:22 -04:00
Jan Nieuwenhuizen 2d99ab62d0 Update AUTHORS.
* AUTHORS: Add Timothy Sample as a main author; remove files that no
longer exist.
2019-05-20 01:17:22 -04:00
Jan Nieuwenhuizen cf5611f6d4 Replace geesh script with gash.
* geesh/repl.scm (run-repl): Add optional parse? parameter.
* gash/gash.scm (main): Rewrite to use Geesh parser and evaluator.
* scripts/geesh.in: Remove.
* Makefile.am: Remove scripts/geesh; adjust XFAIL_TESTS.
* .gitignore: Update.

Co-authored-by: Timothy Sample <samplet@ngyro.com>
2019-05-20 01:17:14 -04:00
Timothy Sample 171796317f Remove external commands.
* gash/bournish-commands.scm, gash/commands/*, gash/compress.scm,
gash/guix-utils.scm, gash/lzw.scm, gash/ustar.scm: Delete files.
* gash/builtins.scm, gash/gash.scm, gash/script.scm: Remove references
to deleted modules.
* tests/100-basename-*, tests/100-dirname-*, tests/100-sed-*,
tests/100-tar-*, tests/100-tr-*: Delete files.
* Makefile.am: Remove deleted modules and tests.
2019-05-16 10:49:38 -04:00
Timothy Sample 42f9fb2671 Stabilize test suite.
* test.sh: Increase test timeout from 1 to 10.
* Makefile.am (FULL_TESTS): Move tests/10-if-redirect.sh,
tests/50-redirect-space.sh, tests/50-redirect-sed.sh, and
tests/100-cd.sh from here...
(BROKEN_TESTS): ...to here.
2019-05-16 10:49:38 -04:00