From 95708df841fd147ae0d178d3dcd35b0e0417e2a7 Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 8 Oct 2025 18:47:22 -0400 Subject: [PATCH] Setting install to 0.51.1 On branch hl-051 Your branch is up to date with 'origin/hl-051'. Changes to be committed: modified: install.sh modified: refresh-hypr-tags.sh modified: update-hyprland.sh --- install.sh | 11 +++++------ refresh-hypr-tags.sh | 18 ++++++++++++++---- update-hyprland.sh | 12 +++++++++++- 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/install.sh b/install.sh index 80c36c0..22d5bfb 100755 --- a/install.sh +++ b/install.sh @@ -368,12 +368,11 @@ echo "${INFO} Installing ${SKY_BLUE}necessary fonts...${RESET}" | tee -a "$LOG" sleep 1 execute_script "fonts.sh" -# Auto-refresh tags before building the Hyprland stack (can be disabled with NO_FETCH_LATEST=1) -if [ -z "${NO_FETCH_LATEST:-}" ] || [ "${NO_FETCH_LATEST:-0}" = "0" ]; then - if [ -f ./refresh-hypr-tags.sh ]; then - chmod +x ./refresh-hypr-tags.sh || true - ./refresh-hypr-tags.sh - fi +# Optional: refresh tags before building the Hyprland stack +# Set FETCH_LATEST=1 to opt-in (default is no-refresh to honor pinned tags) +if [ "${FETCH_LATEST:-0}" = "1" ] && [ -f ./refresh-hypr-tags.sh ]; then + chmod +x ./refresh-hypr-tags.sh || true + ./refresh-hypr-tags.sh fi echo "${INFO} Installing ${SKY_BLUE}KooL Hyprland packages...${RESET}" | tee -a "$LOG" diff --git a/refresh-hypr-tags.sh b/refresh-hypr-tags.sh index 4616569..aa07f9b 100644 --- a/refresh-hypr-tags.sh +++ b/refresh-hypr-tags.sh @@ -56,11 +56,12 @@ while IFS='=' read -r k v; do cur[$k]="$v" edone < "$TAGS_FILE" -# Fetch latest +# Fetch latest, but only update keys set to 'auto' or 'latest' unless forced +FORCE=${FORCE:-0} for key in "${!repos[@]}"; do repo="${repos[$key]}" url="https://api.github.com/repos/$repo/releases/latest" - echo "[INFO] Fetching latest tag for $repo" | tee -a "$SUMMARY_LOG" + echo "[INFO] Checking latest tag for $repo" | tee -a "$SUMMARY_LOG" body=$(curl -fsSL "$url" || true) [[ -z "$body" ]] && { echo "[WARN] Empty response for $repo" | tee -a "$SUMMARY_LOG"; continue; } if command -v jq >/dev/null 2>&1; then @@ -68,8 +69,17 @@ for key in "${!repos[@]}"; do else tag=$(printf '%s' "$body" | grep -m1 '"tag_name"' | sed -E 's/.*"tag_name"\s*:\s*"([^"]+)".*/\1/') fi - [[ -n "$tag" ]] && cur[$key]="$tag" || echo "[WARN] Could not parse tag for $repo" | tee -a "$SUMMARY_LOG" - + if [[ -z "$tag" ]]; then + echo "[WARN] Could not parse tag for $repo" | tee -a "$SUMMARY_LOG" + continue + fi + existing="${cur[$key]:-}" + if [[ $FORCE -eq 1 ]] || [[ "$existing" =~ ^(auto|latest)$ ]] || [[ -z "$existing" ]]; then + cur[$key]="$tag" + echo "[OK] $key := $tag" | tee -a "$SUMMARY_LOG" + else + echo "[SKIP] $key pinned ($existing), not overriding" | tee -a "$SUMMARY_LOG" + fi done # Write back diff --git a/update-hyprland.sh b/update-hyprland.sh index 8c57d0d..e134a8b 100755 --- a/update-hyprland.sh +++ b/update-hyprland.sh @@ -137,6 +137,13 @@ fetch_latest_tags() { exit 1 fi + # Read existing to respect pinned values (only update keys set to 'auto' or 'latest') + declare -A existing + while IFS='=' read -r k v; do + [[ -z "$k" || "$k" =~ ^# ]] && continue + existing[$k]="$v" + done < "$TAGS_FILE" + declare -A repos=( [HYPRLAND_TAG]="hyprwm/Hyprland" [AQUAMARINE_TAG]="hyprwm/aquamarine" @@ -180,7 +187,10 @@ fetch_latest_tags() { done < "$TAGS_FILE" for k in "${!tags[@]}"; do - map[$k]="${tags[$k]}" + # Only override if pinned value is 'auto' or 'latest' + if [[ "${existing[$k]:-}" =~ ^(auto|latest)$ ]] || [[ -z "${existing[$k]:-}" ]]; then + map[$k]="${tags[$k]}" + fi done {