From abd4cc14e5fe561da60dce0f219f1708952c0572 Mon Sep 17 00:00:00 2001 From: pvincent Date: Mon, 10 Aug 2026 12:42:53 +0400 Subject: [PATCH] fix unfinalized install --- tools/pkg_add | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/pkg_add b/tools/pkg_add index 05fdb99..b88885d 100755 --- a/tools/pkg_add +++ b/tools/pkg_add @@ -21,7 +21,6 @@ function debian_update_repo { function debian_add { debian_update_repo declare -a wanted=("$@") - declare -a unrecognized=() declare -a missing=() mapfile -t queries < <(dpkg-query -W -f='${Package}: ${Status}\n' "${wanted[@]}" 2>&1 || true) @@ -29,15 +28,13 @@ function debian_add { local missing_regex='(.*): .* not-installed$' for query in "${queries[@]}"; do if [[ "$query" =~ $unrecognized_regex ]]; then - unrecognized+=("${BASH_REMATCH[1]}") + missing+=("${BASH_REMATCH[1]}") elif [[ "$query" =~ $missing_regex ]]; then missing+=("${BASH_REMATCH[1]}") fi done - if [[ ${#unrecognized[@]} -gt 0 ]]; then - >&2 echo "$(basename "$0") error: unrecognized packages: ${unrecognized[*]}" && return 2 - elif [[ "${#missing[@]}" -gt 0 ]]; then + if [[ "${#missing[@]}" -gt 0 ]]; then echo installing packages: "${missing[@]}" apt-get install -y "${missing[@]}" fi