From 3ce9b4446dec24fc18bbcdc3e3fde4cc2e27199d Mon Sep 17 00:00:00 2001 From: "martiniss@chromium.org" Date: Tue, 8 Mar 2016 06:02:54 +0000 Subject: [PATCH] Make CACHE_DIR set by default in most gclient configs. This is needed because bot_update changed from getting the cache directory from the global path module to the gclient config. BUG=589140 Review URL: https://codereview.chromium.org/1768893003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@299143 0039d316-1c4b-4281-b951-d872f2087c98 --- recipe_modules/gclient/api.py | 7 +++---- recipe_modules/gclient/config.py | 2 +- recipe_modules/gclient/example.expected/basic.json | 2 +- recipe_modules/gclient/example.expected/revision.json | 2 +- recipe_modules/gclient/example.expected/tryserver.json | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/recipe_modules/gclient/api.py b/recipe_modules/gclient/api.py index 1b705d5b35..98100c2058 100644 --- a/recipe_modules/gclient/api.py +++ b/recipe_modules/gclient/api.py @@ -126,11 +126,10 @@ class GclientApi(recipe_api.RecipeApi): self._spec_alias = None def get_config_defaults(self): - ret = { - 'USE_MIRROR': self.use_mirror + return { + 'USE_MIRROR': self.use_mirror, + 'CACHE_DIR': self.m.path['git_cache'], } - ret['CACHE_DIR'] = self.m.path['root'].join('git_cache') - return ret def resolve_revision(self, revision): if hasattr(revision, 'resolve'): diff --git a/recipe_modules/gclient/config.py b/recipe_modules/gclient/config.py index b8152734b1..c300edd506 100644 --- a/recipe_modules/gclient/config.py +++ b/recipe_modules/gclient/config.py @@ -14,7 +14,7 @@ def BaseConfig(USE_MIRROR=True, GIT_MODE=False, CACHE_DIR=None, PATCH_PROJECT=None, BUILDSPEC_VERSION=None, **_kwargs): deps = '.DEPS.git' if GIT_MODE else 'DEPS' - cache_dir = str(CACHE_DIR) if GIT_MODE and CACHE_DIR else None + cache_dir = str(CACHE_DIR) if CACHE_DIR else None return ConfigGroup( solutions = ConfigList( lambda: ConfigGroup( diff --git a/recipe_modules/gclient/example.expected/basic.json b/recipe_modules/gclient/example.expected/basic.json index 46c74809df..7e3481be47 100644 --- a/recipe_modules/gclient/example.expected/basic.json +++ b/recipe_modules/gclient/example.expected/basic.json @@ -89,7 +89,7 @@ "RECIPE_PACKAGE[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", "env": { diff --git a/recipe_modules/gclient/example.expected/revision.json b/recipe_modules/gclient/example.expected/revision.json index f954fd9c14..a3baf68b4d 100644 --- a/recipe_modules/gclient/example.expected/revision.json +++ b/recipe_modules/gclient/example.expected/revision.json @@ -91,7 +91,7 @@ "RECIPE_PACKAGE[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", "env": { diff --git a/recipe_modules/gclient/example.expected/tryserver.json b/recipe_modules/gclient/example.expected/tryserver.json index c4959cd37b..50df3d7a21 100644 --- a/recipe_modules/gclient/example.expected/tryserver.json +++ b/recipe_modules/gclient/example.expected/tryserver.json @@ -91,7 +91,7 @@ "RECIPE_PACKAGE[depot_tools]/gclient.py", "config", "--spec", - "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" + "cache_dir = '[GIT_CACHE]'\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", "env": {