From: Tobias Ulmer Date: Tue, 1 Nov 2016 17:51:37 +0000 (+0100) Subject: environment: quote environment vars to allow expansion X-Git-Tag: e2factory-2.3.15rc1~27 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=78e8fddc429d5aeaa6a7343d2533c0557b6b5b9d;p=e2factory.git environment: quote environment vars to allow expansion shquote() breaks backwards compat Signed-off-by: Tobias Ulmer --- diff --git a/local/environment.lua b/local/environment.lua index f65717b..9f23f86 100644 --- a/local/environment.lua +++ b/local/environment.lua @@ -114,8 +114,7 @@ function environment.get_dict(env) end --- Write environment as key=value\n... string to file. File is created or --- truncated. Value is quoted with e2lib.shquote() so the file can be sourced --- by a shell. +-- overwritten. -- @param env Environment. -- @param file File name. -- @return True on success, false on error. @@ -128,7 +127,8 @@ function environment.tofile(env, file) out = {} for var, val in env:iter() do - table.insert(out, string.format("%s=%s\n", var, e2lib.shquote(val))) + -- no e2lib.shquote(), some projects depend on shell variable expansion + table.insert(out, string.format("%s=\"%s\"\n", var, val)) end rc, re = eio.file_write(file, table.concat(out))