kiss: remove subshell use of pkg_list

This commit is contained in:
Dylan Araps 2020-09-12 17:35:10 +03:00
parent 854a04520d
commit 6e115ed164
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

16
kiss
View File

@ -155,7 +155,7 @@ pkg_find() {
printf '%s\n' "$@" printf '%s\n' "$@"
} }
pkg_list() ( pkg_list() {
cd "$sys_db" cd "$sys_db"
# If no arguments are passed, list all. # If no arguments are passed, list all.
@ -164,17 +164,19 @@ pkg_list() (
set -f -- * set -f -- *
} }
for pkg do for _pkg do
[ -d "$pkg" ] || { [ -d "$_pkg" ] || {
log "$pkg" "not installed" log "$_pkg" "not installed"
return 1 return 1
} }
read -r version 2>/dev/null < "$pkg/version" || version=null read -r version 2>/dev/null < "$_pkg/version" || version=null
printf '%s\n' "$pkg $version" printf '%s\n' "$_pkg $version"
done done
)
cd "$OLDPWD"
}
pkg_cache() { pkg_cache() {
# Find the tarball of a package using a glob. Use the first found match # Find the tarball of a package using a glob. Use the first found match