Commit 5b593358 authored by Paweł Hajdan, Jr's avatar Paweł Hajdan, Jr Committed by Commit Bot

gclient flatten: skip empty fields

Bug: 570091
Change-Id: Ib1a86289f8219ead789e19896c2a873b8d59c179
Reviewed-on: https://chromium-review.googlesource.com/556035Reviewed-by: 's avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
parent 27e86ea2
......@@ -1880,6 +1880,8 @@ def _GNSettingsToLines(gn_args_file, gn_args):
def _DepsToLines(deps):
"""Converts |deps| dict to list of lines for output."""
if not deps:
return []
s = ['deps = {']
for name, dep in sorted(deps.iteritems()):
condition_part = ([' "condition": "%s",' % dep.condition]
......@@ -1898,6 +1900,8 @@ def _DepsToLines(deps):
def _DepsOsToLines(deps_os):
"""Converts |deps_os| dict to list of lines for output."""
if not deps_os:
return []
s = ['deps_os = {']
for dep_os, os_deps in sorted(deps_os.iteritems()):
s.append(' "%s": {' % dep_os)
......@@ -1919,6 +1923,8 @@ def _DepsOsToLines(deps_os):
def _HooksToLines(name, hooks):
"""Converts |hooks| list to list of lines for output."""
if not hooks:
return []
s = ['%s = [' % name]
for dep, hook in hooks:
s.extend([
......@@ -1942,6 +1948,8 @@ def _HooksToLines(name, hooks):
def _HooksOsToLines(hooks_os):
"""Converts |hooks| list to list of lines for output."""
if not hooks_os:
return []
s = ['hooks_os = {']
for hook_os, os_hooks in hooks_os.iteritems():
s.append(' "%s": [' % hook_os)
......
......@@ -659,9 +659,6 @@ class GClientSmokeGIT(GClientSmokeBase):
'',
']',
'',
'pre_deps_hooks = [',
']',
'',
'hooks_os = {',
' "mac": [',
' # src',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment