[gn build] unconfuse sync script about "sources = []" in clang/lib/Headers/BUILD.gn

This commit is contained in:
Nico Weber 2020-09-16 14:50:29 -04:00
parent 2240ca0bd1
commit 15c378f6e6
1 changed files with 3 additions and 0 deletions

View File

@ -29,6 +29,9 @@ def patch_gn_file(gn_file, add, remove):
srcs_tok = 'sources = ['
tokloc = gn_contents.find(srcs_tok)
while tokloc != -1 and tokloc + len(srcs_tok) < len(gn_contents) and \
gn_contents[tokloc + len(srcs_tok)] == ']':
tokloc = gn_contents.find(srcs_tok, tokloc + 1)
if tokloc == -1: raise ValueError(gn_file + ': Failed to find source list')
if gn_contents.find(srcs_tok, tokloc + 1) != -1: