From: Michael Tremer Date: Thu, 30 Jan 2025 22:47:51 +0000 (+0000) Subject: archive: Compose path after all other metadata has been set X-Git-Tag: 0.9.30~230 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e9dfdf4bb32fe625e459ef1003d5f1b81cf6206c;p=pakfire.git archive: Compose path after all other metadata has been set Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/archive.c b/src/pakfire/archive.c index a04aa81f..decfb473 100644 --- a/src/pakfire/archive.c +++ b/src/pakfire/archive.c @@ -1570,16 +1570,6 @@ static int pakfire_archive_make_package_from_json(struct pakfire_archive* archiv nevra, pkg, archive); #endif - // Make the path where this archive should be stored - r = pakfire_repo_make_path(repo, path, archive, pkg); - if (r < 0) - goto ERROR; - - // Set path - r = pakfire_package_set_string(pkg, PAKFIRE_PKG_PATH, path); - if (r < 0) - goto ERROR; - // Set digest switch (PAKFIRE_ARCHIVE_CHECKSUM) { case PAKFIRE_DIGEST_SHA2_512: @@ -1808,6 +1798,16 @@ static int pakfire_archive_make_package_from_json(struct pakfire_archive* archiv if (r) goto ERROR; + // Make the path where this archive should be stored + r = pakfire_repo_make_path(repo, path, archive, pkg); + if (r < 0) + goto ERROR; + + // Set path + r = pakfire_package_set_string(pkg, PAKFIRE_PKG_PATH, path); + if (r < 0) + goto ERROR; + // Return the package (if requested) if (package) *package = pakfire_package_ref(pkg);