]> git.ipfire.org Git - pbs.git/commitdiff
distros: Simplify generating pakfire.conf
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Jun 2022 15:04:24 +0000 (15:04 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 25 Jun 2022 15:04:24 +0000 (15:04 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/distribution.py
src/buildservice/jobs.py

index cbc08a18a085bf8ffeb35c86851e3b86351251d5..76ec36159c352c4f547f8115361c13669b655982 100644 (file)
@@ -54,7 +54,7 @@ class Distribution(base.DataObject):
                        "description" : self.description,
                }
 
-       def get_config(self):
+       def get_config(self, local=False):
                try:
                        name, release = self.name.split()
                except:
@@ -71,6 +71,10 @@ class Distribution(base.DataObject):
                        "contact = %s" % self.contact,
                ]
 
+               # Add all repositories
+               for repo in self.repos:
+                       lines.append(repo.get_config(local=local))
+
                # Add any custom configuration
                if self.custom_config:
                        lines += (
@@ -180,15 +184,6 @@ class Distribution(base.DataObject):
 
                return repo
 
-       def get_build_repos(self):
-               repos = []
-               
-               for repo in self.repositories:
-                       if repo.enabled_for_builds:
-                               repos.append(repo)
-
-               return repos
-
        @property
        def first_repo(self):
                repos = self.repositories
index a070406dd73c939562d64b10f82b2465ae4dedf0..e4de8c9fac5561040ae5c6964bc1847edc578e7b 100644 (file)
@@ -533,17 +533,7 @@ class Job(base.DataObject):
                """
                        Get configuration file that is sent to the builder.
                """
-               confs = []
-
-               # Add the distribution configuration.
-               confs.append(self.distro.get_config())
-
-               # Then add all repositories for this build.
-               for repo in self.get_build_repos():
-                       conf = repo.get_config(local=local)
-                       confs.append(conf)
-
-               return "\n\n".join(confs)
+               return self.distro.get_config(local=local)
 
        def set_dependency_check_succeeded(self, value):
                self._set_attribute("dependency_check_succeeded", value)