summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authortrav90 <travawine@palemoon.org>2018-08-11 16:24:30 -0500
committertrav90 <travawine@palemoon.org>2018-08-11 16:24:30 -0500
commitc3cab0a049283ee0b54bfb118a1f933b94138418 (patch)
tree05758d17e5ffb49c7519b33af503389caab97ede /python
parentaec4a395a9bb19dfea8c23181d6d539ee97e0c34 (diff)
downloaduxp-c3cab0a049283ee0b54bfb118a1f933b94138418.tar.gz
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.
Diffstat (limited to 'python')
-rw-r--r--python/mozbuild/mozbuild/action/dump_env.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/python/mozbuild/mozbuild/action/dump_env.py b/python/mozbuild/mozbuild/action/dump_env.py
index a6fa19f3a3..83e420d682 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)))