From db70930bc8c44cde61a10c69abaeb752075ae597 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 15 Feb 2025 13:06:57 +0000 Subject: [PATCH] packages: Use the new path function to find the package Signed-off-by: Michael Tremer --- src/pakfire/package.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/src/pakfire/package.c b/src/pakfire/package.c index 62568737..388a00f1 100644 --- a/src/pakfire/package.c +++ b/src/pakfire/package.c @@ -2145,36 +2145,22 @@ ERROR: struct pakfire_archive* pakfire_package_get_archive(struct pakfire_package* pkg) { struct pakfire_archive* archive = NULL; - struct pakfire_repo* repo = NULL; const char* path = NULL; int r; - // Fetch the repository - repo = pakfire_package_get_repo(pkg); - if (repo) { - if (pakfire_repo_is_local(repo)) { - path = pakfire_package_get_string(pkg, PAKFIRE_PKG_PATH); - if (!path) - goto ERROR; - } - } - - // Otherwise open the archive from the cache + // Fetch the path + path = pakfire_package_get_path(pkg); if (!path) - path = pakfire_package_get_string(pkg, PAKFIRE_PKG_CACHE_PATH); + return NULL; // Open archive r = pakfire_archive_open(&archive, pkg->pakfire, path); if (r) { ERROR(pkg->ctx, "Could not open archive for %s (at %s): %m\n", pakfire_package_get_string(pkg, PAKFIRE_PKG_NEVRA), path); - goto ERROR; + return NULL; } -ERROR: - if (repo) - pakfire_repo_unref(repo); - return archive; } -- 2.39.5