]> git.ipfire.org Git - pbs.git/commitdiff
config: Create a temporary directory
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Oct 2023 10:41:50 +0000 (10:41 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 19 Oct 2023 10:41:50 +0000 (10:41 +0000)
As a non-privileged user, we cannot mount a ramdisk which is why we
cannot use this and need to pre-create an empty directory.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/config.py

index 2edb0144fdb43b4b12f6f3f6459698a7f07f0977..5ffab696ab6ad2df41a841bea1c0045f8898bb04 100644 (file)
@@ -96,8 +96,9 @@ class PakfireConfig(base.Object):
                log.debug("Launching Pakfire with configuration:\n%s", f.getvalue())
 
                # Launch a new Pakfire instance (in a separate thread)
-               return await asyncio.to_thread(pakfire.Pakfire, arch=self.arch, conf=f,
-                       logger=self._log, offline=False)
+               async with self.backend.tempdir() as d:
+                       return await asyncio.to_thread(pakfire.Pakfire, path=d, arch=self.arch,
+                               conf=f, logger=self._log, offline=False)
 
        async def __aexit__(self, type, value, traceback):
                pass