[llvm] 187204c - [gn build] use \bfoo\b instead of \<foo\> in sync script

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 09:32:10 PST 2020


Author: Nico Weber
Date: 2020-02-19T12:32:02-05:00
New Revision: 187204cd746f537405d11ee27d60d8ab59c9192d

URL: https://github.com/llvm/llvm-project/commit/187204cd746f537405d11ee27d60d8ab59c9192d
DIFF: https://github.com/llvm/llvm-project/commit/187204cd746f537405d11ee27d60d8ab59c9192d.diff

LOG: [gn build] use \bfoo\b instead of \<foo\> in sync script

\<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.

Added: 
    

Modified: 
    llvm/utils/gn/build/sync_source_lists_from_cmake.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/build/sync_source_lists_from_cmake.py b/llvm/utils/gn/build/sync_source_lists_from_cmake.py
index 93974e660ac6..0b13a8afc716 100755
--- a/llvm/utils/gn/build/sync_source_lists_from_cmake.py
+++ b/llvm/utils/gn/build/sync_source_lists_from_cmake.py
@@ -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.


        


More information about the llvm-commits mailing list