]> git.ipfire.org Git - pbs.git/commitdiff
config: Pass the configuration to Pakfire as string
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Jan 2025 15:47:45 +0000 (15:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Jan 2025 15:47:45 +0000 (15:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/config.py

index e65cac3d59fd78479a178ed4d9fd843f1e8e7e77..eced838d805a137256e20bda44f43c51e01f03bf 100644 (file)
@@ -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):