# Contributor: Matt Smith # Maintainer: Natanael Copa pkgname=alpine-mirrors pkgver=3.5.7 pkgrel=0 pkgdesc="List of Alpine Linux Mirrors" url="https://alpinelinux.org/" arch="noarch" license="MIT" depends="" checkdepends="curl" install="" subpackages="" source="mirrors.yaml" build() { cd "$srcdir" awk '$1 == "-" && $2 ~ /^http:/ {print $2}' mirrors.yaml > MIRRORS.txt } check() { cd "$srcdir" local failed="" for i in $(cat MIRRORS.txt); do msg "testing $i" curl --head --connect-timeout 10 $i >/dev/null \ || failed="$failed $i" done if [ -n "$failed" ]; then error "Following mirrors failed:" for i in $failed; do echo $i done return 1 fi } package() { install -D -m644 "$srcdir"/mirrors.yaml \ "$pkgdir"/usr/share/alpine-mirrors/mirrors.yaml || return 1 install -D -m644 "$srcdir"/MIRRORS.txt \ "$pkgdir"/usr/share/alpine-mirrors/MIRRORS.txt || return 1 } sha512sums="e3affcbf83f6faddebe9b9a50e5cff64c4a5c5b0c0ff70e18ab3c9cac55247b1b6f5910e1e854d6b1a5278801e3862eb197fed8fea9fff2bcd96df54ad8bedbd mirrors.yaml"