From d6917d5fe1558d0690a7dd001996d34540ed79d9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 13 Aug 2020 10:31:19 +0300 Subject: [PATCH] kiss: Stop showing Git repositories in checksums This is a backwards compatible change. The package manager will for the time being /ignore/ checksums lines containing Git repositories. These aren't checksums and have no business living in the checksums file. This file is now strictly for checksums. In the coming months, this special handling will be lifted. --- kiss | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/kiss b/kiss index 028b895..c67de14 100755 --- a/kiss +++ b/kiss @@ -715,14 +715,10 @@ pkg_checksums() { [ -f "$repo_dir/sources" ] || return 0 while read -r src _ || [ "$src" ]; do - # Skip comments and blank lines. - if [ -z "${src##\#*}" ]; then + # Skip comments, blank lines and git sources. + if [ -z "${src##\#*}" ] || [ -z "${src##git+*}" ]; then : - # Git source. - elif [ -z "${src##git+*}" ]; then - printf '%s\n' "$src" # This should probably be ':'. - # Remote source. elif [ -z "${src##*://*}" ]; then sh256 "$src_dir/$1/${src##*/}" @@ -745,14 +741,14 @@ pkg_checksums() { pkg_verify() { # Verify all package checksums. This is achieved by generating a new set # of checksums and then comparing those with the old set. + verify_cmd='NR==FNR{a[$1];next}/^git\+.*/{next}!(($1)in a){exit 1}' + for pkg do repo_dir=$(pkg_find "$pkg") [ -f "$repo_dir/sources" ] || continue - pkg_checksums "$pkg" | - # Check that the first column (separated by whitespace) match in both # checksum files. If any part of either file differs, mismatch. Abort. - awk 'NR==FNR{a[$1];next}!(($1)in a){exit 1}' - "$repo_dir/checksums" || { + pkg_checksums "$pkg" | awk "$verify_cmd" - "$repo_dir/checksums" || { log "$pkg" "Checksum mismatch" # Instead of dying above, log it to the terminal. Also define a