]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
bricklayer: Read Pakfire configuration and don't pass the path
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Mar 2025 17:55:39 +0000 (17:55 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 14 Mar 2025 17:55:39 +0000 (17:55 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/bricklayer
src/python/__init__.py

index ef04347a1fc25ff484b2d264b832b749d8f2fa93..8b75a9a2a8aabf1cface5b4e8bf4c4429dc47fe7 100644 (file)
@@ -40,7 +40,7 @@ class Cli(object):
                parser = argparse.ArgumentParser(
                        description=_("IPFire Installation Tool CLI"),
                )
-               parser.add_argument("--pakfire-conf", metavar=_("FILE"), type=argparse.FileType("r"),
+               parser.add_argument("--pakfire-config", metavar=_("FILE"), type=argparse.FileType("r"),
                        help=_("Pakfire Configuration file used for the installation process"))
                parser.add_argument("--first-install", action="store_true",
                        help=_("Runs the \"first install\" setup process"))
index cca3c9a7e14022d52df475055bc206e1d7118197..d35ba32025753405bca632928bf335e169bbea84 100644 (file)
@@ -47,10 +47,9 @@ class Bricklayer(object):
        """
                Bricklayer's base class
        """
-       def __init__(self, arch, pakfire_conf=None, first_install=False, debug=False,
+       def __init__(self, arch, pakfire_config=None, first_install=False, debug=False,
                        unattended=False, disks=[], serial=False, ignore_kernel_cmdline=False):
                self.arch = arch
-               self.pakfire_conf = pakfire_conf
                self.first_install = first_install
                self.debug = debug
                self.unattended = unattended
@@ -104,6 +103,9 @@ class Bricklayer(object):
                # Setup the Pakfire context
                self.ctx = self.setup_context()
 
+               # Read Pakfire configuration
+               self.pakfire_config = pakfire_config.read()
+
                # Create root directory
                self.root = tempfile.mkdtemp(prefix="bricklayer-", suffix="-root")
 
@@ -350,7 +352,7 @@ class Bricklayer(object):
                        ctx    = self.ctx,
                        path   = self.root,
                        arch   = self.arch,
-                       config = self.pakfire_conf,
+                       config = self.pakfire_config,
                        **kwargs,
                )