Bug 1356541 - Avoid MOZBUILD_STATE_PATH prompt on automation. r=gps
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 14 Apr 2017 20:20:52 +0900
changeset 353216 c332c0a3a67a429fecceb2381c42269b08477691
parent 353215 04bda21f77ae49e6fd47c54b49474dc7f7c7daea
child 353217 97a254965abda5387afe2a9d708bd8c31c81e776
push id31660
push userarchaeopteryx@coole-files.de
push dateSat, 15 Apr 2017 17:57:59 +0000
treeherdermozilla-central@ed88aa504601 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1356541
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1356541 - Avoid MOZBUILD_STATE_PATH prompt on automation. r=gps
build/mach_bootstrap.py
--- a/build/mach_bootstrap.py
+++ b/build/mach_bootstrap.py
@@ -307,21 +307,22 @@ def bootstrap(topsrcdir, mozilla_dir=Non
             state_dir, is_environ = get_state_dir()
             if is_environ:
                 if not os.path.exists(state_dir):
                     print('Creating global state directory from environment variable: %s'
                           % state_dir)
                     os.makedirs(state_dir, mode=0o770)
             else:
                 if not os.path.exists(state_dir):
-                    print(STATE_DIR_FIRST_RUN.format(userdir=state_dir))
-                    try:
-                        sys.stdin.readline()
-                    except KeyboardInterrupt:
-                        sys.exit(1)
+                    if not os.environ.get('MOZ_AUTOMATION'):
+                        print(STATE_DIR_FIRST_RUN.format(userdir=state_dir))
+                        try:
+                            sys.stdin.readline()
+                        except KeyboardInterrupt:
+                            sys.exit(1)
 
                     print('\nCreating default state directory: %s' % state_dir)
                     os.makedirs(state_dir, mode=0o770)
 
             return state_dir
 
         if key == 'topdir':
             return topsrcdir