bash
This commit is contained in:
parent
d29b1e4542
commit
a354df3d40
63 changed files with 26542 additions and 453 deletions
29
overlay/Linux/usr/local/src/gentoo_swget_urls.sh
Executable file
29
overlay/Linux/usr/local/src/gentoo_swget_urls.sh
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/bin/sh
|
||||
# -*- mode: sh; fill-column: 75; tab-width: 8; coding: utf-8-unix -*-
|
||||
ROLE=proxy
|
||||
|
||||
# filter - arguments are to wget - quoted?
|
||||
if [ "$#" -eq 0 ] ; then
|
||||
WARGS="-xc -P /i/net/Http --tries=1 --no-hsts"
|
||||
export CURL_OPTS="-C - --retry 3 --remote-name --create-dirs"
|
||||
else
|
||||
WARGS="$@"
|
||||
export CURL_OPTS="$@"
|
||||
fi
|
||||
grep ^http | \
|
||||
sed -e 's@ftp://[^ ]*@@' \
|
||||
-e 's@^https://distfiles.gentoo.org/distfiles/[^ ]* https://pypi.python.org/@https://pypi.python.org/@' \
|
||||
-e 's/http:/https:/' \
|
||||
-e 's@distfiles.gentoo.org/@mirror.leaseweb.com/gentoo/@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
|
||||
# wget --restrict-file-names=windows --no-verbose $WARGS $url || continue
|
||||
scurl.bash --directory-prefix /i/net/Http --force-directories \
|
||||
-- $CURL_OPTS $url || continue
|
||||
|
||||
break
|
||||
done
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue