Skip to content

Instantly share code, notes, and snippets.

@azbesthu
Last active August 29, 2015 14:02
Show Gist options
  • Save azbesthu/f62f298573c0354f9e08 to your computer and use it in GitHub Desktop.
Save azbesthu/f62f298573c0354f9e08 to your computer and use it in GitHub Desktop.
diff --git a/tools/scripts/patch_upstream.py b/tools/scripts/patch_upstream.py
index e3af0ce..e347d0e 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment