From da9e4a8a322311b51f6835fe62a1a80d56ae621b Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 09 Dec 2020 07:42:09 -0500 Subject: resolve_deps(): Fix infinite loop --- diff --git a/NEWS b/NEWS index 9346655..de0851a 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,7 @@ Error handling and bug fixes: usable within the root being installed. ProteanOS's busybox 1.32.0-1 manages "cut" and almost all other utility links using update-alternatives, so they aren't usable until after installation. + * A potential infinite loop in the dependency solver has been fixed. ProteanOS Development Kit version 2.0.1 --------------------------------------- diff --git a/src/deps.sh b/src/deps.sh index 25c2cf7..72a0cda 100644 --- a/src/deps.sh +++ b/src/deps.sh @@ -28,7 +28,7 @@ resolve_deps() local pkg= all_deps='' - new_pkgs="${new_pkgs} " + new_pkgs=" $(printf '%s ' ${new_pkgs})" while [ "x${new_pkgs}" != 'x' ]; do all_deps="${all_deps}${new_pkgs}" new_deps='' @@ -42,7 +42,7 @@ resolve_deps() new_deps="$(printf '%s\n' ${new_deps} | sort -u)" new_pkgs='' for pkg in ${new_deps}; do - if [ "x${all_deps# ${pkg} }" = "x${all_deps}" ]; then + if [ "x${all_deps#* ${pkg} }" = "x${all_deps}" ]; then new_pkgs="${new_pkgs}${pkg} " fi done -- cgit v0.9.1