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

Unified Diff: bin/chromite

Issue 6312167: In the chroot, don't do any path mucking. Just run chromite. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/chromite.git@master
Patch Set: Created 9 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bin/chromite
diff --git a/bin/chromite b/bin/chromite
index b632b610b038b9127d39283d5ef44923f2c002d4..48b09070c3b658c8867ce211d73e0bd987606234 100755
--- a/bin/chromite
+++ b/bin/chromite
@@ -30,19 +30,23 @@ import sys
def Search(path):
"""Return an iterator of lists of places to look for chromite."""
- # Look in $CROS_WORKON_SRCROOT first.
- if 'CROS_WORKON_SRCROOT' in os.environ:
- yield [os.environ['CROS_WORKON_SRCROOT']]
+ if os.path.exists('/etc/debian_chroot'):
+ # We're in the chroot. Chromite should be in the python path inside the
+ # chroot, so we don't do any searching. NOTE that we purposely don't want
+ # CROS_WORKON_SRCROOT in the python path.
+ yield []
+ else:
+ # Look in $CROS_WORKON_SRCROOT first. The idea is that a user would set
+ # this manually if they wanted to specify a particular version of chromite.
+ if 'CROS_WORKON_SRCROOT' in os.environ:
+ yield [os.environ['CROS_WORKON_SRCROOT']]
- # Try the path as is
- yield []
-
- # Search upward until we either end up with a blank dir or the "parent" dir
- # doesn't change.
- prev_path = None
- while path and path != prev_path:
- yield [path]
- path, prev_path = os.path.dirname(path), path
+ # Search upward until we either end up with a blank dir or the "parent" dir
+ # doesn't change.
+ prev_path = None
+ while path and path != prev_path:
+ yield [path]
+ path, prev_path = os.path.dirname(path), path
for path in Search(os.getcwd()):
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698