1
0
mirror of https://codeberg.org/kiss-community/kiss synced 2024-11-19 13:00:05 -07:00

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.
This commit is contained in:
Dylan Araps 2020-08-13 10:31:19 +03:00
parent 99f61fc340
commit d6917d5fe1
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

14
kiss
View File

@ -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