]> git.ipfire.org Git - pakfire.git/commitdiff
repos: Add file type to metadata
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 2 Feb 2025 15:01:41 +0000 (15:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 2 Feb 2025 15:01:41 +0000 (15:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/repo.c

index a5e020a492e9ac6c14521678dc97a6f260397a11..29a24dcec285db52e34d57cb14c78d5a7165b77b 100644 (file)
@@ -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;