patcher: Skip missing platform-specific third-party directories

This commit is contained in:
Marshall Greenblatt
2022-07-26 10:09:01 -07:00
parent 9af494d36c
commit 5034749463
2 changed files with 14 additions and 1 deletions

View File

@ -30,7 +30,8 @@ def write_note(type, note):
def apply_patch_file(patch_file, patch_dir):
''' Apply a specific patch file in optional patch directory. '''
patch_path = os.path.join(cef_patch_dir, 'patches', patch_file + '.patch')
patch_name = patch_file + '.patch'
patch_path = os.path.join(cef_patch_dir, 'patches', patch_name)
if patch_dir is None or len(patch_dir) == 0:
patch_dir = src_dir
@ -39,6 +40,10 @@ def apply_patch_file(patch_file, patch_dir):
# Apply patch relative to the Chromium 'src' directory.
patch_dir = os.path.join(src_dir, patch_dir)
patch_dir = os.path.abspath(patch_dir)
if not os.path.isdir(patch_dir):
sys.stdout.write('\nApply %s in %s\n' % (patch_name, patch_dir))
sys.stdout.write('... target directory does not exist (skipping).\n')
return 'skip'
result = git_apply_patch_file(patch_path, patch_dir)
if result == 'fail':