Index: bin/sync-and-gyp |
diff --git a/bin/sync-and-gyp b/bin/sync-and-gyp |
index 80dead97583504399f7cbe32b5692482eba1dbd7..b57843abbef50c5571c9e24830b6c52304b50cdb 100755 |
--- a/bin/sync-and-gyp |
+++ b/bin/sync-and-gyp |
@@ -8,10 +8,12 @@ |
# This script will update Skia's dependencies as necessary and run |
# gyp if needed. |
-# Depends on: Python, and Git. |
+# Depends on: Python, Git, and depot_tools. |
# |
# Example usage: |
# |
+# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git |
+# export PATH="${PWD}/depot_tools:${PATH}" |
# git clone https://skia.googlesource.com/skia |
# cd skia |
# python bin/sync-and-gyp |
@@ -41,9 +43,35 @@ if not os.path.isfile('DEPS'): |
sys.stderr.write('DEPS file missing') |
exit(1) |
-env = os.environ.copy() |
-env["GIT_SYNC_DEPS_QUIET"] = "1" |
-subprocess.call(['python', 'tools/git-sync-deps'], env=env) |
scroggo
2016/02/16 15:02:42
Should we also delete tools/git-sync-deps?
hal.canary
2016/02/16 15:43:44
Maybe. Let's do that in another CL, in case someo
|
+deps_hasher = hashlib.sha1() |
+with open('DEPS', 'r') as f: |
+ deps_hasher.update(f.read()) |
+deps_hash = deps_hasher.hexdigest() |
+current_deps_hash = None |
+if os.path.isfile('.deps_sha1'): |
+ with open('.deps_sha1', 'r') as f: |
+ current_deps_hash = f.read().strip() |
+ |
+gclient_config = ''' |
scroggo
2016/02/16 15:02:42
Why not use the existing gclient config? Mine is s
mtklein
2016/02/16 15:32:05
Nah, target_os = ['android'] doesn't actually do a
hal.canary
2016/02/16 15:43:44
okay. I'll check to see if the file exists first.
|
+solutions = [ |
+ { "name" : ".", |
+ "url" : "https://skia.googlesource.com/skia.git", |
+ "deps_file" : "DEPS", |
+ "managed" : False, |
+ "custom_deps" : { |
+ }, |
+ "safesync_url": "", |
+ }, |
+] |
+cache_dir = None |
+''' |
+if current_deps_hash != deps_hash: |
+ # `gclient sync` is very slow, so skip whenver we can |
scroggo
2016/02/16 15:02:42
whenever*
hal.canary
2016/02/16 15:43:44
done
|
+ with open('.gclient', 'w') as o: |
+ o.write(gclient_config) |
+ subprocess.call(['gclient', 'sync']) |
+ with open('.deps_sha1', 'w') as o: |
+ o.write(deps_hash) |
hasher = hashlib.sha1() |