From: Michael Tremer Date: Wed, 12 Oct 2022 13:44:17 +0000 (+0000) Subject: config: Make distro optional X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7d2517ef6ae784674d8acf5659de8bcd763ab8e;p=pbs.git config: Make distro optional Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/config.py b/src/buildservice/config.py index 9f810c1f..c70cef4a 100644 --- a/src/buildservice/config.py +++ b/src/buildservice/config.py @@ -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: