From: Michael Tremer Date: Sun, 13 Oct 2024 10:25:05 +0000 (+0000) Subject: repo: Cleanup argument order when downloading packages X-Git-Tag: 0.9.30~1043 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76a031b9f530151890e419173730b8bb5b408841;p=pakfire.git repo: Cleanup argument order when downloading packages Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/include/pakfire/repo.h b/src/libpakfire/include/pakfire/repo.h index 727879f5a..71b07753b 100644 --- a/src/libpakfire/include/pakfire/repo.h +++ b/src/libpakfire/include/pakfire/repo.h @@ -124,11 +124,8 @@ Id pakfire_repo_add_solvable(struct pakfire_repo* repo); int pakfire_repo_add_archive(struct pakfire_repo* repo, struct pakfire_archive* archive, struct pakfire_package** package); -int pakfire_repo_download_package( - struct pakfire_repo* repo, - struct pakfire_httpclient* httpclient, - struct pakfire_package* pkg, - struct pakfire_xfer** xfer); +int pakfire_repo_download_package(struct pakfire_xfer** xfer, + struct pakfire_repo* repo, struct pakfire_package* pkg); int pakfire_repo_add(struct pakfire_repo* repo, const char* path, struct pakfire_package** package); diff --git a/src/libpakfire/repo.c b/src/libpakfire/repo.c index 54b87aa6b..82e845e79 100644 --- a/src/libpakfire/repo.c +++ b/src/libpakfire/repo.c @@ -1176,8 +1176,8 @@ PAKFIRE_EXPORT int pakfire_repo_is_installed_repo(struct pakfire_repo* repo) { return (r == 0); } -int pakfire_repo_download_package(struct pakfire_repo* repo, struct pakfire_httpclient* httpclient, - struct pakfire_package* pkg, struct pakfire_xfer** xfer) { +int pakfire_repo_download_package(struct pakfire_xfer** xfer, + struct pakfire_repo* repo, struct pakfire_package* pkg) { struct pakfire_xfer* x = NULL; const unsigned char* digest = NULL; const char* cache_path = NULL; diff --git a/src/libpakfire/transaction.c b/src/libpakfire/transaction.c index 4c30078eb..035ce9a22 100644 --- a/src/libpakfire/transaction.c +++ b/src/libpakfire/transaction.c @@ -1832,15 +1832,17 @@ static int pakfire_transaction_download_package(struct pakfire_transaction* tran struct pakfire_httpclient* httpclient, struct pakfire_package* pkg) { struct pakfire_repo* repo = NULL; struct pakfire_xfer* xfer = NULL; - int r = 1; + int r; // Fetch the repository to download from repo = pakfire_package_get_repo(pkg); - if (!repo) + if (!repo) { + r = -errno; goto ERROR; + } // Create a xfer for this package - r = pakfire_repo_download_package(repo, httpclient, pkg, &xfer); + r = pakfire_repo_download_package(&xfer, repo, pkg); if (r) goto ERROR;