]> git.ipfire.org Git - pbs.git/commitdiff
config: Make distro optional
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 12 Oct 2022 13:44:17 +0000 (13:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 12 Oct 2022 13:44:17 +0000 (13:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/config.py

index 9f810c1f1b740d081b3051ded786f9edad45ddb3..c70cef4aa351dc57ca3f3b33c319830c11cf4dff 100644 (file)
@@ -12,13 +12,14 @@ from . import base
 log = logging.getLogger("pakfire.buildservice.config")
 
 class PakfireConfig(base.Object):
-       def init(self, distro, repos=None):
+       def init(self, distro=None, repos=None):
                self.distro = distro
                self.repos = set()
 
                # Add all repositories belonging to the distribution
-               for repo in self.distro.repos:
-                       self.add_repo(repo)
+               if self.distro:
+                       for repo in self.distro.repos:
+                               self.add_repo(repo)
 
                # Add any repositories
                if repos:
@@ -66,7 +67,8 @@ class PakfireConfig(base.Object):
                lines = []
 
                # Add the distro configuration
-               lines += self.distro._make_config(local=local)
+               if self.distro:
+                       lines += self.distro._make_config(local=local)
 
                # Add the repository configurations
                for repo in self.repos: