forked from kiss-community/kiss
kiss: simplify
This commit is contained in:
parent
d4d01a5512
commit
c84472e531
22
kiss
22
kiss
@ -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() {
|
||||
|
Loading…
Reference in New Issue
Block a user