quickfix: mapfile for _standard_ mapping
Some checks are pending
Auto Update .app-files / update-app-files (push) Waiting to run
Create Changelog Pull Request / update-changelog-pull-request (push) Waiting to run
Close Discussion on PR Merge / close-discussion (push) Waiting to run
Frontend CI/CD / test-json-files (push) Waiting to run
Frontend CI/CD / build (push) Blocked by required conditions
Frontend CI/CD / deploy (push) Blocked by required conditions
Sync to Gitea / sync (push) Waiting to run

there was an issue, that when debian-12-standard% not available, it uses debian-12-turnkey-xxxx
This commit is contained in:
CanbiZ 2025-08-19 16:24:26 +02:00
parent 304c90a1af
commit 7df1dbaf17

View file

@ -254,7 +254,8 @@ TEMPLATE_SEARCH="${PCT_OSTYPE}-${PCT_OSVERSION:-}"
# 1. Check local templates first # 1. Check local templates first
msg_info "Searching for template '$TEMPLATE_SEARCH'" msg_info "Searching for template '$TEMPLATE_SEARCH'"
mapfile -t TEMPLATES < <( mapfile -t TEMPLATES < <(
pveam list "$TEMPLATE_STORAGE" | awk -v s="$TEMPLATE_SEARCH" '$1 ~ s {print $1}' | pveam list "$TEMPLATE_STORAGE" |
awk -v s="$TEMPLATE_SEARCH" '$1 ~ s && $1 ~ /-standard_/ {print $1}' |
sed 's/.*\///' | sort -t - -k 2 -V sed 's/.*\///' | sort -t - -k 2 -V
) )
@ -264,8 +265,10 @@ else
msg_info "No local template found, checking online repository" msg_info "No local template found, checking online repository"
pveam update >/dev/null 2>&1 pveam update >/dev/null 2>&1
mapfile -t TEMPLATES < <( mapfile -t TEMPLATES < <(
pveam available -section system | sed -n "s/.*\($TEMPLATE_SEARCH.*\)/\1/p" | pveam update >/dev/null 2>&1 &&
sort -t - -k 2 -V pveam available -section system |
sed -n "s/.*\($TEMPLATE_SEARCH.*-standard_.*\)/\1/p" |
sort -t - -k 2 -V
) )
TEMPLATE_SOURCE="online" TEMPLATE_SOURCE="online"
fi fi