From 2fcc2e22f92577c8bf572a3276445fd6869eb158 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 8 Dec 2022 17:47:43 +0000 Subject: [PATCH] packages: Ensure that the pool is internalized for packages w/o repo Signed-off-by: Michael Tremer --- src/libpakfire/package.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/libpakfire/package.c b/src/libpakfire/package.c index f3ffa55ea..b93c0c798 100644 --- a/src/libpakfire/package.c +++ b/src/libpakfire/package.c @@ -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 -- 2.39.5