From ef48edeaa5a4721518b9d5f1f5acd916a403fc32 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 2 Feb 2025 15:01:41 +0000 Subject: [PATCH] repos: Add file type to metadata Signed-off-by: Michael Tremer --- src/pakfire/repo.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pakfire/repo.c b/src/pakfire/repo.c index a5e020a4..29a24dce 100644 --- a/src/pakfire/repo.c +++ b/src/pakfire/repo.c @@ -1968,7 +1968,7 @@ int pakfire_repo_refresh(struct pakfire_repo* repo, int force) { } static int pakfire_repo_metadata_add_file(struct pakfire_repo* self, - struct json_object* repomd, const char* path) { + struct json_object* repomd, const char* type, const char* path) { struct pakfire_digests digests = {}; struct json_object* files = NULL; struct json_object* file = NULL; @@ -2014,6 +2014,11 @@ static int pakfire_repo_metadata_add_file(struct pakfire_repo* self, goto ERROR; } + // Add the type + r = pakfire_json_add_string(file, "type", type); + if (r < 0) + goto ERROR; + // Add the filename r = pakfire_json_add_string(file, "filename", filename); if (r < 0) @@ -2120,7 +2125,7 @@ static int pakfire_repo_write_database(struct pakfire_repo* self, struct json_ob } // Add the database to the filelist - r = pakfire_repo_metadata_add_file(self, repomd, path); + r = pakfire_repo_metadata_add_file(self, repomd, "packages", path); if (r < 0) goto ERROR; -- 2.39.5