]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
Show better error messages on download failures
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Sep 2021 11:59:41 +0000 (11:59 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Sep 2021 11:59:41 +0000 (11:59 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/pakfire.c
src/libpakfire/transaction.c

index a50a7d808789352492be5638b381d3296a4982dc..ba51c00649fefca41b3d750458a9f3235656c111 100644 (file)
@@ -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;
        }
 
index 42a5372396bf474162a7f48fee94bbf7fd4ac822..5f26feeab97eea618e7e920cc23ccde3c2832c7b 100644 (file)
@@ -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