From: Michael Tremer Date: Sat, 20 May 2017 10:08:50 +0000 (+0200) Subject: pakfire: Allow passing an individual configuration to a pakfire instance X-Git-Tag: 0.9.28~1285^2~1344 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36374696ec145910ceb95224359db89e24d6fd9d;p=pakfire.git pakfire: Allow passing an individual configuration to a pakfire instance Handy for build environments that have a different configuration than the host system Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/base.py b/src/pakfire/base.py index bde775cf4..6e9406cfb 100644 --- a/src/pakfire/base.py +++ b/src/pakfire/base.py @@ -39,6 +39,7 @@ from . import util import logging log = logging.getLogger("pakfire") +from .config import Config from .system import system from .constants import * @@ -47,7 +48,7 @@ from .i18n import _ class Pakfire(object): mode = None - def __init__(self, path="/", arch=None, distro=None, cache_path=None): + def __init__(self, path="/", config=None, arch=None, distro=None, cache_path=None): # The path where we are operating in self.path = path @@ -65,7 +66,7 @@ class Pakfire(object): self.check_is_ipfire() # Load configuration - self.config = config.Config("general.conf") + self.config = config or Config("general.conf") # Initialize the keyring self.keyring = keyring.Keyring(self)