From: Michael Tremer Date: Tue, 28 Jun 2022 11:06:41 +0000 (+0000) Subject: repository: Master repositories X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31cdc0b3cc1eae9950a686f7cdc675bfec87c907;p=pbs.git repository: Master repositories Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/constants.py.in b/src/buildservice/constants.py.in index 8e2a6894..68c88090 100644 --- a/src/buildservice/constants.py.in +++ b/src/buildservice/constants.py.in @@ -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" diff --git a/src/buildservice/repository.py b/src/buildservice/repository.py index 9b6eb006..d6158895 100644 --- a/src/buildservice/repository.py +++ b/src/buildservice/repository.py @@ -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)