From b08addafe3bcb90240451c8e1fe1e8bbc6eada85 Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Mon, 2 Apr 2018 21:30:42 +0000 Subject: setup-apkrepos: fetch mirrors from mirrors.a.o --- setup-apkrepos.in | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/setup-apkrepos.in b/setup-apkrepos.in index 9354d0a..91c2806 100644 --- a/setup-apkrepos.in +++ b/setup-apkrepos.in @@ -2,6 +2,7 @@ PROGRAM=setup-apkrepos PREFIX= +MIRRORS_URL=https://mirrors.alpinelinux.org/mirrors.txt . $PREFIX/lib/libalpine.sh @@ -176,17 +177,8 @@ while getopts "1fhr" opt; do done shift $(($OPTIND - 1)) -# main -# install alpine-mirrors if its not already there -to_uninstall= -if ! apk info --quiet --installed alpine-mirrors; then - apk add --force --quiet --virtual .setup-apkrepos alpine-mirrors - to_uninstall=.setup-apkrepos -fi - -MIRRORS_PATH=/usr/share/alpine-mirrors/MIRRORS.txt -if [ -z "$MIRRORS" ] && [ -r "$MIRRORS_PATH" ]; then - MIRRORS=$(cat $MIRRORS_PATH) +if [ -z "$MIRRORS" ]; then + MIRRORS=$(wget -qO- $MIRRORS_URL) fi APKREPOS_PATH="${ROOT}"etc/apk/repositories @@ -242,7 +234,3 @@ if $changed; then apk update --quiet $apk_root_opt && echo "done." fi -# clean up -if [ -n "$to_uninstall" ]; then - apk del --quiet $to_uninstall -fi -- cgit v1.2.3