36
36
37
37
chromium_channel_json_url = 'https://omahaproxy.appspot.com/all.json'
38
38
39
+ shallow_git_depth_limit = ''
40
+ shallow_gclient_no_history = ''
41
+
42
+ if os .environ .get ('SHALLOW' ) == '1' :
43
+ shallow_gclient_no_history = '--no-history'
44
+ shallow_git_depth_limit = '--depth 1'
45
+
46
+
39
47
##
40
48
# Global system variables.
41
49
##
@@ -182,7 +190,7 @@ def download_and_extract(src, target):
182
190
""" Extracts the contents of src, which may be a URL or local file, to the
183
191
target directory. """
184
192
temporary = False
185
-
193
+ sys . stdout . write ( "-------- downloading and extracting \" %s \" to \" %s \" ... \n " % ( src , target ))
186
194
if src [:4 ] == 'http' :
187
195
# Attempt to download a URL.
188
196
opener = FancyURLopener ({})
@@ -1181,7 +1189,7 @@ def check_pattern_matches(output_file=None):
1181
1189
# Create the CEF checkout if necessary.
1182
1190
if not options .nocefupdate and not os .path .exists (cef_dir ):
1183
1191
cef_checkout_new = True
1184
- run ('%s clone %s %s' % (git_exe , cef_url , cef_dir ), download_dir ,
1192
+ run ('%s clone %s %s %s ' % (git_exe , shallow_git_depth_limit , cef_url , cef_dir ), download_dir ,
1185
1193
depot_tools_dir )
1186
1194
else :
1187
1195
cef_checkout_new = False
@@ -1191,8 +1199,8 @@ def check_pattern_matches(output_file=None):
1191
1199
cef_current_hash = get_git_hash (cef_dir , 'HEAD' )
1192
1200
1193
1201
if not cef_checkout_new :
1194
- # Fetch updated sources.
1195
- run ('%s fetch' % (git_exe ), cef_dir , depot_tools_dir )
1202
+ # fetch --depth 1 updated sources.
1203
+ run ('%s fetch %s ' % (git_exe , shallow_git_depth_limit ), cef_dir , depot_tools_dir )
1196
1204
1197
1205
cef_desired_hash = get_git_hash (cef_dir , cef_checkout )
1198
1206
cef_checkout_changed = cef_checkout_new or force_change or \
@@ -1287,7 +1295,7 @@ def check_pattern_matches(output_file=None):
1287
1295
# Initial Chromium checkout.
1288
1296
if not options .nochromiumupdate and not os .path .exists (chromium_src_dir ):
1289
1297
chromium_checkout_new = True
1290
- run ("gclient sync --nohooks --with_branch_heads --jobs 16" , \
1298
+ run ("gclient sync " + shallow_gclient_no_history + " --nohooks --with_branch_heads --jobs 16" , \
1291
1299
chromium_dir , depot_tools_dir )
1292
1300
else :
1293
1301
chromium_checkout_new = False
@@ -1299,13 +1307,13 @@ def check_pattern_matches(output_file=None):
1299
1307
if os .path .exists (chromium_src_dir ):
1300
1308
msg ("Chromium URL: %s" % (get_git_url (chromium_src_dir )))
1301
1309
1302
- # Fetch Chromium changes so that we can perform the necessary calculations using
1310
+ # fetch Chromium changes so that we can perform the necessary calculations using
1303
1311
# local history.
1304
1312
if not options .nochromiumupdate and os .path .exists (chromium_src_dir ):
1305
- # Fetch updated sources.
1306
- run ("%s fetch" % (git_exe ), chromium_src_dir , depot_tools_dir )
1313
+ # fetch --depth 1 updated sources.
1314
+ run ("%s fetch %s " % (git_exe , shallow_git_depth_limit ), chromium_src_dir , depot_tools_dir )
1307
1315
# Also fetch tags, which are required for release branch builds.
1308
- run ("%s fetch --tags" % (git_exe ), chromium_src_dir , depot_tools_dir )
1316
+ run ("%s fetch %s --tags" % (git_exe , shallow_git_depth_limit ), chromium_src_dir , depot_tools_dir )
1309
1317
1310
1318
# Determine the Chromium checkout options required by CEF.
1311
1319
chromium_compat_version = build_compat_versions ['chromium_checkout' ]
@@ -1375,7 +1383,7 @@ def check_pattern_matches(output_file=None):
1375
1383
apply_deps_patch ()
1376
1384
1377
1385
# Update third-party dependencies including branch/tag information.
1378
- run ("gclient sync %s--nohooks --with_branch_heads --jobs 16" % \
1386
+ run ("gclient sync " + shallow_gclient_no_history + " %s--nohooks --with_branch_heads --jobs 16" % \
1379
1387
('--reset ' if discard_local_changes else '' ), chromium_dir , depot_tools_dir )
1380
1388
1381
1389
# Patch the Chromium runhooks scripts if necessary.
0 commit comments