]> git.ipfire.org Git - pakfire.git/commitdiff
package: Don't fail if a package does not have a checksum
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Sep 2021 12:01:44 +0000 (12:01 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 21 Sep 2021 12:01:44 +0000 (12:01 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/libpakfire/package.c

index f7a39eacd6474d91b431cba32c6d06d8038cc647..7b5c19f28257da83b477b2cd117669b6203edb36 100644 (file)
@@ -561,11 +561,11 @@ static int pakfire_package_make_cache_path(struct pakfire_package* pkg) {
        enum pakfire_digests digest = PAKFIRE_DIGEST_NONE;
        const char* hexdigest = pakfire_package_get_hexdigest(pkg, &digest);
 
-       if (!hexdigest || strlen(hexdigest) < 3)
-               return 1;
+       if (hexdigest && strlen(hexdigest) >= 3)
+               return pakfire_make_cache_path(pkg->pakfire, pkg->path,
+                       "%c%c/%s/%s", hexdigest[0], hexdigest[1], hexdigest + 2, filename);
 
-       return pakfire_make_cache_path(pkg->pakfire, pkg->path,
-               "%c%c/%s/%s", hexdigest[0], hexdigest[1], hexdigest + 2, filename);
+       return pakfire_make_cache_path(pkg->pakfire, pkg->path, "%s", filename);
 }
 
 PAKFIRE_EXPORT const char* pakfire_package_get_path(struct pakfire_package* pkg) {