From f50a208f9df348cede2ba50b4f435351d8d3f19e Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 3 Jun 2019 13:17:13 +0300 Subject: Finish the env re-implementation * 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. --- NEWS | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) (limited to 'NEWS') diff --git a/NEWS b/NEWS index f34a6f0..db79097 100644 --- a/NEWS +++ b/NEWS @@ -1,10 +1,10 @@ -GNU Pies NEWS -- history of user-visible changes. 2019-05-31 +GNU Pies NEWS -- history of user-visible changes. 2019-06-03 See the end of file for copying conditions. Please send Pies bug reports to or -Version 1.3.90 (git) +Version 1.3.91 (git) * New option --no-init @@ -38,7 +38,41 @@ contains redirections, pipes, etc. E.g. * Improved cyclic dependency diagnostics -* Fix a bug in 'env' statement +* New 'env' statement + +The 'env' statement has been re-implemented as a compound statement. +It can contain the following sub-statements: + +** clear yes +Clears the environment + +** keep NAME +Keeps the variable NAME when clearing the environment. Implies +"clear yes". NAME can be a globbing pattern, in which case all +variables matching the pattern are retained. + +** set "NAME=VALUE" +Sets the environment variable for the component. VALUE is subject +to variable expansion. + +** unset NAME +Unsets the variable. NAME can be a globbing pattern, in which case all +variables matching the pattern are unset. + +Example: + + env { + clear yes + keep PATH + keep MANPATH + keep "LC_*" + set "MANPATH=$MANPATH${MANPATH:+:}/usr/local/man" + } + +* Legacy 'env' statement. + +Support for the old one-line syntax of "env" is retained for +backward compatibility. Previous versions applied unnecessary word splitting if given a single argument. This is now fixed, so that e.g. the following @@ -47,6 +81,12 @@ X to have the value "foo bar": env "X=foo bar" +* New environment variable available in commands started from return-code + +Programs started via "exec" statement in the "return-code" block +obtain the PID of the master pies process in environment variable +PIES_MASTER_PID. + Version 1.3, 2016-10-01 -- cgit v1.2.1