Bug 1153566 - Incorrect re in _check_blacklisted_variables did not ignore comment. r=gps

--HG--
extra : rebase_source : fe0ce8cb121befee16dccaa0215cb24c5bdf76f9
This commit is contained in:
ISHIKAWA, Chiaki 2015-04-11 09:41:00 +02:00
Родитель 03cc3bcefa
Коммит 2807063b52
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -703,12 +703,12 @@ class RecursiveMakeBackend(CommonBackend):
def _check_blacklisted_variables(self, makefile_in, makefile_content):
for x in MOZBUILD_VARIABLES:
if re.search(r'[^#]\b%s\s*[:?+]?=' % x, makefile_content, re.M):
if re.search(r'^[^#]*\b%s\s*[:?+]?=' % x, makefile_content, re.M):
raise Exception('Variable %s is defined in %s. It should '
'only be defined in moz.build files.' % (x, makefile_in))
for x in DEPRECATED_VARIABLES:
if re.search(r'[^#]\b%s\s*[:?+]?=' % x, makefile_content, re.M):
if re.search(r'^[^#]*\b%s\s*[:?+]?=' % x, makefile_content, re.M):
raise Exception('Variable %s is defined in %s. This variable '
'has been deprecated. It does nothing. It must be removed '
'in order to build.' % (x, makefile_in))