def getTargetArch(flavor, currentArch = None): if currentArch is None: currentArch = Flavor() currentArch.addDep(deps.InstructionSetDependency, arch.currentArch[0][0]) setArch = False currentArchName = [ x.name for x in currentArch.iterDepsByClass(deps.InstructionSetDependency) ] assert(len(currentArchName) == 1) currentArchName = currentArchName[0] archNames = [ x.name for x in flavor.iterDepsByClass(deps.InstructionSetDependency) ] if len(archNames) > 1: raise RuntimeError, 'Cannot build trove with two architectures' if not archNames: return False, None targetArch = archNames[0] if targetArch != currentArchName: if targetArch in setArchOk.get(currentArchName, []): setArch = True return setArch, targetArch else: return False, None
def getTargetArch(flavor, currentArch=None): if currentArch is None: currentArch = Flavor() currentArch.addDep(deps.InstructionSetDependency, arch.currentArch[0][0]) setArch = False currentArchName = [ x.name for x in currentArch.iterDepsByClass(deps.InstructionSetDependency) ] assert (len(currentArchName) == 1) currentArchName = currentArchName[0] archNames = [ x.name for x in flavor.iterDepsByClass(deps.InstructionSetDependency) ] if len(archNames) > 1: raise RuntimeError, 'Cannot build trove with two architectures' if not archNames: return False, None targetArch = archNames[0] if targetArch != currentArchName: if targetArch in setArchOk.get(currentArchName, []): setArch = True return setArch, targetArch else: return False, None