From d98d99347079368fcd1fea5a1cb12ff68f1d0004 Mon Sep 17 00:00:00 2001 From: Zoltan Arvai Date: Tue, 17 Jun 2014 11:26:20 +0200 Subject: Fix patch_upstream script on Windows Preventing failure while applying patches on submodules that are skipped on Windows. Non Windows related submodules are not checked out from upstream repository. This behavior is a workaround for git issues. Change-Id: If34d9d2916829f87c7397a07803f79c156c05c57 Reviewed-by: Michael Bruning Reviewed-by: Andras Becsi --- tools/scripts/patch_upstream.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tools/scripts/patch_upstream.py b/tools/scripts/patch_upstream.py index e3af0ce5f..e347d0e21 100755 --- a/tools/scripts/patch_upstream.py +++ b/tools/scripts/patch_upstream.py @@ -106,13 +106,20 @@ if not len(findSnapshotBaselineSha1()): patches = preparePatchesFromSnapshot() for path in patches: leading = path.count('/') + 2 + target_dir = "" if path.startswith('chromium'): - os.chdir(os.path.join(upstream_src_dir, path)) + target_dir = os.path.join(upstream_src_dir, path) else: - os.chdir(os.path.join(upstream_src_dir, 'chromium', path)) + target_dir = os.path.join(upstream_src_dir, 'chromium', path) leading += 1 + if not os.path.isdir(target_dir): + # Skip applying patches for non-existing submodules + print('\n-- missing '+ target_dir + ', skipping --') + continue + + os.chdir(target_dir) print('\n-- entering '+ os.getcwd() + ' --') # Sort the patches to be able to apply them in order -- cgit v1.2.3