kiss: clean up

This commit is contained in:
Dylan Araps 2019-09-16 09:26:15 +03:00
parent bd4a28073b
commit 17618dde90

38
kiss
View File

@ -148,7 +148,7 @@ pkg_extract() {
case $src in case $src in
# Only 'tar' archives are currently supported for extraction. # Only 'tar' archives are currently supported for extraction.
# Any other file-types are simply copied to '$mak_dir' which # Any other file-types are simply copied to '$mak_dir' which
# allows you to extract them manually. # allows for manual extraction.
*://*.tar*|*://*.tgz) *://*.tar*|*://*.tgz)
tar xf "$src_dir/$1/${src##*/}" --strip-components 1 \ tar xf "$src_dir/$1/${src##*/}" --strip-components 1 \
|| die "[$1] Couldn't extract ${src##*/}" || die "[$1] Couldn't extract ${src##*/}"
@ -180,11 +180,11 @@ pkg_depends() {
# listed first and then the parents in reverse order. # listed first and then the parents in reverse order.
contains "$deps" "$1" || { contains "$deps" "$1" || {
# Filter out non-explicit, aleady installed dependencies. # Filter out non-explicit, aleady installed dependencies.
# Only filter installed if called from 'pkg_build()'.
[ -z "${action##b*}" ] && [ -z "$2" ] && [ -z "${action##b*}" ] && [ -z "$2" ] &&
(pkg_list "$1" >/dev/null) && return (pkg_list "$1" >/dev/null) && return
# Recurse through the dependencies of the child # Recurse through the dependencies of the child packages.
# packages. Keep doing this.
while read -r dep _; do while read -r dep _; do
[ "${dep##\#*}" ] && pkg_depends "$dep" [ "${dep##\#*}" ] && pkg_depends "$dep"
done 2>/dev/null < "$repo_dir/depends" ||: done 2>/dev/null < "$repo_dir/depends" ||:
@ -195,23 +195,6 @@ pkg_depends() {
} }
} }
pkg_verify() {
# Verify all package checksums. This is achieved by generating
# a new set of checksums and then comparing those with the old
# set.
# Generate a second set of checksums to compare against the
# repository's checksums for the package.
pkg_checksums "$1" | cmp -s - "$(pkg_find "$1")/checksums" || {
log "[$1] Checksum mismatch"
# Instead of dying above, log it to the terminal. Also define a
# variable so we *can* die after all checksum files have been
# checked.
mismatch="$mismatch$1 "
}
}
pkg_strip() { pkg_strip() {
# Strip package binaries and libraries. This saves space on the # Strip package binaries and libraries. This saves space on the
# system as well as on the tar-balls we ship for installation. # system as well as on the tar-balls we ship for installation.
@ -424,7 +407,20 @@ pkg_build() {
[ "$no_sums" ] && die "Checksums missing, run 'kiss checksum ${no_sums% }'" [ "$no_sums" ] && die "Checksums missing, run 'kiss checksum ${no_sums% }'"
for pkg; do pkg_sources "$pkg"; done for pkg; do pkg_sources "$pkg"; done
for pkg; do pkg_verify "$pkg"; done
# Verify all package checksums. This is achieved by generating
# a new set of checksums and then comparing those with the old
# set.
for pkg; do
pkg_checksums "$pkg" | cmp -s - "$(pkg_find "$pkg")/checksums" || {
log "[$pkg] Checksum mismatch"
# Instead of dying above, log it to the terminal. Also define a
# variable so we *can* die after all checksum files have been
# checked.
mismatch="$mismatch$pkg "
}
done
# Die here as packages with differing checksums were found above. # Die here as packages with differing checksums were found above.
[ "$mismatch" ] && die "Checksum mismatch with: ${mismatch% }" [ "$mismatch" ] && die "Checksum mismatch with: ${mismatch% }"