]> git.ipfire.org Git - pakfire.git/commitdiff
build: Directly pass the context
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 29 Jun 2025 13:02:00 +0000 (13:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 29 Jun 2025 13:02:00 +0000 (13:02 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/build.c
src/pakfire/build.h
src/pakfire/root.c

index 20c5f0c86d71d47015558a72a88f02f71028bb34..e26ccba17a6631ba3b77cc9d421bbbfe77923687 100644 (file)
@@ -2817,12 +2817,10 @@ ERROR:
        return r;
 }
 
-int pakfire_build_clean(pakfire_root* root, int flags) {
+int pakfire_build_clean(pakfire_ctx* ctx, pakfire_root* root, int flags) {
        pakfire_repo* local = NULL;
        int r = 0;
 
-       pakfire_ctx* ctx = pakfire_root_get_ctx(root);
-
        // Fetch local repository
        local = pakfire_root_get_repo(root, PAKFIRE_REPO_LOCAL);
        if (!local) {
@@ -2838,8 +2836,6 @@ int pakfire_build_clean(pakfire_root* root, int flags) {
 ERROR:
        if (local)
                pakfire_repo_unref(local);
-       if (ctx)
-               pakfire_ctx_unref(ctx);
 
        return r;
 }
index fdeca1d12bfe3a9c6bda2fa6d0cc8eb9ba5407ef..51c21f41df71bf37570f068f609d44b0ebc4d2a0 100644 (file)
@@ -54,6 +54,6 @@ int pakfire_build_exec(pakfire_build* build, const char* path,
 int pakfire_build_mkimage(pakfire_build* build,
        const char* type, FILE* f);
 
-int pakfire_build_clean(pakfire_root* root, int flags);
+int pakfire_build_clean(pakfire_ctx* ctx, pakfire_root* root, int flags);
 
 #endif /* PAKFIRE_BUILD_H */
index 8e1d07bc0c66270cd8eb4ed63927e29f90b8d187..00c61b38f481bfc17d94133cf64f6aefc10892ba 100644 (file)
@@ -1308,7 +1308,7 @@ int pakfire_root_clean(pakfire_root* self, int flags) {
                return r;
 
        // Clean build environments
-       r = pakfire_build_clean(self, flags);
+       r = pakfire_build_clean(self->ctx, self, flags);
        if (r)
                return r;