]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
pakfire: Automatically create the installed repository
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Feb 2021 18:18:22 +0000 (18:18 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Feb 2021 18:18:22 +0000 (18:18 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index 1d0d5f08a1bdeebf5022d514dbba6c855cc8e45a..7ec15acf2f6a5fee7ea15b82bc58b733cc023602 100644 (file)
@@ -102,10 +102,17 @@ static int pakfire_populate_pool(Pakfire pakfire) {
        if (r)
                return r;
 
-       // TODO
+       // Create the system repository
+       PakfireRepo repo = pakfire_repo_create(pakfire, "@local");
+       if (!repo)
+               return 1;
+
+       // Set this repository as the installed one
+       pakfire_set_installed_repo(pakfire, repo);
 
        // Free database
        pakfire_db_unref(db);
+       pakfire_repo_unref(repo);
 
        return 0;
 }