be more tolerant when parsing new specs.
This commit is contained in:
parent
c90cc465f5
commit
f3d6818d5c
@ -526,7 +526,12 @@ def _add_flag(self, name, value):
|
|||||||
"""
|
"""
|
||||||
valid_flags = FlagMap.valid_compiler_flags()
|
valid_flags = FlagMap.valid_compiler_flags()
|
||||||
if name == 'arch' or name == 'architecture':
|
if name == 'arch' or name == 'architecture':
|
||||||
platform, op_sys, target = value.split('-')
|
parts = value.split('-')
|
||||||
|
if len(parts) == 3:
|
||||||
|
platform, op_sys, target = parts
|
||||||
|
else:
|
||||||
|
platform, op_sys, target = None, None, value
|
||||||
|
|
||||||
assert(self.architecture.platform is None)
|
assert(self.architecture.platform is None)
|
||||||
assert(self.architecture.platform_os is None)
|
assert(self.architecture.platform_os is None)
|
||||||
assert(self.architecture.target is None)
|
assert(self.architecture.target is None)
|
||||||
@ -596,11 +601,13 @@ def _set_platform(self, value):
|
|||||||
|
|
||||||
def _set_os(self, value):
|
def _set_os(self, value):
|
||||||
"""Called by the parser to set the architecture operating system"""
|
"""Called by the parser to set the architecture operating system"""
|
||||||
self.architecture.platform_os = self.architecture.platform.operating_system(value)
|
if self.architecture.platform:
|
||||||
|
self.architecture.platform_os = self.architecture.platform.operating_system(value)
|
||||||
|
|
||||||
def _set_target(self, value):
|
def _set_target(self, value):
|
||||||
"""Called by the parser to set the architecture target"""
|
"""Called by the parser to set the architecture target"""
|
||||||
self.architecture.target = self.architecture.platform.target(value)
|
if self.architecture.platform:
|
||||||
|
self.architecture.target = self.architecture.platform.target(value)
|
||||||
|
|
||||||
def _add_dependency(self, spec):
|
def _add_dependency(self, spec):
|
||||||
"""Called by the parser to add another spec as a dependency."""
|
"""Called by the parser to add another spec as a dependency."""
|
||||||
@ -1063,7 +1070,7 @@ def feq(cfield, sfield):
|
|||||||
feq(replacement.architecture, spec.architecture) and
|
feq(replacement.architecture, spec.architecture) and
|
||||||
feq(replacement.dependencies, spec.dependencies) and
|
feq(replacement.dependencies, spec.dependencies) and
|
||||||
feq(replacement.variants, spec.variants) and
|
feq(replacement.variants, spec.variants) and
|
||||||
feq(replacement.external, spec.external) and
|
feq(replacement.external, spec.external) and
|
||||||
feq(replacement.external_module, spec.external_module)):
|
feq(replacement.external_module, spec.external_module)):
|
||||||
continue
|
continue
|
||||||
# Refine this spec to the candidate. This uses
|
# Refine this spec to the candidate. This uses
|
||||||
@ -1468,7 +1475,7 @@ def constrain(self, other, deps=True):
|
|||||||
if self.architecture.target != other.architecture.target:
|
if self.architecture.target != other.architecture.target:
|
||||||
raise UnsatisfiableArchitectureSpecError(self.architecture,
|
raise UnsatisfiableArchitectureSpecError(self.architecture,
|
||||||
other.architecture)
|
other.architecture)
|
||||||
|
|
||||||
|
|
||||||
changed = False
|
changed = False
|
||||||
if self.compiler is not None and other.compiler is not None:
|
if self.compiler is not None and other.compiler is not None:
|
||||||
@ -1619,7 +1626,7 @@ def satisfies(self, other, deps=True, strict=False):
|
|||||||
# Architecture satisfaction is currently just string equality.
|
# Architecture satisfaction is currently just string equality.
|
||||||
# If not strict, None means unconstrained.
|
# If not strict, None means unconstrained.
|
||||||
if self.architecture and other.architecture:
|
if self.architecture and other.architecture:
|
||||||
if ((self.architecture.platform and other.architecture.platform and self.architecture.platform != other.architecture.platform) or
|
if ((self.architecture.platform and other.architecture.platform and self.architecture.platform != other.architecture.platform) or
|
||||||
(self.architecture.platform_os and other.architecture.platform_os and self.architecture.platform_os != other.architecture.platform_os) or
|
(self.architecture.platform_os and other.architecture.platform_os and self.architecture.platform_os != other.architecture.platform_os) or
|
||||||
(self.architecture.target and other.architecture.target and self.architecture.target != other.architecture.target)):
|
(self.architecture.target and other.architecture.target and self.architecture.target != other.architecture.target)):
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user