forked from kiss-community/kiss
kiss: remove subshell use of pkg_list
This commit is contained in:
parent
854a04520d
commit
6e115ed164
16
kiss
16
kiss
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user