summaryrefslogtreecommitdiff
path: root/releng/airootfs/usr
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/airootfs/usr
parent072b36bf0e5a199fe038adffcadd99bbc4ab1dbc (diff)
downloadRaveOS-build-iso-ebdbb5d44dc099b433ee4e0a679d8cbe3eba74bd.tar.gz
RaveOS-build-iso-ebdbb5d44dc099b433ee4e0a679d8cbe3eba74bd.zip
raveos update
Diffstat (limited to 'releng/airootfs/usr')
-rwxr-xr-xreleng/airootfs/usr/local/bin/chaotic-rankmirrors11
1 files changed, 7 insertions, 4 deletions
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."