mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 00:20:05 -07:00
kiss: simplify pkg_verify
This commit is contained in:
parent
5d428ce24c
commit
4cde4248cb
34
kiss
34
kiss
@ -584,7 +584,7 @@ pkg_build() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
for pkg do pkg_sources "$pkg"; done
|
for pkg do pkg_sources "$pkg"; done
|
||||||
pkg_verify "$@"
|
for pkg do pkg_verify "$pkg"; done
|
||||||
|
|
||||||
# Finally build and create tarballs for all passed packages and
|
# Finally build and create tarballs for all passed packages and
|
||||||
# dependencies.
|
# dependencies.
|
||||||
@ -695,35 +695,23 @@ pkg_checksums() {
|
|||||||
pkg_verify() {
|
pkg_verify() {
|
||||||
# Verify all package checksums. This is achieved by generating a new set
|
# Verify all package checksums. This is achieved by generating a new set
|
||||||
# of checksums and then comparing those with the old 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
|
|
||||||
pkg_find "$pkg"
|
pkg_find "$pkg"
|
||||||
|
|
||||||
[ -f "$repo_dir/sources" ] || continue
|
[ -f "$repo_dir/sources" ] ||
|
||||||
|
return 0
|
||||||
|
|
||||||
verify_sum=$(pkg_checksums "$pkg")
|
sum_sys=$(pkg_checksums "$pkg")
|
||||||
|
|
||||||
[ "$verify_sum" ] || continue
|
[ "$sum_sys" ] ||
|
||||||
[ -f "$repo_dir/checksums" ] || die "$pkg" "checksums file missing"
|
return 0
|
||||||
|
|
||||||
# Check that the first column (separated by whitespace) match in both
|
[ -f "$repo_dir/checksums" ] ||
|
||||||
# checksum files. If any part of either file differs, mismatch. Abort.
|
die "$pkg" "checksums file missing"
|
||||||
printf '%s\n' "$verify_sum" |
|
|
||||||
|
|
||||||
awk "$verify_cmd" - "$repo_dir/checksums" || {
|
sum_pkg=$(cut -b 1-64 < "$repo_dir/checksums")
|
||||||
log "$pkg" "Checksum mismatch"
|
|
||||||
|
|
||||||
# Instead of dying above, log it to the terminal. Also define a
|
[ "$sum_sys" = "$sum_pkg" ] ||
|
||||||
# variable so we *can* die after all checksum files have been
|
die "$pkg" "Checksum mismatch"
|
||||||
# checked.
|
|
||||||
mismatch="$mismatch$pkg "
|
|
||||||
}
|
|
||||||
done
|
|
||||||
|
|
||||||
[ -z "$mismatch" ] || die "Checksum mismatch with: ${mismatch% }"
|
|
||||||
|
|
||||||
log "Verified all checksums"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_conflicts() {
|
pkg_conflicts() {
|
||||||
|
Loading…
Reference in New Issue
Block a user