kiss: simplify

This commit is contained in:
Dylan Araps 2020-03-23 13:04:45 +02:00
parent d4d01a5512
commit c84472e531
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

22
kiss
View File

@ -474,14 +474,12 @@ pkg_tar() {
read -r version release < "$(pkg_find "$1")/version"
# Create a tar-ball from the contents of the built package.
"$tar" cf - -C "$pkg_dir/$1" . |
case ${KISS_COMPRESS:=gz} in
bz2) bzip2 -z ;;
xz) xz -zT 0 ;;
gz) gzip -6 ;;
zst) zstd -z ;;
esac \
> "$bin_dir/$1#$version-$release.tar.${KISS_COMPRESS:=gz}"
"$tar" cf - -C "$pkg_dir/$1" . | case ${KISS_COMPRESS:=gz} in
bz2) bzip2 -z ;;
gz) gzip -6 ;;
xz) xz -zT 0 ;;
zst) zstd -z ;;
esac > "$bin_dir/$1#$version-$release.tar.${KISS_COMPRESS:=gz}"
log "$1" "Successfully created tar-ball"
}
@ -634,16 +632,14 @@ pkg_build() {
pkg_checksums() {
# Generate checksums for packages.
repo_dir=$(pkg_find "$1")
while read -r src _ || [ "$src" ]; do
# Comment.
if [ -z "${src##\#*}" ]; then
continue
# File is local to the package.
elif [ -f "$repo_dir/$src" ]; then
src_path=$repo_dir/${src%/*}
elif [ -f "$(pkg_find "$1")/$src" ]; then
src_path=$(pkg_find "$1")/${src%/*}
# File is remote and was downloaded.
elif [ -f "$src_dir/$1/${src##*/}" ]; then
@ -663,7 +659,7 @@ pkg_checksums() {
# of files is to 'cd' to the file's directory beforehand.
(cd "$src_path" && sha256sum "${src##*/}") ||
die "$1" "Failed to generate checksums"
done < "$repo_dir/sources"
done < "$(pkg_find "$1")/sources"
}
pkg_verify() {