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

Unified Diff: build/find_depot_tools.py

Issue 1408123011: Use find_depot_tools.py and vs_toolchain.py from chromium/src/build/ (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 5 years, 2 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 | « DEPS ('k') | build/vs_toolchain.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/find_depot_tools.py
diff --git a/build/find_depot_tools.py b/build/find_depot_tools.py
deleted file mode 100644
index 24a6ed9e04ea7e200aa2295bacf03a4a0ca9654a..0000000000000000000000000000000000000000
--- a/build/find_depot_tools.py
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/python
-# Copyright (c) 2011 The Native Client Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-"""Small utility to find depot_tools."""
-
-import os
-import sys
-
-
-def _IsRealDepotTools(path):
- return os.path.isfile(os.path.join(path, 'gclient'))
-
-
-def FindDepotTools():
- """Search for depot_tools and return its path."""
- # First look if depot_tools is already in PYTHONPATH.
- for i in sys.path:
- if i.rstrip(os.sep).endswith('depot_tools') and _IsRealDepotTools(i):
- return i
- # Then look if depot_tools is in PATH, common case.
- for i in os.environ['PATH'].split(os.pathsep):
- if _IsRealDepotTools(i):
- return i.rstrip(os.sep)
- # Rare case, it's not even in PATH, look upward up to root.
- root_dir = os.path.dirname(os.path.abspath(__file__))
- previous_dir = os.path.abspath(__file__)
- while root_dir and root_dir != previous_dir:
- i = os.path.join(root_dir, 'depot_tools')
- if _IsRealDepotTools(i):
- return i
- previous_dir = root_dir
- root_dir = os.path.dirname(root_dir)
- return None
-
-
-def main():
- path = FindDepotTools()
- if not path:
- print >> sys.stderr, 'Failed to find depot_tools'
- return 1
- print path
- return 0
-
-
-if __name__ == '__main__':
- sys.exit(main())
« no previous file with comments | « DEPS ('k') | build/vs_toolchain.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698