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

Unified Diff: download_from_google_storage.py

Issue 104763003: Detect cygwin as Win32 for the purposes of running GN and downloading from google storage. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: Created 7 years 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 | gn.py » ('j') | gn.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: download_from_google_storage.py
===================================================================
--- download_from_google_storage.py (revision 238894)
+++ download_from_google_storage.py (working copy)
@@ -32,6 +32,14 @@
pass
+def GetNormalizedPlatform():
+ """Returns the result of sys.platform accounting for cygwin.
+ Under cygwin, this will always return "win32" like the native Python."""
+ if sys.platform == "cygwin":
M-A Ruel 2013/12/05 14:37:58 prefer single quotes to double quotes for strings.
+ return "win32"
+ return sys.platform
+
+
# Common utilities
class Gsutil(object):
"""Call gsutil with some predefined settings. This is a convenience object,
@@ -317,7 +325,7 @@
# Make sure we should run at all based on platform matching.
if options.platform:
- if not re.match(options.platform, sys.platform):
+ if not re.match(options.platform, GetNormalizedPlatform()):
if options.verbose:
print('The current platform doesn\'t match "%s", skipping.' %
options.platform)
« no previous file with comments | « no previous file | gn.py » ('j') | gn.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698