forked from kiss-community/kiss
kiss: remove unneeded subshell from pkg_depends
This commit is contained in:
parent
65474c56e3
commit
84f1eb7c98
14
kiss
14
kiss
@ -193,15 +193,17 @@ pkg_list() {
|
|||||||
[ "$1" ] || { set +f; set -f -- *; }
|
[ "$1" ] || { set +f; set -f -- *; }
|
||||||
|
|
||||||
# Loop over each package and print its name and version.
|
# Loop over each package and print its name and version.
|
||||||
for pkg do
|
for _list_pkg do
|
||||||
[ -d "$pkg" ] || {
|
[ -d "$_list_pkg" ] || {
|
||||||
log "$pkg" "not installed"
|
log "$_list_pkg" "not installed"
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
read -r version 2>/dev/null < "$pkg/version" || version=null
|
read -r version 2>/dev/null < "$_list_pkg/version" || version=null
|
||||||
printf '%s\n' "$pkg $version"
|
printf '%s\n' "$_list_pkg $version"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
cd "$OLDPWD"
|
||||||
}
|
}
|
||||||
|
|
||||||
pkg_cache() {
|
pkg_cache() {
|
||||||
@ -377,7 +379,7 @@ pkg_depends() {
|
|||||||
# dependencies are listed first and then the parents in reverse order.
|
# dependencies are listed first and then the parents in reverse order.
|
||||||
contains "$deps" "$1" || {
|
contains "$deps" "$1" || {
|
||||||
# Filter out non-explicit, aleady installed dependencies.
|
# Filter out non-explicit, aleady installed dependencies.
|
||||||
[ "$3" ] && [ -z "$2" ] && (pkg_list "$1" >/dev/null 2>&1) && return
|
[ "$3" ] && [ -z "$2" ] && pkg_list "$1" >/dev/null 2>&1 && return
|
||||||
|
|
||||||
# Detect circular dependencies and bail out.
|
# Detect circular dependencies and bail out.
|
||||||
# Looks for multiple repeating patterns of (dep dep_parent) (5 is max).
|
# Looks for multiple repeating patterns of (dep dep_parent) (5 is max).
|
||||||
|
Loading…
Reference in New Issue
Block a user