From: Michael Tremer Date: Mon, 27 Jan 2025 15:47:45 +0000 (+0000) Subject: config: Pass the configuration to Pakfire as string X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5462df24b840cd4bc7c7506f1a4f2cc8fceb520b;p=pbs.git config: Pass the configuration to Pakfire as string Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/config.py b/src/buildservice/config.py index e65cac3d..eced838d 100644 --- a/src/buildservice/config.py +++ b/src/buildservice/config.py @@ -72,11 +72,20 @@ class PakfireConfig(base.Object): # Make configuration config = await self.config(local=True) - log.debug("Launching Pakfire with configuration:\n%s", config.getvalue()) + # Log action + log.debug("Launching Pakfire for %s:" % self.arch) + if config: + log.debug(config) # Launch a new Pakfire instance (in a separate thread) - async with self.backend.tempdir() as d: - return await asyncio.to_thread(pakfire.Pakfire, ctx=ctx, path=d, arch=self.arch, conf=config) + async with self.backend.tempdir() as path: + return await asyncio.to_thread( + pakfire.Pakfire, + ctx = ctx, + path = path, + arch = self.arch, + config = config, + ) async def __aexit__(self, type, value, traceback): pass @@ -116,10 +125,7 @@ class PakfireConfig(base.Object): f = io.StringIO() config.write(f) - # Rewind the buffer - f.seek(0) - - return f + return f.getvalue() class PakfireLogger(object):