Clarify warning for GYP variable merging.

https://codereview.chromium.org/931643002 changed variable merging
behavior for environment variables and chromium.gyp_env. The new
behavior replaces variables, with the exception of GYP_DEFINES
which is instead concatenated.

This change clarifies the state of the variables to the developer
by printing values, and more accurately describes the override
behavior as 'merges with, and individual components override,'.

Review URL: https://codereview.chromium.org/993143002

Cr-Original-Commit-Position: refs/heads/master@{#320609}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: eedc9ac929470feba9b8b4899c1aad14cbb5b97b
This commit is contained in:
scheib 2015-03-13 17:14:01 -07:00 коммит произвёл Commit bot
Родитель 68a47c7b23
Коммит a4857a808f
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -44,11 +44,17 @@ def apply_gyp_environment_from_file(file_path):
if var in os.environ:
behavior = 'replaces'
if var == 'GYP_DEFINES':
os.environ[var] = file_val + ' ' + os.environ[var]
behavior = 'overrides'
result = file_val + ' ' + os.environ[var]
behavior = 'merges with, and individual components override,'
else:
result = os.environ[var]
print 'INFO: Environment value for "%s" %s value in %s' % (
var, behavior, os.path.abspath(file_path)
)
string_padding = max(len(var), len(file_path), len('result'))
print ' %s: %s' % (var.rjust(string_padding), os.environ[var])
print ' %s: %s' % (file_path.rjust(string_padding), file_val)
os.environ[var] = result
else:
os.environ[var] = file_val