kiss: Simplify pkg_checksums
This commit is contained in:
parent
426607b4fc
commit
0ca739aafb
31
kiss
31
kiss
|
@ -719,26 +719,23 @@ pkg_checksums() {
|
||||||
[ -f "$repo_dir/sources" ] || return 0
|
[ -f "$repo_dir/sources" ] || return 0
|
||||||
|
|
||||||
while read -r src _ || [ "$src" ]; do
|
while read -r src _ || [ "$src" ]; do
|
||||||
# Comment.
|
case $src in \#*) ;;
|
||||||
if [ -z "${src##\#*}" ]; then
|
git+*) printf 'git %s\n' "$src" ;;
|
||||||
continue
|
|
||||||
|
|
||||||
# File is local to the package.
|
*)
|
||||||
elif [ -f "$repo_dir/$src" ]; then
|
# File is local to the package.
|
||||||
src_path=$repo_dir/${src%/*}
|
if [ -f "$repo_dir/$src" ]; then
|
||||||
|
src_path=$repo_dir/${src%/*}
|
||||||
|
|
||||||
# File is remote and was downloaded.
|
# File is remote and was downloaded.
|
||||||
elif [ -f "$src_dir/$1/${src##*/}" ]; then
|
elif [ -f "$src_dir/$1/${src##*/}" ]; then
|
||||||
src_path=$src_dir/$1
|
src_path=$src_dir/$1
|
||||||
|
|
||||||
# File is a git repository.
|
else
|
||||||
elif [ -z "${src##git+*}" ]; then
|
die "$1" "Couldn't find source '$src'"
|
||||||
printf 'git %s\n' "$src"
|
fi
|
||||||
continue
|
;;
|
||||||
|
esac
|
||||||
else
|
|
||||||
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.
|
||||||
|
|
Loading…
Reference in New Issue