Age | Commit message (Collapse) | Author | Files |
|
It no longer requires an argument. The correct syntax is
env {
clear;
}
|
|
* NEWS: Document the "env" statement and the PIES_MASTER_PID
environment variable.
Version 1.3.91
* configure.ac: Version 1.3.91
* doc/pies.texi: Document the new "env" statement syntax. Provide
instructions on how to convert legacy "env" statement to the new
form.
* lib/envop.c (environ_unset): Take reference value as argument.
If supplied, unset the variable only if its value matches the
reference one.
* lib/envop.h (environ_unset): Change proto.
* src/pies.c (parse_legacy_env): Minor changes.
(_cb_env_unset): Allow to specify value.
* src/progman.c (run_command): Define PIES_MASTER_PID.
* tests/env.at: Check the legacy env syntax.
* tests/envop.at: Additional checks.
|
|
Presence of the ~/.netrc file can slow down execution because of eventual
DNS calls in hostcmp. Provide an option to disable netrc parsing and use
it in tests.
* src/piesctl-cl.opt: New option: --no-netrc.
* doc/pies.texi: Document --no-netrc
* src/piesctl.c (shttp_connect): Don't read ~/.netrc if given --no-netrc.
* tests/env.at: Pass --no-netrc to piesctl.
* tests/respawn.at: Likewise.
* tests/shell.at: Likewise.
* tests/shutdown.at: Likewise.
* tests/startup.at: Likewise.
|
|
The aim is to run pies in foreground if possible. Limit execution time
using external wrapper.
* src/pies.c: (_cb_redir): Consistently return 1 on errors.
* tests/aux/sleepexit: New file.
* tests/aux/startcheck: New file.
* tests/aux/touchfile: Change arguments.
* tests/aux/respawn: Rewrite.
* tests/lines.c: New noinst program.
* tests/to.c: New noinst program.
* tests/.gitignore: Add new programs.
* tests/Makefile.am: Update.
* tests/env.at: Use to to avoid hanging forever.
Add missing popdef.
* tests/redirect.at: Use echo as component program.
* tests/respawn.at: Run pies in foreground. Use to to limit execution
time.
* tests/shell.at: Likewise.
* tests/shutdown.at: Likewise.
* tests/startup.at: Likewise.
* tests/ret-exec.at: Use sleepexit as component program.
* tests/ret-notify.at: Likewise.
|
|
The "env" statement is now a compound statement. It can contain four
substatements: "clear" to clear the environment, "keep" to retain
certain variable while clearing it, "set" to set a variable, and
"unset" to unset a variable or variables.
Both "keep" and "unset" can take globbing pattern as their argument,
in which case they affect all variable matching that pattern.
The value part in the "set" statement is subject to variable expansion,
e.g.
set "MANPATH=$MANPATH${MANPATH:+:}/usr/local/man"
The support for the old one-line syntax of "env" is retained for
backward compatibility.
This commit also fixes redirection to a file: new data are appended
to the file, instead of overwriting it.
* lib/Makefile.am: Add new files.
* lib/envop.c: New file.
* lib/envop.h: New file.
* lib/wildmatch.c: New file.
* src/comp.c (component_free): Update.
* src/pies.c (argv_free): New function.
(parse_legacy_env): New function.
(_cb_env): Remove.
(cb_env_section_parser): New function.
(cb_env_keywords): New keywords for the "env" block statement:
clear, keep, set, unset.
(component_keywords): New compount statement: env.
Old usage retained for backward compatibility.
* src/pies.h: Include "envop.h"
(component)<env>: Remove.
<envop>: New field.
* src/prog.h (prog)<env>: New field.
* src/progman.c (redirect_to_file): Position to the end of file.
(DEBUG_ENVIRON): Remove macro.
(debug_environ): New function.
(environ_setup): Remove.
(prog_sockenv): Use environ_set to modify local copy of environment.
(prog_start_prologue): Use environ_create + envop_exec to create and
modify the environment.
(prog_execute): Set environment to prog-local copy.
* tests/.gitignore: Build envtest
* tests/Makefile.am: Add new tests.
* tests/testsuite.at: Add environment tests.
* tests/envop.at: New file.
* tests/envtest.c: New file.
* tests/env.at: New file.
* tests/redirect.at: Check first two lines of the output file.
|