mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
tools: win: Fix grep usage with system Git (see #3836)
This commit is contained in:
@ -8,8 +8,8 @@ import os
|
||||
import sys
|
||||
|
||||
if sys.platform == 'win32':
|
||||
# Force use of the git version bundled with depot_tools.
|
||||
git_exe = 'git.bat'
|
||||
# Force use of the system installed Git version.
|
||||
git_exe = 'git.exe'
|
||||
else:
|
||||
git_exe = 'git'
|
||||
|
||||
@ -30,6 +30,15 @@ def exec_git_cmd(args, path='.'):
|
||||
""" Executes a git command with the specified |args|. """
|
||||
cmd = "%s %s" % (git_exe, args)
|
||||
result = exec_cmd(cmd, path)
|
||||
if result['ret'] != 0:
|
||||
sys.stderr.write('Command \"%s\" exited with retval %d\n' % (cmd,
|
||||
result['ret']))
|
||||
if result['err'] != '':
|
||||
err = result['err'].strip()
|
||||
if sys.platform == 'win32':
|
||||
# Convert to Unix line endings.
|
||||
err = err.replace('\r\n', '\n')
|
||||
sys.stderr.write(err + '\n')
|
||||
if result['out'] != '':
|
||||
out = result['out'].strip()
|
||||
if sys.platform == 'win32':
|
||||
|
@ -96,6 +96,9 @@ def compute_next_api_verson(api_versions_file):
|
||||
|
||||
def git_grep_next(cef_dir):
|
||||
cmd = "grep --no-color -n -E (CEF_NEXT|CEF_NEXT)|=next -- :!include/cef_api_hash.h *.h"
|
||||
if sys.platform == 'win32':
|
||||
# Pass the pipe (|) character as a literal argument.
|
||||
cmd = cmd.replace('|', '^|')
|
||||
return exec_git_cmd(cmd, cef_dir)
|
||||
|
||||
|
||||
@ -362,8 +365,10 @@ def exec_check(cpp_header_dir, api_versions_file, api_untracked_file, debug_dir,
|
||||
print('WARNING: This change can break back/forward binary compatibility.')
|
||||
else:
|
||||
sys.stderr.write('ERROR: %d hashes checked and failed\n' % len_failed)
|
||||
sys.stderr.write('\nFor debugging tips/tricks see\n' +
|
||||
'https://github.com/chromiumembedded/cef/issues/3836#issuecomment-2587767028\n\n')
|
||||
sys.stderr.write(
|
||||
'\nFor debugging tips/tricks see\n' +
|
||||
'https://github.com/chromiumembedded/cef/issues/3836#issuecomment-2587767028\n\n'
|
||||
)
|
||||
|
||||
print('%d hashes checked and match (%d/%d versioned, %d/%d untracked).' %
|
||||
(len(versions) - len_failed,
|
||||
|
Reference in New Issue
Block a user