]> git.ipfire.org Git - pakfire.git/commitdiff
archive: Improve logging when package cannot be opened
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Sep 2021 13:54:49 +0000 (13:54 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Sep 2021 13:54:49 +0000 (13:54 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/archive.c

index 5f745e861ecc01f9eaa66376e9b3f71a2f16aa9d..fe73deb3121d040a54c5773d67779f51a16090b1 100644 (file)
@@ -722,8 +722,10 @@ static int pakfire_archive_extraction_path(struct pakfire_archive* archive,
        char buffer[PATH_MAX];
 
        struct pakfire_package* pkg = pakfire_archive_get_package(archive);
-       if (!pkg)
+       if (!pkg) {
+               ERROR(archive->pakfire, "Could not fetch package from archive: %m\n");
                return 1;
+       }
 
        // Use a good default when no prefix is set
        if (pakfire_package_is_source(pkg)) {
@@ -1961,8 +1963,10 @@ PAKFIRE_EXPORT int pakfire_archive_make_package(struct pakfire_archive* archive,
        // Calculate digest
        r = pakfire_archive_calculate_digest(archive, PAKFIRE_DIGEST_SHA512,
                digest, &digest_length);
-       if (r)
+       if (r) {
+               ERROR(archive->pakfire, "Could not calculate digest of %s: %m\n", archive->path);
                return r;
+       }
 
        // Use dummy repo if no repository was passed
        if (!repo) {