зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1293253 - part 8 - factor out a unique binary check function; r=chmanchester
We'll need this for Rust programs as well.
This commit is contained in:
Родитель
0ffe72f61e
Коммит
0464790919
|
@ -540,14 +540,16 @@ class TreeMetadataEmitter(LoggingMixin):
|
|||
else:
|
||||
linkables.append(prog)
|
||||
|
||||
def check_unique_binary(program, kind):
|
||||
if program in self._binaries:
|
||||
raise SandboxValidationError(
|
||||
'Cannot use "%s" as %s name, '
|
||||
'because it is already used in %s' % (program, kind,
|
||||
self._binaries[program].relativedir), context)
|
||||
for kind, cls in [('PROGRAM', Program), ('HOST_PROGRAM', HostProgram)]:
|
||||
program = context.get(kind)
|
||||
if program:
|
||||
if program in self._binaries:
|
||||
raise SandboxValidationError(
|
||||
'Cannot use "%s" as %s name, '
|
||||
'because it is already used in %s' % (program, kind,
|
||||
self._binaries[program].relativedir), context)
|
||||
check_unique_binary(program, kind)
|
||||
self._binaries[program] = cls(context, program)
|
||||
self._linkage.append((context, self._binaries[program],
|
||||
kind.replace('PROGRAM', 'USE_LIBS')))
|
||||
|
|
Загрузка…
Ссылка в новой задаче