From: Michael Tremer Date: Sat, 3 Dec 2016 18:10:14 +0000 (+0100) Subject: base: Move architecture to Pakfire class X-Git-Tag: 0.9.28~1285^2~1405 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14dcd4ba30d25e401884f4bc941c2482e482d649;p=pakfire.git base: Move architecture to Pakfire class This used to be located in Distribution but is actually not that closely tied with that. Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/base.py b/src/pakfire/base.py index 3ac045742..acd07a219 100644 --- a/src/pakfire/base.py +++ b/src/pakfire/base.py @@ -38,6 +38,8 @@ from . import util import logging log = logging.getLogger("pakfire") +from .system import system + from .constants import * from .i18n import _ @@ -45,29 +47,30 @@ class Pakfire(object): mode = None def __init__(self, path="/", arch=None): - # Check if we are operating as the root user. - self.check_root_user() - - # The path where we are operating in. + # The path where we are operating in self.path = path - # check if we are actually running on an ipfire system. + # Default to system architecture + self.arch = arch or system.arch + + # Check if we are operating as the root user + self.check_root_user() + + # check if we are actually running on an ipfire system if not self.mode and self.path == "/": self.check_is_ipfire() # Load configuration self.config = config.Config("general.conf") - # Initialize the keyring. + # Initialize the keyring self.keyring = keyring.Keyring(self) # Get more information about the distribution we are running # or building self.distro = distro.Distribution(self.config.get("distro")) - if arch: - self.distro.arch = arch - self.pool = satsolver.Pool(self.distro.arch) + self.pool = satsolver.Pool(self.arch.name) self.repos = repository.Repositories(self) def __enter__(self): @@ -87,10 +90,6 @@ class Pakfire(object): # Close repositories self.repos.shutdown() - @property - def supported_arches(self): - return system.supported_arches - @property def offline(self): """