mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-07-02 22:12:26 +00:00
kiss: cleanup
This commit is contained in:
parent
bd42b9dd28
commit
2868568980
15
kiss
15
kiss
|
@ -531,33 +531,28 @@ pkg_build() {
|
||||||
|
|
||||||
pkg_checksums() {
|
pkg_checksums() {
|
||||||
# Generate checksums for packages.
|
# Generate checksums for packages.
|
||||||
|
|
||||||
repo_dir=$(pkg_find "$1")
|
repo_dir=$(pkg_find "$1")
|
||||||
|
|
||||||
while read -r src _; do
|
while read -r src _; do
|
||||||
case $src in
|
case $src in
|
||||||
*)
|
*)
|
||||||
# File is local to the package and is stored in the
|
# File is local to the package.
|
||||||
# repository.
|
if [ -f "$repo_dir/$src" ]; then
|
||||||
[ -f "$repo_dir/$src" ] &&
|
|
||||||
src_path=$repo_dir/${src%/*}
|
src_path=$repo_dir/${src%/*}
|
||||||
|
|
||||||
# File is remote and was downloaded.
|
# File is remote and was downloaded.
|
||||||
[ -f "$src_dir/$1/${src##*/}" ] &&
|
elif [ -f "$src_dir/$1/${src##*/}" ]; then
|
||||||
src_path=$src_dir/$1
|
src_path=$src_dir/$1
|
||||||
|
|
||||||
# Die here if source for some reason, doesn't exist.
|
# Die here if source for some reason, doesn't exist.
|
||||||
[ "$src_path" ] ||
|
else
|
||||||
die "[$1] Couldn't find source '$src'"
|
die "[$1] Couldn't find source '$src'"
|
||||||
|
fi
|
||||||
|
|
||||||
# An easy way to get 'sha256sum' to print with the 'basename'
|
# An easy way to get 'sha256sum' to print with the 'basename'
|
||||||
# of files is to 'cd' to the file's directory beforehand.
|
# of files is to 'cd' to the file's directory beforehand.
|
||||||
(cd "$src_path" && sha256sum "${src##*/}") ||
|
(cd "$src_path" && sha256sum "${src##*/}") ||
|
||||||
die "[$1] Failed to generate checksums"
|
die "[$1] Failed to generate checksums"
|
||||||
|
|
||||||
# Unset this variable so it isn't used again on a failed
|
|
||||||
# source. There's no 'local' keyword in POSIX sh.
|
|
||||||
src_path=
|
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done < "$repo_dir/sources"
|
done < "$repo_dir/sources"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user