]> git.ipfire.org Git - pakfire.git/commitdiff
pakfire: Make the pool status a flag
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2024 18:18:01 +0000 (18:18 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 17 Oct 2024 18:18:01 +0000 (18:18 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c

index f0139ca243ec116ab0e3a280d35b9ebea3676eea..17d0a9b0719da2dc347a5a0357b3c25409cd60b5 100644 (file)
@@ -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) {