Fixing scripts to fetch last core and build order

On branch hl-051
 Your branch is up to date with 'origin/hl-051'.

 Changes to be committed:
	modified:   install.sh
	new file:   refresh-hypr-tags.sh
	modified:   update-hyprland.sh
This commit is contained in:
Don Williams 2025-10-08 15:19:02 -04:00
parent 82367a41ae
commit becb1af622
3 changed files with 104 additions and 0 deletions

View File

@ -368,6 +368,14 @@ echo "${INFO} Installing ${SKY_BLUE}necessary fonts...${RESET}" | tee -a "$LOG"
sleep 1 sleep 1
execute_script "fonts.sh" 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
fi
echo "${INFO} Installing ${SKY_BLUE}KooL Hyprland packages...${RESET}" | tee -a "$LOG" echo "${INFO} Installing ${SKY_BLUE}KooL Hyprland packages...${RESET}" | tee -a "$LOG"
sleep 1 sleep 1
execute_script "01-hypr-pkgs.sh" execute_script "01-hypr-pkgs.sh"

82
refresh-hypr-tags.sh Normal file
View File

@ -0,0 +1,82 @@
#!/usr/bin/env bash
# Refresh hypr-tags.env with latest release tags from upstream
# Safe to run multiple times; creates timestamped backups
set -euo pipefail
REPO_ROOT=$(pwd)
TAGS_FILE="$REPO_ROOT/hypr-tags.env"
LOG_DIR="$REPO_ROOT/Install-Logs"
mkdir -p "$LOG_DIR"
TS=$(date +%F-%H%M%S)
SUMMARY_LOG="$LOG_DIR/refresh-tags-$TS.log"
# Ensure tags file exists
if [[ ! -f "$TAGS_FILE" ]]; then
cat > "$TAGS_FILE" <<'EOF'
HYPRLAND_TAG=v0.51.1
AQUAMARINE_TAG=v0.9.3
HYPRUTILS_TAG=v0.8.2
HYPRLANG_TAG=v0.6.4
HYPRGRAPHICS_TAG=v0.1.5
HYPRWAYLAND_SCANNER_TAG=v0.4.5
HYPRLAND_PROTOCOLS_TAG=v0.6.4
HYPRLAND_QT_SUPPORT_TAG=v0.1.0
HYPRLAND_QTUTILS_TAG=v0.1.4
WAYLAND_PROTOCOLS_TAG=1.45
EOF
fi
# Backup
cp "$TAGS_FILE" "$TAGS_FILE.bak-$TS"
echo "[INFO] Backed up $TAGS_FILE to $TAGS_FILE.bak-$TS" | tee -a "$SUMMARY_LOG"
if ! command -v curl >/dev/null 2>&1; then
echo "[ERROR] curl is required to refresh tags" | tee -a "$SUMMARY_LOG"
exit 1
fi
# Map of env var -> repo
declare -A repos=(
[HYPRLAND_TAG]="hyprwm/Hyprland"
[AQUAMARINE_TAG]="hyprwm/aquamarine"
[HYPRUTILS_TAG]="hyprwm/hyprutils"
[HYPRLANG_TAG]="hyprwm/hyprlang"
[HYPRGRAPHICS_TAG]="hyprwm/hyprgraphics"
[HYPRWAYLAND_SCANNER_TAG]="hyprwm/hyprwayland-scanner"
[HYPRLAND_PROTOCOLS_TAG]="hyprwm/hyprland-protocols"
[HYPRLAND_QT_SUPPORT_TAG]="hyprwm/hyprland-qt-support"
[HYPRLAND_QTUTILS_TAG]="hyprwm/hyprland-qtutils"
)
# Read existing
declare -A cur
while IFS='=' read -r k v; do
[[ -z "${k:-}" || "$k" =~ ^# ]] && continue
cur[$k]="$v"
edone < "$TAGS_FILE"
# Fetch latest
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"
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
tag=$(printf '%s' "$body" | jq -r '.tag_name // empty')
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"
done
# Write back
{
for k in "${!cur[@]}"; do
echo "$k=${cur[$k]}"
done | sort
} > "$TAGS_FILE"
echo "[OK] Refreshed tags written to $TAGS_FILE" | tee -a "$SUMMARY_LOG"

View File

@ -51,6 +51,7 @@ DO_DRY_RUN=0
FETCH_LATEST=0 FETCH_LATEST=0
RESTORE=0 RESTORE=0
VIA_HELPER=0 VIA_HELPER=0
NO_FETCH=0
ONLY_LIST="" ONLY_LIST=""
SKIP_LIST="" SKIP_LIST=""
SET_ARGS=() SET_ARGS=()
@ -230,6 +231,18 @@ export HYPRLAND_TAG AQUAMARINE_TAG HYPRUTILS_TAG HYPRLANG_TAG HYPRGRAPHICS_TAG H
# Ensure core prerequisites are installed before hyprland on install runs # Ensure core prerequisites are installed before hyprland on install runs
# Order: wayland-protocols-src, hyprland-protocols, hyprutils, hyprlang, aquamarine, hyprland # Order: wayland-protocols-src, hyprland-protocols, hyprutils, hyprlang, aquamarine, hyprland
if [[ $DO_INSTALL -eq 1 ]]; then if [[ $DO_INSTALL -eq 1 ]]; then
# Auto-fetch latest tags for Hyprland stack unless disabled
if [[ $NO_FETCH -eq 0 ]]; then
# Detect whether hyprland is part of the run
need_fetch=0
for m in "${modules[@]}"; do
[[ "$m" == "hyprland" ]] && need_fetch=1
done
if [[ $need_fetch -eq 1 ]]; then
echo "[INFO] Auto-fetching latest tags for Hyprland stack" | tee -a "$SUMMARY_LOG"
fetch_latest_tags
fi
fi
local has_hl=0 has_aqua=0 has_wp=0 has_utils=0 has_lang=0 has_hlprot=0 local has_hl=0 has_aqua=0 has_wp=0 has_utils=0 has_lang=0 has_hlprot=0
for m in "${modules[@]}"; do for m in "${modules[@]}"; do
[[ "$m" == "hyprland" ]] && has_hl=1 [[ "$m" == "hyprland" ]] && has_hl=1
@ -346,6 +359,7 @@ while [[ $# -gt 0 ]]; do
--fetch-latest) FETCH_LATEST=1; shift ;; --fetch-latest) FETCH_LATEST=1; shift ;;
--restore) RESTORE=1; shift ;; --restore) RESTORE=1; shift ;;
--via-helper) VIA_HELPER=1; shift ;; --via-helper) VIA_HELPER=1; shift ;;
--no-fetch) NO_FETCH=1; shift ;;
--only) ONLY_LIST=${2:-}; shift 2 ;; --only) ONLY_LIST=${2:-}; shift 2 ;;
--skip) SKIP_LIST=${2:-}; shift 2 ;; --skip) SKIP_LIST=${2:-}; shift 2 ;;
--set) --set)