From 0fb13bef29e048d016ee82a0e5cb53baf5748577 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 17 Oct 2024 18:18:01 +0000 Subject: [PATCH] pakfire: Make the pool status a flag Signed-off-by: Michael Tremer --- src/libpakfire/pakfire.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index f0139ca24..17d0a9b07 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -84,6 +84,7 @@ struct pakfire { PAKFIRE_HAS_PATH = (1 << 0), PAKFIRE_DESTROY_ON_FREE = (1 << 1), PAKFIRE_UMOUNT_PATH = (1 << 2), + PAKFIRE_POOL_READY = (1 << 3), } internal_flags; // Lock @@ -115,7 +116,6 @@ struct pakfire { struct pakfire_snapshot* snapshot; // States - unsigned int pool_ready:1; unsigned int in_free:1; }; @@ -1114,7 +1114,7 @@ Pool* pakfire_get_solv_pool(struct pakfire* pakfire) { } void pakfire_pool_has_changed(struct pakfire* pakfire) { - pakfire->pool_ready = 0; + pakfire->internal_flags &= ~PAKFIRE_POOL_READY; } static int __pakfire_repo_internalize(struct pakfire* pakfire, struct pakfire_repo* repo, @@ -1128,7 +1128,7 @@ void pakfire_pool_internalize(struct pakfire* pakfire) { int flags = 0; // Nothing to do if the pool is ready - if (pakfire->pool_ready) + if (pakfire->internal_flags & PAKFIRE_POOL_READY) return; // Internalize all repositories @@ -1141,7 +1141,7 @@ void pakfire_pool_internalize(struct pakfire* pakfire) { pool_createwhatprovides(pakfire->pool); // Mark the pool as ready - pakfire->pool_ready = 1; + pakfire->internal_flags |= PAKFIRE_POOL_READY; } PAKFIRE_EXPORT struct pakfire_repolist* pakfire_get_repos(struct pakfire* pakfire) { -- 2.39.5