From 48ef397191e69b59aa9899ad16727dee28fe7283 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Fri, 10 Jun 2016 09:41:59 -0700 Subject: [PATCH] Bug 1279564 - Use get_state_dir() from mozboot; r=glandium Import mozboot.util and use the function from there. MozReview-Commit-ID: B0uzpNff1t9 --HG-- extra : rebase_source : 161b944cfa8a0f74c395af17d121e0bdf4ffe0b2 extra : amend_source : 40dc50cade12cf1dcc7966c3ec514807ee746d82 --- build/mach_bootstrap.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/build/mach_bootstrap.py b/build/mach_bootstrap.py index 8d0cff0db647..3877361e50ae 100644 --- a/build/mach_bootstrap.py +++ b/build/mach_bootstrap.py @@ -176,21 +176,6 @@ CATEGORIES = { TELEMETRY_SUBMISSION_FREQUENCY = 10 -def get_state_dir(): - """Obtain the path to a directory to hold state. - - Returns a tuple of the path and a bool indicating whether the value came - from an environment variable. - """ - state_user_dir = os.path.expanduser('~/.mozbuild') - state_env_dir = os.environ.get('MOZBUILD_STATE_PATH', None) - - if state_env_dir: - return state_env_dir, True - else: - return state_user_dir, False - - def bootstrap(topsrcdir, mozilla_dir=None): if mozilla_dir is None: mozilla_dir = topsrcdir @@ -213,6 +198,7 @@ def bootstrap(topsrcdir, mozilla_dir=None): # like surprises. sys.path[0:0] = [os.path.join(mozilla_dir, path) for path in SEARCH_PATHS] import mach.main + from mozboot.util import get_state_dir def telemetry_handler(context, data): # We have not opted-in to telemetry