aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-10 08:34:39 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-10 08:34:39 +0000
commitfa7a076174c00d1954b085424763fd12e4ae4b88 (patch)
tree89a81b18c448e1005e07cad3163cc461502f6291 /kiss
parent6dc4f990ca98a1aca2b50d293b713c76c15f2ea5 (diff)
downloadcpt-fa7a076174c00d1954b085424763fd12e4ae4b88.tar.gz
kiss: cleanup
FossilOrigin-Name: dc52a1305bb2cfa0bdbec7466870cf51cbfde5d8dd28f01a9e4310d3971ae0e7
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss15
1 files changed, 5 insertions, 10 deletions
diff --git a/kiss b/kiss
index 8c9cebe..cd7ed7b 100755
--- a/kiss
+++ b/kiss
@@ -531,33 +531,28 @@ pkg_build() {
pkg_checksums() {
# Generate checksums for packages.
-
repo_dir=$(pkg_find "$1")
while read -r src _; do
case $src in
*)
- # File is local to the package and is stored in the
- # repository.
- [ -f "$repo_dir/$src" ] &&
+ # File is local to the package.
+ if [ -f "$repo_dir/$src" ]; then
src_path=$repo_dir/${src%/*}
# File is remote and was downloaded.
- [ -f "$src_dir/$1/${src##*/}" ] &&
+ elif [ -f "$src_dir/$1/${src##*/}" ]; then
src_path=$src_dir/$1
# Die here if source for some reason, doesn't exist.
- [ "$src_path" ] ||
+ else
die "[$1] Couldn't find source '$src'"
+ fi
# An easy way to get 'sha256sum' to print with the 'basename'
# of files is to 'cd' to the file's directory beforehand.
(cd "$src_path" && sha256sum "${src##*/}") ||
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
done < "$repo_dir/sources"