kiss-depends: changes

- whitespace is normalized between fields.
- less code.
This commit is contained in:
Dylan Araps 2020-09-09 13:31:27 +03:00
parent 43a2476f7e
commit 9e38bf7d03
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

View File

@ -1,16 +1,11 @@
#!/bin/sh -ef
# Display a package's dependencies
# Use the current directory as the package name if no package is given.
[ "$1" ] || {
set -- "${PWD##*/}"
}
# Ignore shellcheck as we want the warning's behavior.
# shellcheck disable=2015
kiss list "${1:-null}" >/dev/null || {
printf 'usage: kiss-depends [pkg]\n'
kiss list "${1:-"${PWD##*/}"}" >/dev/null || {
printf 'usage: kiss-depends [pkg]\n' >&2
exit 1
}
cat "$KISS_ROOT/var/db/kiss/installed/$1/depends" 2>/dev/null
while read -r dep mak || [ "$dep" ]; do
printf '%s%s\n' "$dep" "${mak:+ "$mak"}"
done 2>/dev/null < "$KISS_ROOT/var/db/kiss/installed/$1/depends"