Skip to content

Commit

Permalink
[gn build] use \bfoo\b instead of \<foo\> in sync script
Browse files Browse the repository at this point in the history
\<foo\> is more correct, but since we use shell=True on Windows,
the < and > get interpreted as redirection operators.

Rather than adding cmd escaping, just use \bfoo\b, which is Good
Enough Often Enough.
  • Loading branch information
nico committed Feb 19, 2020
1 parent 069b85f commit 187204c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/utils/gn/build/sync_source_lists_from_cmake.py
Expand Up @@ -70,7 +70,7 @@ def find_gitrev(touched_line, in_file):
# undefined behavior according to the POSIX extended regex spec.
posix_re_escape = lambda s: re.sub(r'([.[{()\\*+?|^$])', r'\\\1', s)
cmd = ['log', '--format=%h', '-1', '--pickaxe-regex',
r'-S\<%s\>' % posix_re_escape(touched_line), in_file]
r'-S\b%s\b' % posix_re_escape(touched_line), in_file]
return git_out(cmd).rstrip()

# Collect changes to gn files, grouped by revision.
Expand Down

0 comments on commit 187204c

Please sign in to comment.