ret.append(" %-16s: %s" % (_("CPU model"), system.cpu_model))
ret.append(" %-16s: %s" % (_("Memory"), util.format_size(system.memory)))
ret.append("")
- ret.append(" %-16s: %s" % (_("Native arch"), system.arch))
+ ret.append(" %-16s: %s" % (_("Native arch"), system.native_arch))
+ if not system.arch == system.native_arch:
+ ret.append(" %-16s: %s" % (_("Default arch"), system.arch))
header = _("Supported arches")
for arch in system.supported_arches:
from errors import ConfigError
from repository import Repositories
+from system import system
class Distribution(object):
def __init__(self, pakfire, distro_config=None):
self.pakfire = pakfire
self._data = {
- "arch" : self.config.host_arch,
+ "arch" : system.arch,
"name" : "unknown",
"slogan" : "---",
"vendor" : "unknown",
def hostname(self):
return socket.gethostname()
+ @property
+ def native_arch(self):
+ """
+ Return the native architecture of the host we
+ are running on.
+ """
+ return os.uname()[4]
+
@property
def arch(self):
"""
Return the architecture of the host we are running on.
"""
- return os.uname()[4]
+ if not self.native_arch in self.supported_arches:
+ return self.supported_arches[0]
+
+ return self.native_arch
@property
def supported_arches(self):
# ARM
"armv5tel" : ["armv5tel",],
"armv5tejl" : ["armv5tel",],
- "armv7l" : ["armv5tel",],
+ "armv7l" : ["armv7hl", "armv5tel",],
"armv7hl" : ["armv7hl", "armv5tel",],
}
try:
- return host_can_build[self.arch]
+ return host_can_build[self.native_arch]
except KeyError:
return []