There was an error while loading. Please reload this page.
1 parent c1929dc commit 506ca2cCopy full SHA for 506ca2c
1 file changed
tools/pve/post-pve-install.sh
@@ -63,7 +63,14 @@ get_pve_major_minor() {
63
64
component_exists_in_sources() {
65
local component="$1"
66
- grep -h -E "^[^#]*Components:[^#]*\b${component}\b" /etc/apt/sources.list.d/*.sources 2>/dev/null | grep -q .
+ local line comp
67
+ while IFS= read -r line; do
68
+ line="${line#*Components:}"
69
+ for comp in $line; do
70
+ [[ "$comp" == "$component" ]] && return 0
71
+ done
72
+ done < <(grep -h -E "^[^#]*Components:" /etc/apt/sources.list.d/*.sources 2>/dev/null)
73
+ return 1
74
}
75
76
main() {
0 commit comments