mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-08-28 23:30:59 +02:00
post-pve-install: fix component_exists_in_sources matching substrings of hyphenated tokens
This commit is contained in:
@@ -63,7 +63,14 @@ get_pve_major_minor() {
|
|||||||
|
|
||||||
component_exists_in_sources() {
|
component_exists_in_sources() {
|
||||||
local component="$1"
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
|
|||||||
Reference in New Issue
Block a user