]> git.ipfire.org Git - pbs.git/commitdiff
repository: Master repositories
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Jun 2022 11:06:41 +0000 (11:06 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Jun 2022 11:10:25 +0000 (11:10 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/constants.py.in
src/buildservice/repository.py

index 8e2a68949b1d1550755181288738a5e84d6282d5..68c880900a82926e972102d04afa611b22cab6ab 100644 (file)
@@ -17,7 +17,7 @@ PAKFIRE_DIR  = "/pub/pakfire"
 PACKAGES_DIR = os.path.join(PAKFIRE_DIR, "packages")
 BUILD_RELEASE_DIR = os.path.join(PACKAGES_DIR, "release")
 BUILD_SCRATCH_DIR = os.path.join(PACKAGES_DIR, "scratch")
-REPOS_DIR    = os.path.join(PAKFIRE_DIR, "repositories")
+REPOS_DIR    = os.path.join(PAKFIRE_DIR, "repos")
 SOURCES_DIR  = os.path.join(PAKFIRE_DIR, "sources")
 
 UPLOADS_DIR  = "/var/tmp/pakfire/uploads"
index 9b6eb006df2f1fb3c93fcf13974e848126333f74..d6158895f8596c0801e13ac46d97a70e0ec89e2c 100644 (file)
@@ -199,6 +199,16 @@ class Repository(base.DataObject):
                # Join everything together
                return os.path.join(*parts)
 
+       def local_path(self, arch):
+               """
+                       Path to the repository
+               """
+               return os.path.join(
+                       REPOS_DIR,
+                       self.path,
+                       arch,
+               )
+
        @property
        def url(self):
                if self.owner:
@@ -474,4 +484,16 @@ class Repository(base.DataObject):
 
                # Create a new pakfire instance
                p = self.distro.pakfire()
-               print(p)
+
+               for arch in self.arches:
+                       # Local path
+                       path = self.local_path(arch)
+
+                       # Fetch packages
+                       packages = self.get_packages(arch)
+
+                       # Make filelist (if they exist)
+                       files = [p.path for p in packages if os.path.exists(p.path)]
+
+                       # Write repository metadata
+                       p.repo_compose(path=path, files=files)