summaryrefslogtreecommitdiff
path: root/system_files/usr/libexec
diff options
context:
space:
mode:
authortranch <tranch.xiao@gmail.com>2026-11-18 08:11:29 +0800
committertranch <tranch.xiao@gmail.com>2026-11-18 08:11:29 +0800
commitde9a4f9275afccbaf0b18d1b8e18a17e3070102f (patch)
treee567cd49c63b17c7809b19117d69889ca4f3c4eb /system_files/usr/libexec
parent977a1e6fb81dfc264fa1e5d87652a37508fedaf8 (diff)
parent95702ac4933104a7e3b6c512982fdf9334409379 (diff)
downloadAeroCore-OS-de9a4f9275afccbaf0b18d1b8e18a17e3070102f.tar.gz
AeroCore-OS-de9a4f9275afccbaf0b18d1b8e18a17e3070102f.zip
Merge testing-45.20261117 into main45.20261118
* testing: ci: add scheduled GHCR image cleanup build: align testing with Bazzite 45.20261117 Update existing Flatpak remotes at boot Make Flatpak mirror setup resilient
Diffstat (limited to 'system_files/usr/libexec')
-rwxr-xr-xsystem_files/usr/libexec/aerocore-configure-flatpak-mirror21
1 files changed, 21 insertions, 0 deletions
diff --git a/system_files/usr/libexec/aerocore-configure-flatpak-mirror b/system_files/usr/libexec/aerocore-configure-flatpak-mirror
new file mode 100755
index 0000000..42b1d84
--- /dev/null
+++ b/system_files/usr/libexec/aerocore-configure-flatpak-mirror
@@ -0,0 +1,21 @@
+#!/usr/bin/bash
+
+set -u
+
+config_file=/etc/environment.d/99-aerocore-mirrors.conf
+[[ -r "${config_file}" ]] || exit 0
+
+FLATPAK_REMOTE_URL="$(sed -n 's/^FLATPAK_REMOTE_URL=//p' "${config_file}" | tail -n 1)"
+[[ -n "${FLATPAK_REMOTE_URL}" ]] || exit 0
+[[ "${FLATPAK_REMOTE_URL}" =~ ^https?://[^[:space:]]+$ ]] || {
+ echo "Ignoring invalid FLATPAK_REMOTE_URL: ${FLATPAK_REMOTE_URL}" >&2
+ exit 0
+}
+
+mirror_url="${FLATPAK_REMOTE_URL%/}/"
+if flatpak remotes --system --columns=name | grep -Fxq flathub; then
+ flatpak remote-modify --system flathub --url="${mirror_url}"
+else
+ flatpak remote-add --system --if-not-exists flathub /etc/flatpak/remotes.d/flathub.flatpakrepo
+ flatpak remote-modify --system flathub --url="${mirror_url}"
+fi