From 7d8a42fe97bbad3f02c135f025640d461b1c433b Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 21 Oct 2025 14:30:06 +0200 Subject: [PATCH] Filter and display available LXC container versions Added a grep to ensure only valid version numbers are listed and improved the display of available versions with formatting. This enhances clarity and prevents non-version strings from appearing in the version selection. --- misc/build.func | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/misc/build.func b/misc/build.func index 28635185..3c2b991f 100644 --- a/misc/build.func +++ b/misc/build.func @@ -3062,11 +3062,12 @@ create_lxc_container() { pveam available -section system 2>/dev/null | grep "^${PCT_OSTYPE}-" | sed -E 's/.*'"${PCT_OSTYPE}"'-([0-9]+\.[0-9]+).*/\1/' | - sort -V -u + grep -E '^[0-9]+\.[0-9]+$' | + sort -u -V 2>/dev/null || sort -u ) if [[ ${#AVAILABLE_VERSIONS[@]} -gt 0 ]]; then - msg_info "Available versions:" + echo -e "\n${BL}Available versions:${CL}" for i in "${!AVAILABLE_VERSIONS[@]}"; do echo " [$((i + 1))] ${AVAILABLE_VERSIONS[$i]}" done