gclient flatten: properly quote conditionals
Bug: 661382
Change-Id: Id50b2541132002452bc5d86bb013758e8be0f4b0
Reviewed-on: https://chromium-review.googlesource.com/697813
Reviewed-by: Michael Moss <mmoss@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
diff --git a/gclient.py b/gclient.py
index c2f4040..626ba80 100755
--- a/gclient.py
+++ b/gclient.py
@@ -1997,7 +1997,7 @@
return []
s = ['deps = {']
for name, dep in sorted(deps.iteritems()):
- condition_part = ([' "condition": "%s",' % dep.condition]
+ condition_part = ([' "condition": %r,' % dep.condition]
if dep.condition else [])
s.extend([
' # %s' % dep.hierarchy(include_url=False),
@@ -2019,7 +2019,7 @@
for dep_os, os_deps in sorted(deps_os.iteritems()):
s.append(' "%s": {' % dep_os)
for name, dep in sorted(os_deps.iteritems()):
- condition_part = ([' "condition": "%s",' % dep.condition]
+ condition_part = ([' "condition": %r,' % dep.condition]
if dep.condition else [])
s.extend([
' # %s' % dep.hierarchy(include_url=False),
@@ -2049,7 +2049,7 @@
if hook.pattern is not None:
s.append(' "pattern": "%s",' % hook.pattern)
if hook.condition is not None:
- s.append(' "condition": "%s",' % hook.condition)
+ s.append(' "condition": %r,' % hook.condition)
s.extend(
# Hooks run in the parent directory of their dep.
[' "cwd": "%s",' % os.path.normpath(os.path.dirname(dep.name))] +
@@ -2078,7 +2078,7 @@
if hook.pattern is not None:
s.append(' "pattern": "%s",' % hook.pattern)
if hook.condition is not None:
- s.append(' "condition": "%s",' % hook.condition)
+ s.append(' "condition": %r,' % hook.condition)
s.extend(
# Hooks run in the parent directory of their dep.
[' "cwd": "%s",' % os.path.normpath(os.path.dirname(dep.name))] +