summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZoltan Arvai <zarvai@inf.u-szeged.hu>2014-06-17 11:26:20 +0200
committerZoltan Arvai <zarvai@inf.u-szeged.hu>2014-06-17 16:17:52 +0200
commitd98d99347079368fcd1fea5a1cb12ff68f1d0004 (patch)
tree441c7f8049d5fff0302bb0144839cc242ece2157
parent5dd7b370c8880971e798d656b5c2d4e0e5a1538f (diff)
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 <michael.bruning@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
-rwxr-xr-xtools/scripts/patch_upstream.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/scripts/patch_upstream.py b/tools/scripts/patch_upstream.py
index e3af0ce5..e347d0e2 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