summaryrefslogtreecommitdiff
path: root/releng
diff options
context:
space:
mode:
authorNippy <nippy@rp1.hu>2026-05-10 11:07:45 +0200
committerNippy <nippy@rp1.hu>2026-05-10 11:07:45 +0200
commitebdbb5d44dc099b433ee4e0a679d8cbe3eba74bd (patch)
tree9fed134e5389545a7247b2d7a3f78fad1684f855 /releng
parent072b36bf0e5a199fe038adffcadd99bbc4ab1dbc (diff)
downloadRaveOS-build-iso-ebdbb5d44dc099b433ee4e0a679d8cbe3eba74bd.tar.gz
RaveOS-build-iso-ebdbb5d44dc099b433ee4e0a679d8cbe3eba74bd.zip
raveos update
Diffstat (limited to 'releng')
-rw-r--r--releng/airootfs/etc/systemd/system/chaotic-rankmirrors.service2
-rwxr-xr-xreleng/airootfs/usr/local/bin/chaotic-rankmirrors11
2 files changed, 8 insertions, 5 deletions
diff --git a/releng/airootfs/etc/systemd/system/chaotic-rankmirrors.service b/releng/airootfs/etc/systemd/system/chaotic-rankmirrors.service
index d0d3a03..5805163 100644
--- a/releng/airootfs/etc/systemd/system/chaotic-rankmirrors.service
+++ b/releng/airootfs/etc/systemd/system/chaotic-rankmirrors.service
@@ -5,7 +5,7 @@ After=network-online.target
[Service]
Type=oneshot
-ExecStart=/usr/local/bin/chaotic-rankmirrors
+ExecStart=-/usr/local/bin/chaotic-rankmirrors
[Install]
WantedBy=multi-user.target
diff --git a/releng/airootfs/usr/local/bin/chaotic-rankmirrors b/releng/airootfs/usr/local/bin/chaotic-rankmirrors
index 71c256e..931d923 100755
--- a/releng/airootfs/usr/local/bin/chaotic-rankmirrors
+++ b/releng/airootfs/usr/local/bin/chaotic-rankmirrors
@@ -36,19 +36,22 @@ if [ ! -s "$tmp" ]; then
exit 0
fi
-mapfile -t top < <(sort -n "$tmp" | head -n "$TOP_N")
+sorted=$(sort -n "$tmp")
rm -f "$tmp"
cp "$MIRRORLIST" "${MIRRORLIST}.bak" 2>/dev/null || true
+count=0
{
echo "# Chaotic-AUR mirrorlist"
echo "# Generated by chaotic-rankmirrors on $(date)"
echo ""
- for e in "${top[@]}"; do
+ while IFS= read -r e; do
+ [ "$count" -ge "$TOP_N" ] && break
m="${e#* }"
echo "Server = https://${m}.chaotic.cx/\$repo/\$arch"
- done
+ count=$((count + 1))
+ done <<< "$sorted"
} > "$MIRRORLIST"
-echo "==> Done. Updated mirrorlist with ${#top[@]} fastest mirrors."
+echo "==> Done. Updated mirrorlist with ${count} fastest mirrors."