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

Unified Diff: tools/observatory_tool.py

Issue 1343103002: Observatory build should try backup method if the SDK doesn't work. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | tools/run_pub.py » ('j') | tools/run_pub.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/observatory_tool.py
diff --git a/tools/observatory_tool.py b/tools/observatory_tool.py
index adf103fde62b31c32ee4ab930f40256ae9c9de62..ffc76df24ab34fc72c46c26c5c967e3b8d411d07 100755
--- a/tools/observatory_tool.py
+++ b/tools/observatory_tool.py
@@ -43,14 +43,20 @@ def ProcessOptions(options, args):
# Required options.
if (options.command == None) or (options.directory == None):
return False
- # If we have a pub executable, we are running from the dart-sdk.
- if (options.pub_executable != None):
- return True
if (options.sdk != None):
# Use the checked in pub executable by default.
options.pub_executable = utils.CheckedInPubPath()
- return True
- # Otherwise, we need a dart executable and a package root.
+ # If we have a working pub executable, we are running from the dart-sdk.
+ if (options.pub_executable != None):
+ try:
+ if utils.CheckedInSdkFixExecutable() and 0 == subprocess.call(
+ [options.pub_executable, '--version']):
+ return True
+ except OSError as e:
+ pass
+ # The pub executable didn't work, use the backup procedure.
+ options.pub_executable = None
+ # We need a dart executable and a package root.
return ((options.package_root != None) and
(options.dart_executable != None))
@@ -158,4 +164,4 @@ def main():
return ExecuteCommand(options, args)
if __name__ == '__main__':
- sys.exit(main());
+ sys.exit(main());
« no previous file with comments | « no previous file | tools/run_pub.py » ('j') | tools/run_pub.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698