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

Unified Diff: build_tools/update_mirror.py

Issue 924093002: Removing presubmit from annotator. (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 10 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 | « build_tools/buildbot_selector.sh ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build_tools/update_mirror.py
diff --git a/build_tools/update_mirror.py b/build_tools/update_mirror.py
index 389dd4fb2dbba0016bc4ac08d880d34773bb8b62..bc26b5749421510b108aace73e0e2f879350927a 100755
--- a/build_tools/update_mirror.py
+++ b/build_tools/update_mirror.py
@@ -33,16 +33,16 @@ MIRROR_GS = 'gs://naclports/mirror'
def GsUpload(options, filename, url):
"""Upload a file to Google cloud storage using gsutil"""
naclports.Log("Uploading to mirror: %s" % url)
- cmd = ['gsutil', 'cp', '-a', 'public-read', filename, url]
+ cmd = [options.gsutil, 'cp', '-a', 'public-read', filename, url]
if options.dry_run:
naclports.Log(cmd)
else:
subprocess.check_call(cmd)
-def GetMirrorListing(url):
+def GetMirrorListing(options, url):
"""Get filename listing for a Google cloud storage URL"""
- listing = subprocess.check_output(['gsutil', 'ls', url])
+ listing = subprocess.check_output([options.gsutil, 'ls', url])
listing = listing.splitlines()
listing = [os.path.basename(l) for l in listing]
return listing
@@ -94,9 +94,15 @@ def main(args):
naclports.SetVerbose(options.verbose)
# Ensure gsutil is in the PATH.
- naclports.util.FindInPath('gsutil')
+ bot_gsutil = '/b/build/scripts/slave/gsutil'
+ if os.path.exists(bot_gsutil):
+ gsutil = bot_gsutil
+ else:
+ gsutil = 'gsutil'
+ naclports.util.FindInPath(gsutil)
+ options.gsutil = gsutil
- listing = GetMirrorListing(MIRROR_GS)
+ listing = GetMirrorListing(options, MIRROR_GS)
source_packages = naclports.source_package.SourcePackageIterator()
return CheckPackages(options, source_packages, listing)
« no previous file with comments | « build_tools/buildbot_selector.sh ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698