Bug 1356541 - Avoid MOZBUILD_STATE_PATH prompt on automation. r?gps draft
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 14 Apr 2017 20:20:52 +0900
changeset 562832 6dc98b3adcdd7a789088962a8660e82201dcd3ab
parent 562355 3243c8fc3ce7831dda843b60d6bb2d7e4acf1fd4
child 624333 9309390afb9d2817eea8f20afefaf8074055b912
push id54137
push userbmo:mh+mozilla@glandium.org
push dateFri, 14 Apr 2017 11:22:34 +0000
reviewersgps
bugs1356541
milestone55.0a1
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