From 9f1bbe47a5f4699957b7604b104ccf8bec91f764 Mon Sep 17 00:00:00 2001 From: trav90 Date: Sat, 11 Aug 2018 16:24:30 -0500 Subject: Shell quote environment variable values when dumping them in dump_env.py The mozconfig output parsing code already (mostly) handles shell quoted strings, because that's what `set` outputs. By quoting environment variable values, we avoid a bunch of problems with "weird" values. --- python/mozbuild/mozbuild/action/dump_env.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/mozbuild/mozbuild/action/dump_env.py b/python/mozbuild/mozbuild/action/dump_env.py index a6fa19f3a..83e420d68 100644 --- a/python/mozbuild/mozbuild/action/dump_env.py +++ b/python/mozbuild/mozbuild/action/dump_env.py @@ -6,5 +6,11 @@ # native paths printed on Windows so that these paths can be incorporated # into Python configure's environment. import os +import sys + +sys.path.append(os.path.join(os.path.dirname(__file__), '..')) + +from shellutil import quote + for key, value in os.environ.items(): - print('%s=%s' % (key, value)) + print('%s=%s' % (key, quote(value))) -- cgit v1.2.3