From: Michael Tremer Date: Fri, 14 Mar 2025 17:55:39 +0000 (+0000) Subject: bricklayer: Read Pakfire configuration and don't pass the path X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=860462d6f6685fbef22b7d9563a93b99d40917d7;p=people%2Fms%2Fbricklayer.git bricklayer: Read Pakfire configuration and don't pass the path Signed-off-by: Michael Tremer --- diff --git a/src/bricklayer b/src/bricklayer index ef04347..8b75a9a 100644 --- a/src/bricklayer +++ b/src/bricklayer @@ -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")) diff --git a/src/python/__init__.py b/src/python/__init__.py index cca3c9a..d35ba32 100644 --- a/src/python/__init__.py +++ b/src/python/__init__.py @@ -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, )