]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Allow passing an individual configuration to a pakfire instance
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 20 May 2017 10:08:50 +0000 (12:08 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 20 May 2017 10:08:50 +0000 (12:08 +0200)
Handy for build environments that have a different configuration
than the host system

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/base.py

index bde775cf4db746a24bbd0fa50f48a188057692c7..6e9406cfbc723be907617e4c57bb2c673e6ebee6 100644 (file)
@@ -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)