class Pakfire(object):
mode = None
- def __init__(self, path="/", arch=None):
+ def __init__(self, path="/", arch=None, distro=None):
# The path where we are operating in
self.path = path
# Default to system architecture
self.arch = arch or system.arch
+ # Default to system distribution
+ self.distro = distro or system.distro
+
# Check if we are operating as the root user
self.check_root_user()
# 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"))
-
self.pool = satsolver.Pool(self.arch.name)
self.repos = repository.Repositories(self)
import tempfile
from . import arch
+from . import distro
from . import shell
from . import _pakfire
the system this software is running on.
"""
def __init__(self):
+ # Load the system's native architecture
self.arch = arch.Arch(self.native_arch)
+ # Load the system's distribution
+ self.distro = distro.Distribution()
+
@property
def hostname(self):
hn = socket.gethostname()
return hn
- @property
- def distro(self):
- if not hasattr(self, "_distro"):
- from . import distro
- self._distro = distro.Distribution()
-
- return self._distro
-
@property
def native_arch(self):
"""