# Initialise the text user interface
self.tui = tui.Tui(self)
+ # Setup the Pakfire context
+ self.ctx = self.setup_context()
+
# Create root directory
self.root = tempfile.mkdtemp(prefix="bricklayer-", suffix="-root")
# Perform umount
self.command(["umount", target], error_ok=True)
- def setup_pakfire(self, **kwargs):
+ def setup_context(self):
"""
- Calls Pakfire and has it load its configuration
+ Sets up the Pakfire context
"""
logger = log.getChild("pakfire")
# Configure the logger
ctx.set_logger(logger)
+ return ctx
+
+ def setup_pakfire(self, **kwargs):
+ """
+ Calls Pakfire and has it load its configuration
+ """
# Create a new pakfire instance
return pakfire.Pakfire(
- ctx = ctx,
+ ctx = self.ctx,
path = self.root,
arch = self.arch,
config = self.pakfire_conf,