27 lines
858 B
Bash
27 lines
858 B
Bash
|
#!/bin/sh
|
||
|
# filter - arguments are to wget - quoted?
|
||
|
|
||
|
ROOTDIR=/mnt/i
|
||
|
ROLE=base
|
||
|
|
||
|
LARGS="-X -P /o/Cache/Apt/Devuan/4"
|
||
|
RARGS="--retry 1"
|
||
|
|
||
|
grep ^http | \
|
||
|
sed -e 's@http://@https://@g' \
|
||
|
| \
|
||
|
sed -e 's@ftp://[^ ]*@@' \
|
||
|
-e 's@^https://distfiles.gentoo.org/distfiles/[^ ]* https://pypi.python.org/@https://pypi.python.org/@' \
|
||
|
-e 's@https*://distfiles.gentoo.org@https://gentoo.osuosl.org@g' \
|
||
|
-e 's@https*://gentoo.osuosl.org@https://mirror.leaseweb.com/gentoo@g' \
|
||
|
-e 's@https*://download.sourceforge.net@https://download.sourceforge.net@g' | \
|
||
|
while read urls ; do
|
||
|
url=`echo $urls|sed -e 's@ .*@@'`
|
||
|
base=`basename "$url"`
|
||
|
[ -e /usr/portage/distfiles/$base ] && echo distfiles/$base && continue
|
||
|
for url in $urls ; do
|
||
|
/usr/local/bin/scurl.bash $LARGS -- $RARGS $url || continue
|
||
|
break
|
||
|
done
|
||
|
done
|