From: Michael Tremer Date: Tue, 21 Sep 2021 11:59:41 +0000 (+0000) Subject: Show better error messages on download failures X-Git-Tag: 0.9.28~959 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63fac765f2a25f3501c127f87c3eeceeb7e2a4cd;p=pakfire.git Show better error messages on download failures Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/pakfire.c b/src/libpakfire/pakfire.c index a50a7d808..ba51c0064 100644 --- a/src/libpakfire/pakfire.c +++ b/src/libpakfire/pakfire.c @@ -1926,7 +1926,7 @@ static int pakfire_build_install_packages(struct pakfire* pakfire, int* snapshot // Install everything r = pakfire_install(pakfire, 0, (const char**)packages, NULL, 0, &changed); if (r) { - ERROR(pakfire, "Could not install build dependencies\n"); + ERROR(pakfire, "Could not install build dependencies: %m\n"); goto ERROR; } diff --git a/src/libpakfire/transaction.c b/src/libpakfire/transaction.c index 42a537239..5f26feeab 100644 --- a/src/libpakfire/transaction.c +++ b/src/libpakfire/transaction.c @@ -1003,19 +1003,23 @@ static int pakfire_transaction_download_package(struct pakfire_transaction* tran // Fetch mirrorlist mirrorlist = pakfire_repo_get_mirrorlist(repo); + const char* nevra = pakfire_package_get_nevra(pkg); + if (!nevra) + goto ERROR; + // Where to store the package? const char* path = pakfire_package_get_path(pkg); - if (!path) + if (!path) { + ERROR(transaction->pakfire, "Could not retrieve package path for %s: %m\n", nevra); goto ERROR; + } // What file to download? const char* filename = pakfire_package_get_filename(pkg); - if (!filename) - goto ERROR; - - const char* nevra = pakfire_package_get_nevra(pkg); - if (!nevra) + if (!filename) { + ERROR(transaction->pakfire, "Could not retrieve filename for package %s: %m\n", nevra); goto ERROR; + } enum pakfire_digests digest_type = PAKFIRE_DIGEST_NONE; @@ -1086,8 +1090,12 @@ PAKFIRE_EXPORT int pakfire_transaction_download(struct pakfire_transaction* tran // Enqueue download r = pakfire_transaction_download_package(transaction, downloader, pkg); - if (r) + if (r) { + const char* nevra = pakfire_package_get_nevra(pkg); + + ERROR(transaction->pakfire, "Could not add download to queue: %s: %m\n", nevra); goto ERROR; + } } // Run the downloader