From 4f7270df65d7c79222ab29b8628f251eee16053b Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 26 May 2020 14:25:08 +0000 Subject: New envfile format; prepare for 2.6.1.0 --- NEWS | 9 +++++ doc/envfile.html | 40 +++++++++++++++------ doc/index.html | 2 +- doc/upgrade.html | 10 ++++++ package/info | 2 +- src/execline/envfile.c | 94 ++++++++++++++++++++++++++++++++++++++---------- src/execline/envfile.txt | 60 +++++++++++++++++++++++++++++++ 7 files changed, 186 insertions(+), 31 deletions(-) create mode 100644 src/execline/envfile.txt diff --git a/NEWS b/NEWS index d966ede..07f4fef 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,14 @@ Changelog for execline. +In 2.6.1.0 +---------- + + - The envfile format has changed; it is now more expressive and +largely compatible with systemd's EnvironmentFile format. The +new format is a superset of the old one, so old envfiles should +still be understood by the new binary. + + In 2.6.0.2 ---------- diff --git a/doc/envfile.html b/doc/envfile.html index 5c0523c..713b6ae 100644 --- a/doc/envfile.html +++ b/doc/envfile.html @@ -55,19 +55,32 @@ it execs into prog.

file is a text file containing lines of the form key = value. -Whitespace is permitted before and after key, and before or after value, -but key or value can never contain whitespace. No quoting -is possible. +Whitespace is permitted before and after key, and before or after value.

Empty lines, or lines containing only whitespace, are ignored. Lines beginning with # (possibly after some whitespace) are ignored (and typically used for comments). -Comments are also possible at the end of lines: -key = value # comment is a valid line. Note that there -must be whitespace between value and # -in this case (else # is just read as a part of value). +Leading and trailing whitespace is stripped from values; but a +value can be double-quoted, which allows for inclusion of leading +and trailing whitespace. +

+ +

+ A non-commented line that ends with a backslash ("\") is +concatenated with the following one, and the newline character is +ignored. If a backslashed newline happens before the start of a +value, then the whitespace at the beginning of the new line will be +part of the value (i.e. leading whitespace on a new line is not +stripped). +

+ +

+ C escapes, including hexadecimal and octal sequences, are supported +in quoted values. Unicode codepoint sequences are not supported. It +is possible to include a newline in a quoted value by using \n; +but including newlines in environment variables is not recommended.

@@ -78,16 +91,21 @@ added to the environment, with an empty value. If you do not want the environment.

+

+ The envfile format is largely compatible with systemd's +EnvironmentFile +format, which allows for the reuse of such files outside of systemd. +

+

Notes

diff --git a/doc/index.html b/doc/index.html index 0b41cea..0437fd5 100644 --- a/doc/index.html +++ b/doc/index.html @@ -66,7 +66,7 @@ library.

Download