pkg_install: simplify sort

This commit is contained in:
Dylan Araps 2019-09-11 08:34:07 +03:00
parent 857f03fd88
commit 21a11c65e0

23
kiss
View File

@ -945,22 +945,19 @@ args() {
i|install) i|install)
# Create a list of each package's dependencies. # Create a list of each package's dependencies.
for pkg; do for pkg; do
if [ "${pkg%%*.tar.gz}" ]; then case $pkg in
pkg_depends "$pkg" *.tar.gz) missing_deps="$missing_deps $pkg " ;;
else *) pkg_depends "$pkg"
missing_deps="$missing_deps $pkg "
fi
done
# Filter the list, only including explicit packages.
for pkg in $missing_deps; do
case " $* " in
*" $pkg "*) install_pkgs="$install_pkgs $pkg " ;;
esac esac
done done
for pkg in $install_pkgs; do # Filter the list, only installing explicit packages.
pkg_install "$pkg" # The purpose of these two loops is to order the
# argument list based on dependence.
for pkg in $missing_deps; do
case " $* " in
*" $pkg "*) pkg_install "$pkg" ;;
esac
done done
;; ;;