From 6c5f2aa9c1700d703e643625c3d6b80f54ff75f3 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Sun, 15 Feb 2026 10:06:33 +0100 Subject: [PATCH] Set default REPO_SOURCE to ProxmoxVE Update hardcoded fallback REPO_SOURCE from ProxmoxVED to ProxmoxVE and clarify comment about production vs dev repository naming. Add fail-safe '|| true' to several detection pipelines (lspci for GPU and grep commands reading /proc/cpuinfo for CPU vendor/model) to avoid non-zero exits or empty outputs causing function failures and improve robustness. --- misc/api.func | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/misc/api.func b/misc/api.func index 783e03909..1cf9ab3f4 100644 --- a/misc/api.func +++ b/misc/api.func @@ -91,8 +91,8 @@ detect_repo_source() { community-scripts/ProxmoxVED) REPO_SOURCE="ProxmoxVED" ;; "") # No URL detected — use hardcoded fallback - # CI sed transforms this on promotion: ProxmoxVED → ProxmoxVE - REPO_SOURCE="ProxmoxVED" + # This value must match the repo: ProxmoxVE for production, ProxmoxVED for dev + REPO_SOURCE="ProxmoxVE" ;; *) # Fork or unknown repo @@ -335,7 +335,7 @@ detect_gpu() { GPU_PASSTHROUGH="unknown" local gpu_line - gpu_line=$(lspci 2>/dev/null | grep -iE "VGA|3D|Display" | head -1) + gpu_line=$(lspci 2>/dev/null | grep -iE "VGA|3D|Display" | head -1 || true) if [[ -n "$gpu_line" ]]; then # Extract model: everything after the colon, clean up @@ -374,7 +374,7 @@ detect_cpu() { if [[ -f /proc/cpuinfo ]]; then local vendor_id - vendor_id=$(grep -m1 "vendor_id" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | tr -d ' ') + vendor_id=$(grep -m1 "vendor_id" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | tr -d ' ' || true) case "$vendor_id" in GenuineIntel) CPU_VENDOR="intel" ;; @@ -388,7 +388,7 @@ detect_cpu() { esac # Extract model name and clean it up - CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ *//' | sed 's/(R)//g' | sed 's/(TM)//g' | sed 's/ */ /g' | cut -c1-64) + CPU_MODEL=$(grep -m1 "model name" /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ *//' | sed 's/(R)//g' | sed 's/(TM)//g' | sed 's/ */ /g' | cut -c1-64 || true) fi export CPU_VENDOR CPU_MODEL