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

Unified Diff: scripts/slave/bot_update.py

Issue 1241323004: Cross-repo recipe package system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: PRESUBMIT-related touchups 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
Index: scripts/slave/bot_update.py
diff --git a/scripts/slave/bot_update.py b/scripts/slave/bot_update.py
index b1aacdeb7031747f56772b5bc684124e3adb2ccd..4d6542967669e159a20c8841275e75ff08a70472 100755
--- a/scripts/slave/bot_update.py
+++ b/scripts/slave/bot_update.py
@@ -41,9 +41,25 @@ THIS_DIR = path.dirname(path.abspath(__file__))
SCRIPTS_DIR = path.dirname(THIS_DIR)
BUILD_DIR = path.dirname(SCRIPTS_DIR)
ROOT_DIR = path.dirname(BUILD_DIR)
-BUILD_INTERNAL_DIR = path.join(ROOT_DIR, 'build_internal')
DEPOT_TOOLS_DIR = path.join(ROOT_DIR, 'depot_tools')
+# TODO(luqui): This is a horrible hack to identify build_internal when build
+# is a recipe dependency. bot_update should not be depending on internal,
+# rather the arrow should go the other way (or just be destroyed).
+def check_build_internal(d):
+ d = path.abspath(d)
+ if path.basename(d) == 'build_internal' and path.isdir(d):
+ return d
+ else:
+ return None
+
+BUILD_INTERNAL_DIR = (
+ check_build_internal(path.join(ROOT_DIR, 'build_internal')) or
+ check_build_internal(path.join(ROOT_DIR, # .recipe_deps
+ path.pardir, # slave
+ path.pardir, # scripts
+ path.pardir))) # build_internal
+
CHROMIUM_GIT_HOST = 'https://chromium.googlesource.com'
CHROMIUM_SRC_URL = CHROMIUM_GIT_HOST + '/chromium/src.git'
@@ -186,7 +202,7 @@ cache_dir = r%(cache_dir)s
internal_data = {}
-if os.path.isdir(BUILD_INTERNAL_DIR):
+if BUILD_INTERNAL_DIR:
local_vars = {}
try:
execfile(os.path.join(
@@ -315,7 +331,12 @@ if sys.platform.startswith('win'):
# Find the patch tool.
if sys.platform.startswith('win'):
- PATCH_TOOL = path.join(BUILD_INTERNAL_DIR, 'tools', 'patch.EXE')
+ if not BUILD_INTERNAL_DIR:
+ print 'Warning: could not find patch tool because there is no '
+ print 'build_internal present.'
+ PATCH_TOOL = None
+ else:
+ PATCH_TOOL = path.join(BUILD_INTERNAL_DIR, 'tools', 'patch.EXE')
else:
PATCH_TOOL = '/usr/bin/patch'

Powered by Google App Engine
This is Rietveld 408576698