Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: bin/sync-and-gyp

Issue 1915223002: bin/sync (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « bin/sync ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/sync-and-gyp
diff --git a/bin/sync-and-gyp b/bin/sync-and-gyp
index a62128d3b1860fa036e4b8c177c3f06db289722b..11905ed2ee41fe04c7401a8056dcf0b1f01611d0 100755
--- a/bin/sync-and-gyp
+++ b/bin/sync-and-gyp
@@ -36,8 +36,6 @@ import sys
skia_dir = os.path.join(os.path.dirname(__file__), os.pardir)
-skia_opt_deps = [arg for arg in sys.argv[1:] if arg.startswith('--deps=')]
-
skia_out = os.environ.get("SKIA_OUT")
if skia_out:
skia_out = os.path.abspath(skia_out)
@@ -47,65 +45,10 @@ else:
os.chdir(skia_dir)
-if not os.path.isfile('DEPS'):
- sys.stderr.write('DEPS file missing')
+if 0 != subprocess.call(['python', 'bin/sync'] + sys.argv[1:]):
+ sys.stderr.write('sync failed.')
exit(1)
-deps_hasher = hashlib.sha1()
-with open('DEPS', 'r') as f:
- deps_hasher.update(f.read())
-deps_hasher.update(repr(skia_opt_deps))
-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()
-
-default_gclient_config = '''
-solutions = [
- { "name" : ".",
- "url" : "https://skia.googlesource.com/skia.git",
- "deps_file" : "DEPS",
- "managed" : False,
- "custom_deps" : {
- },
- "safesync_url": "",
- },
-]
-cache_dir = None
-'''
-
-# Must use gclient.bat rather than gclient on windows (at least on mingw)
-gclient = 'gclient'
-if sys.platform == 'win32' or sys.platform == 'cygwin':
- gclient = 'gclient.bat'
-
-if current_deps_hash != deps_hash:
- # `gclient sync` is very slow, so skip whenever we can.
- try:
- subprocess.call([gclient, '--version'])
- except:
- sys.stdout.write('gclient missing from $PATH, please install ' +
- 'depot_tools\n https://skia.org/user/quick/desktop\n')
- exit(1)
- if not os.path.isfile('.gclient'):
- with open('.gclient', 'w') as o:
- o.write(default_gclient_config)
- gclient_sync_command = [gclient, 'sync'] + skia_opt_deps
- try:
- sys.stdout.write('%r\n' % gclient_sync_command)
- subprocess.check_call(gclient_sync_command)
- except:
- sys.stderr.write('\n`gclient sync` failed.\n')
- try:
- os.remove('.deps_sha1') # Unknown state.
- except:
- pass
- exit(1)
- # Only write hash after a successful sync.
- with open('.deps_sha1', 'w') as o:
- o.write(deps_hash)
-
hasher = hashlib.sha1()
for var in ['AR', 'AR_host', 'AR_target',
« no previous file with comments | « bin/sync ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698