Bug 1251352 - Respect --no-interactive during Arch bootstrap; r=gps
authorQuentin Headen <qheaden@phaseshiftsoftware.com>
Thu, 25 Feb 2016 11:47:58 -0800
changeset 321967 5f2b6a81e84a0a88ad514809d8f0dd60fcdbf21a
parent 321966 e31a46d4675f6f50f9b4b74e61f80e6a93d778f3
child 321968 8fc40777e0aaa781847a4d8de225dbd951d68dbd
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs1251352
milestone47.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 1251352 - Respect --no-interactive during Arch bootstrap; r=gps
python/mozboot/mozboot/archlinux.py
--- a/python/mozboot/mozboot/archlinux.py
+++ b/python/mozboot/mozboot/archlinux.py
@@ -132,16 +132,19 @@ class ArchlinuxBootstrapper(BaseBootstra
     def upgrade_mercurial(self, current):
         self.pacman_install('mercurial')
 
     def upgrade_python(self, current):
         self.pacman_install('python2')
 
     def pacman_install(self, *packages):
         command = ['pacman', '-S', '--needed']
+        if self.no_interactive:
+            command.append('--noconfirm')
+
         command.extend(packages)
 
         self.run_as_root(command)
 
     def pacman_update(self):
         command = ['pacman', '-S', '--refresh']
 
         self.run_as_root(command)
@@ -169,23 +172,24 @@ class ArchlinuxBootstrapper(BaseBootstra
         command = ['makepkg', '-s']
         self.run(command)
         pack = glob.glob(name + '*.tar.xz')[0]
         command = ['pacman', '-U', pack]
         self.run_as_root(command)
 
     def aur_install(self, *packages):
         path = tempfile.mkdtemp()
-        print('WARNING! This script requires to install packages from the AUR '
-              'This is potentially unsecure so I recommend that you carefully '
-              'read each package description and check the sources.'
-              'These packages will be built in ' + path + '.')
-        choice = raw_input('Do you want to continue? (yes/no) [no]')
-        if choice != 'yes':
-            sys.exit(1)
+        if not self.no_interactive:
+            print('WARNING! This script requires to install packages from the AUR '
+                  'This is potentially unsecure so I recommend that you carefully '
+                  'read each package description and check the sources.'
+                  'These packages will be built in ' + path + '.')
+            choice = raw_input('Do you want to continue? (yes/no) [no]')
+            if choice != 'yes':
+                sys.exit(1)
 
         base_dir = os.getcwd()
         os.chdir(path)
         for package in packages:
             name, _, ext = package.split('/')[-1].split('.')
             directory = os.path.join(path, name)
             self.download(package)
             self.unpack(path, name, ext)