From ed40e44b610cac878f17fa4233d8e3d19b8d67bb Mon Sep 17 00:00:00 2001 From: tranch Date: Thu, 9 Jul 2026 16:53:52 +0800 Subject: Configure AeroCore image mirrors Add build-time mirror configuration for Flatpak and Homebrew, expose the related build args, and install an AeroCore-owned profile script to load mirror environment files. Rename the mirror configuration files from the Bazzite-prefixed names to AeroCore-prefixed names while keeping the upstream Bazzite helper reference intact. Verification: bash -n system_files/etc/profile.d/aerocore-mirrors.sh && bash -n build_files/build.sh --- system_files/etc/profile.d/aerocore-mirrors.sh | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 system_files/etc/profile.d/aerocore-mirrors.sh (limited to 'system_files/etc/profile.d') diff --git a/system_files/etc/profile.d/aerocore-mirrors.sh b/system_files/etc/profile.d/aerocore-mirrors.sh new file mode 100644 index 0000000..e9b93ab --- /dev/null +++ b/system_files/etc/profile.d/aerocore-mirrors.sh @@ -0,0 +1,28 @@ +#!/usr/bin/bash + +[[ -r /usr/libexec/bazzite-mirror-utils.sh ]] && source /usr/libexec/bazzite-mirror-utils.sh + +if ! declare -F is_valid_mirror_url >/dev/null; then + is_valid_mirror_url() { + [[ "$1" =~ ^https?://[^[:space:]]+$ ]] + } +fi + +load_mirror_file() { + local file="$1" + [[ -r "$file" ]] || return + + while IFS='=' read -r key value; do + [[ -z "$key" || "${key:0:1}" == "#" ]] && continue + case "$key" in + FLATPAK_REMOTE_URL|HOMEBREW_BOTTLE_DOMAIN|HOMEBREW_API_DOMAIN) + if is_valid_mirror_url "$value"; then + export "$key"="$value" + fi + ;; + esac +done <"$file" +} + +load_mirror_file /etc/environment.d/99-aerocore-mirrors.conf +load_mirror_file "$HOME/.config/environment.d/99-aerocore-mirrors.conf" -- cgit v1.2.3