From ca1e9e0da2aa0a7ef82da7076a6ba323eafe8287 Mon Sep 17 00:00:00 2001 From: merakor Date: Sat, 29 May 2021 23:45:45 +0000 Subject: pkg_lint(): Don't require a 'checksums' file if there is no 'sources' file FossilOrigin-Name: d8f23773823c4702411f0af671d067db80936ec5095fe31e54dd47705250df8b --- src/cpt-lib.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/cpt-lib.in b/src/cpt-lib.in index 328149e..664daf4 100644 --- a/src/cpt-lib.in +++ b/src/cpt-lib.in @@ -590,7 +590,13 @@ pkg_lint() { read -r _ release 2>/dev/null < version || die "Version file not found" [ "$release" ] || die "Release field not found in version file" - [ "$2" ] || [ -f checksums ] || die "$pkg" "Checksums are missing" + # If we have a second argument, we are generating the checksums file, + # so we don't need to check whether there is one. + [ -z "$2" ] || return 0 + + # Check for a checksums file only if there is a sources file. + [ -f sources ] || return 0 + [ -f checksums ] || die "$pkg" "Checksums are missing" } pkg_find() { -- cgit v1.2.3