From 723c54434be1d95ddb9124e3253bc1c334602180 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 29 Jun 2025 13:02:00 +0000 Subject: [PATCH] build: Directly pass the context Signed-off-by: Michael Tremer --- src/pakfire/build.c | 6 +----- src/pakfire/build.h | 2 +- src/pakfire/root.c | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/pakfire/build.c b/src/pakfire/build.c index 20c5f0c8..e26ccba1 100644 --- a/src/pakfire/build.c +++ b/src/pakfire/build.c @@ -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; } diff --git a/src/pakfire/build.h b/src/pakfire/build.h index fdeca1d1..51c21f41 100644 --- a/src/pakfire/build.h +++ b/src/pakfire/build.h @@ -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 */ diff --git a/src/pakfire/root.c b/src/pakfire/root.c index 8e1d07bc..00c61b38 100644 --- a/src/pakfire/root.c +++ b/src/pakfire/root.c @@ -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; -- 2.47.2