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.
This commit is contained in:
CanbiZ (MickLesk)
2026-02-15 10:06:33 +01:00
parent 2d3c346650
commit 6c5f2aa9c1

View File

@@ -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