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

Unified Diff: buildutil.py

Issue 6591116: devserver: scripts_dir detection that also works outside the chroot (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: 80 chars Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: buildutil.py
diff --git a/buildutil.py b/buildutil.py
index 29b89f9b88eb6b56340899021b5cfb335bf903a2..84af58eae169754e1689a604065c1834327a77cf 100644
--- a/buildutil.py
+++ b/buildutil.py
@@ -11,10 +11,16 @@ class BuildObject(object):
def __init__(self, root_dir, static_dir):
self.app_id = '87efface-864d-49a5-9bb3-4b050a7c227a'
self.root_dir = root_dir
- self.scripts_dir = '%s/src/scripts' % os.environ['CROS_WORKON_SRCROOT']
self.devserver_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
self.static_dir = static_dir
self.x86_pkg_dir = '%s/build/x86/local_packages' % self.root_dir
+ try:
+ self.scripts_dir = '%s/src/scripts' % os.environ['CROS_WORKON_SRCROOT']
+ except KeyError:
+ # Outside of chroot: This is a corner case. Since we live either in
+ # platform/dev or /usr/bin/, scripts have to live in ../../../src/scripts
+ self.scripts_dir = os.path.abspath(os.path.join(
+ self.devserver_dir, '../../../src/scripts'))
def AssertSystemCallSuccess(self, err, cmd='unknown'):
"""
« 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