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);
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;
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;