]> git.ipfire.org Git - pakfire.git/commitdiff
packages: Ensure that the pool is internalized for packages w/o repo
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Dec 2022 17:47:43 +0000 (17:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Dec 2022 17:47:43 +0000 (17:47 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/package.c

index f3ffa55eaf993fbae95fe0e6bb6caa75979d4e3c..b93c0c798bd28dc96f7b70a0f65da39e811db0ec 100644 (file)
@@ -68,6 +68,20 @@ static Solvable* get_solvable(struct pakfire_package* pkg) {
        return pool_id2solvable(pool, pkg->id);
 }
 
+static void pakfire_package_has_changed(struct pakfire_package* pkg) {
+       struct pakfire_repo* repo = NULL;
+
+       // Mark the repository as changed
+       repo = pakfire_package_get_repo(pkg);
+       if (repo) {
+               pakfire_repo_has_changed(repo);
+               pakfire_repo_unref(repo);
+       }
+
+       // Mark the pool as changed, too
+       pakfire_pool_has_changed(pkg->pakfire);
+}
+
 static int pakfire_package_dep2id(const enum pakfire_package_key key,
                Id* id, Id* marker) {
        switch (key) {
@@ -366,14 +380,9 @@ static void pakfire_package_internalize_repo(struct pakfire_package* pkg) {
                pakfire_repo_internalize(repo, 0);
                pakfire_repo_unref(repo);
        }
-}
 
-static void pakfire_package_has_changed(struct pakfire_package* pkg) {
-       struct pakfire_repo* repo = pakfire_package_get_repo(pkg);
-       if (repo) {
-               pakfire_repo_has_changed(repo);
-               pakfire_repo_unref(repo);
-       }
+       // Internalize the pool
+       pakfire_pool_internalize(pkg->pakfire);
 }
 
 // Removes epoch