From 5e6fa752c71bbb78650858d23f264a308afdb5ed Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 21 Oct 2025 15:30:24 +0200 Subject: [PATCH] Update build.func --- misc/build.func | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/misc/build.func b/misc/build.func index a09f3bab..edbca67e 100644 --- a/misc/build.func +++ b/misc/build.func @@ -3015,16 +3015,14 @@ create_lxc_container() { echo "[DEBUG] pveam available output (first 5 lines with .tar files):" pveam available -section system 2>/dev/null | grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' | head -5 | sed 's/^/ /' - + mapfile -t ONLINE_TEMPLATES < <( pveam available -section system 2>/dev/null | grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' | - awk '{print $1}' | + awk -F'\t' '{print $1}' | grep -E "${SEARCH_PATTERN}.*${TEMPLATE_PATTERN}" | - sort -t - -k 2 -V - ) - - echo "[DEBUG] After filtering: ${#ONLINE_TEMPLATES[@]} online templates found" + sort -t - -k 2 -V 2>/dev/null || true + ) echo "[DEBUG] After filtering: ${#ONLINE_TEMPLATES[@]} online templates found" if [[ ${#ONLINE_TEMPLATES[@]} -gt 0 ]]; then echo "[DEBUG] Online templates:" for tmpl in "${ONLINE_TEMPLATES[@]}"; do @@ -3104,9 +3102,9 @@ create_lxc_container() { mapfile -t ONLINE_TEMPLATES < <( pveam available -section system 2>/dev/null | grep -E '\.(tar\.zst|tar\.xz|tar\.gz)$' | - awk '{print $1}' | + awk -F'\t' '{print $1}' | grep -E "${SEARCH_PATTERN}.*${TEMPLATE_PATTERN}" | - sort -t - -k 2 -V + sort -t - -k 2 -V 2>/dev/null || true ) ONLINE_TEMPLATE="" [[ ${#ONLINE_TEMPLATES[@]} -gt 0 ]] && ONLINE_TEMPLATE="${ONLINE_TEMPLATES[-1]}"