aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-11 05:34:07 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2019-09-11 05:34:07 +0000
commit58b1e1c7616867d0f9496b4d9b44da66f348303c (patch)
tree4f097a7fd6aa8f01563ec39c836602f3e4cfb5b0
parent215e14d734f10e69ca3bc5cc6df6109d69f3c23e (diff)
downloadcpt-58b1e1c7616867d0f9496b4d9b44da66f348303c.tar.gz
pkg_install: simplify sort
FossilOrigin-Name: 38f92da8c045bf9b1dd1d3cf88796ab805470707fa16ae7b2fe0625b98decfd4
-rwxr-xr-xkiss19
1 files changed, 8 insertions, 11 deletions
diff --git a/kiss b/kiss
index 59accfd..30e30db 100755
--- a/kiss
+++ b/kiss
@@ -945,23 +945,20 @@ args() {
i|install)
# Create a list of each package's dependencies.
for pkg; do
- if [ "${pkg%%*.tar.gz}" ]; then
- pkg_depends "$pkg"
- else
- missing_deps="$missing_deps $pkg "
- fi
+ case $pkg in
+ *.tar.gz) missing_deps="$missing_deps $pkg " ;;
+ *) pkg_depends "$pkg"
+ esac
done
- # Filter the list, only including explicit packages.
+ # Filter the list, only installing explicit packages.
+ # The purpose of these two loops is to order the
+ # argument list based on dependence.
for pkg in $missing_deps; do
case " $* " in
- *" $pkg "*) install_pkgs="$install_pkgs $pkg " ;;
+ *" $pkg "*) pkg_install "$pkg" ;;
esac
done
-
- for pkg in $install_pkgs; do
- pkg_install "$pkg"
- done
;;
r|remove)