From 8eb215fb83872c034ab91500331b5ac08bcb16ab Mon Sep 17 00:00:00 2001 From: MickLesk Date: Mon, 24 Aug 2026 08:27:40 +0200 Subject: [PATCH] post-pbs-install: fix component_exists_in_sources matching substrings of hyphenated tokens --- tools/pve/post-pbs-install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/pve/post-pbs-install.sh b/tools/pve/post-pbs-install.sh index 9c4af7664..1dbee5102 100644 --- a/tools/pve/post-pbs-install.sh +++ b/tools/pve/post-pbs-install.sh @@ -62,7 +62,14 @@ repo_state_list() { component_exists_in_sources() { local component="$1" - grep -h -E "^[^#]*Components:[^#]*\b${component}\b" /etc/apt/sources.list.d/*.sources 2>/dev/null | grep -q . + local line comp + while IFS= read -r line; do + line="${line#*Components:}" + for comp in $line; do + [[ "$comp" == "$component" ]] && return 0 + done + done < <(grep -h -E "^[^#]*Components:" /etc/apt/sources.list.d/*.sources 2>/dev/null) + return 1 } require_whiptail() {