kiss: Clean up checksum generation

This commit is contained in:
Dylan Araps 2020-06-10 10:38:42 +03:00
parent 3733eeacab
commit 04730c9be6
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 8 deletions

12
kiss
View File

@ -705,14 +705,10 @@ pkg_checksums() {
git+*) printf 'git %s\n' "$src" ;;
*)
# File is local to the package.
if [ -f "$repo_dir/$src" ]; then
cd "$repo_dir/${src%/*}"
# File is remote and was downloaded.
elif [ -f "$src_dir/$1/${src##*/}" ]; then
cd "$src_dir/$1"
fi
# Check for cached remote sources first and fallback to
# local repository files. We prefer local files to remote.
[ ! -f "$src_dir/$1/${src##*/}" ] || cd "$src_dir/$1"
[ ! -f "$repo_dir/$src" ] || cd "$repo_dir/${src%/*}"
sh256 "${src##*/}" || die "$1" "Failed to generate checksums"
;;