mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1208160 - Show information when Xcode requires accepting license agreement; r=gps
--HG-- extra : commitid : BWWqCvms3dQ extra : amend_source : 0554ce0ec72683864a07ebbbd1c11bbde0b6c233
This commit is contained in:
parent
dd52016aa0
commit
5352886b99
@ -595,36 +595,45 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
def _make_path(self):
|
||||
baseconfig = os.path.join(self.topsrcdir, 'config', 'baseconfig.mk')
|
||||
|
||||
def is_xcode_lisense_error(output):
|
||||
return self._is_osx() and 'Agreeing to the Xcode' in output
|
||||
|
||||
def validate_make(make):
|
||||
if os.path.exists(baseconfig) and os.path.exists(make):
|
||||
cmd = [make, '-f', baseconfig]
|
||||
if self._is_windows():
|
||||
cmd.append('HOST_OS_ARCH=WINNT')
|
||||
try:
|
||||
subprocess.check_call(cmd, stdout=open(os.devnull, 'wb'),
|
||||
stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError:
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
subprocess.check_output(cmd, stderr=subprocess.STDOUT)
|
||||
except subprocess.CalledProcessError as e:
|
||||
return False, is_xcode_lisense_error(e.output)
|
||||
return True, False
|
||||
return False, False
|
||||
|
||||
xcode_lisense_error = False
|
||||
possible_makes = ['gmake', 'make', 'mozmake', 'gnumake']
|
||||
|
||||
if 'MAKE' in os.environ:
|
||||
make = os.environ['MAKE']
|
||||
if os.path.isabs(make):
|
||||
if validate_make(make):
|
||||
return [make]
|
||||
else:
|
||||
possible_makes.insert(0, make)
|
||||
possible_makes.insert(0, make)
|
||||
|
||||
for test in possible_makes:
|
||||
try:
|
||||
make = which.which(test)
|
||||
except which.WhichError:
|
||||
continue
|
||||
if validate_make(make):
|
||||
if os.path.isabs(test):
|
||||
make = test
|
||||
else:
|
||||
try:
|
||||
make = which.which(test)
|
||||
except which.WhichError:
|
||||
continue
|
||||
result, xcode_lisense_error_tmp = validate_make(make)
|
||||
if result:
|
||||
return [make]
|
||||
if xcode_lisense_error_tmp:
|
||||
xcode_lisense_error = True
|
||||
|
||||
if xcode_lisense_error:
|
||||
raise Exception('Xcode requires accepting to the license agreement.\n'
|
||||
'Please run Xcode and accept the license agreement.')
|
||||
|
||||
if self._is_windows():
|
||||
raise Exception('Could not find a suitable make implementation.\n'
|
||||
@ -641,6 +650,9 @@ class MozbuildObject(ProcessExecutionMixin):
|
||||
def _is_windows(self):
|
||||
return os.name in ('nt', 'ce')
|
||||
|
||||
def _is_osx(self):
|
||||
return 'darwin' in str(sys.platform).lower()
|
||||
|
||||
def _spawn(self, cls):
|
||||
"""Create a new MozbuildObject-derived class instance from ourselves.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user