Bug 896379 - Fix build bootstrapper on fresh OS X installs; r=bsmedberg
authorGregory Szorc <gps@mozilla.com>
Tue, 23 Jul 2013 10:23:47 -0700
changeset 164959 ac848ab26ba860b13dd37920b5ebc31c9a511d3c
parent 164958 4e60867ca4ab0af46a259a2c2756ae96dc3fa39a
child 164960 e0daf4f7c6659949ad084189d37252fc4e392aec
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs896379
milestone27.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 896379 - Fix build bootstrapper on fresh OS X installs; r=bsmedberg DONTBUILD (NPOTB)
python/mozboot/mozboot/base.py
python/mozboot/mozboot/osx.py
--- a/python/mozboot/mozboot/base.py
+++ b/python/mozboot/mozboot/base.py
@@ -252,16 +252,19 @@ class BaseBootstrapper(object):
 
     def ensure_python_modern(self):
         modern, version = self.is_python_modern()
 
         if modern:
             print('Your version of Python (%s) is new enough.' % version)
             return
 
+        print('Your version of Python (%s) is too old. Will try to upgrade.' %
+            version)
+
         self._ensure_package_manager_updated()
         self.upgrade_python(version)
 
         modern, after = self.is_python_modern()
 
         if not modern:
             print(PYTHON_UPGRADE_FAILED % (MODERN_PYTHON_VERSION, after))
             sys.exit(1)
--- a/python/mozboot/mozboot/osx.py
+++ b/python/mozboot/mozboot/osx.py
@@ -370,17 +370,22 @@ class OSXBootstrapper(BaseBootstrapper):
         else:
             assert self.package_manager == 'macports'
             self.run_as_root([self.port, 'selfupdate'])
 
     def _upgrade_package(self, package):
         self._ensure_package_manager_updated()
 
         if self.package_manager == 'homebrew':
-            subprocess.check_call([self.brew, '-v', 'upgrade', package])
+            try:
+                subprocess.check_output([self.brew, '-v', 'upgrade', package],
+                    stderr=subprocess.STDOUT)
+            except subprocess.CalledProcessError as e:
+                if 'already installed' not in e.output:
+                    raise
         else:
             assert self.package_manager == 'macports'
 
             self.run_as_root([self.port, 'upgrade', package])
 
     def upgrade_mercurial(self, current):
         self._upgrade_package('mercurial')