Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
ftp.freebsg.org now downloads by http --> active ftp --> passive ftp #2
- Loading branch information
Showing
with
19 additions
and
6 deletions.
-
+19
−6
chroot/etc/finch/subr/i____download_unpack_freebsd
|
|
@@ -11,17 +11,19 @@ |
|
|
|
|
|
fetch_distfiles () |
|
|
{ |
|
|
local protocol="$1" |
|
|
|
|
|
cd "$finch_realpath/var/distfiles/finch" |
|
|
|
|
|
# fetch "ftp://ftp.freebsd.org/pub/FreeBSD/releases/$(uname -m)/$(uname -m)/$(uname -r | cut -d- -f1-2)/MANIFEST" || exit 1 |
|
|
# fetch "ftp://ftp.freebsd.org/pub/FreeBSD/releases/${_arch}/${_arch}/${_maj_min_rel}/MANIFEST" || install_failed "couldn't fetch files from ftp.freebsd.org" |
|
|
fetch "ftp://ftp.freebsd.org/${_ftp_dir}/MANIFEST" || return 1 |
|
|
fetch -T 30 "${protocol}://ftp.freebsd.org/${_ftp_dir}/MANIFEST" || return 1 |
|
|
|
|
|
for distfile in "base.txz" "doc.txz" "games.txz" "kernel.txz" "lib32.txz" "src.txz" |
|
|
do |
|
|
# fetch "ftp://ftp.freebsd.org/pub/FreeBSD/releases/$(uname -m)/$(uname -m)/$(uname -r | cut -d- -f1-2)/$distfile" |
|
|
# fetch "ftp://ftp.freebsd.org/pub/FreeBSD/releases/${_arch}/${_arch}/${_maj_min_rel}/$distfile" |
|
|
fetch -T 60 -v "ftp://ftp.freebsd.org/${_ftp_dir}/$distfile" || return 1 |
|
|
fetch -T 30 -v "${protocol}://ftp.freebsd.org/${_ftp_dir}/$distfile" || return 1 |
|
|
done |
|
|
} |
|
|
|
|
|
@@ -56,11 +58,22 @@ retry_active_ftp () |
|
|
rm -Rf "$finch_realpath/var/distfiles/finch" |
|
|
mkdir -p "$finch_realpath/var/distfiles/finch" |
|
|
|
|
|
echo "ftp fetch failure. Trying in ftp active mode." |
|
|
echo "http fetch failure. Trying ftp in active mode." |
|
|
export FTP_PASSIVE_MODE=NO |
|
|
fetch_distfiles "ftp" || ( unset FTP_PASSIVE_MODE; return 1 ) |
|
|
unset FTP_PASSIVE_MODE |
|
|
check_distfiles || return 1 |
|
|
} |
|
|
|
|
|
retry_passive_ftp () |
|
|
{ |
|
|
echo "cleaning failed distfiles." |
|
|
rm -Rf "$finch_realpath/var/distfiles/finch" |
|
|
mkdir -p "$finch_realpath/var/distfiles/finch" |
|
|
|
|
|
fetch_distfiles || install_failed "couldn't fetch files from ftp.freebsd.org" |
|
|
check_distfiles || install_failed "bad checksum for distfile $distfile" |
|
|
echo "active ftp fetch failure. Trying ftp in passive mode." |
|
|
fetch_distfiles "ftp" || install_failed "couldn't fetch files from ftp.freebsd.org" |
|
|
check_distfiles || install_failed "bad checksum for distfile $distfile" |
|
|
} |
|
|
|
|
|
unpack_distfiles () |
|
|
@@ -106,7 +119,7 @@ download_unpack_freebsd () |
|
|
_ftp_dir="pub/FreeBSD/snapshots/${_arch}/${_arch}/${_maj_min_rel}" |
|
|
fi |
|
|
|
|
|
fetch_distfiles && check_distfiles || retry_active_ftp; |
|
|
fetch_distfiles "http" && check_distfiles || retry_active_ftp || retry_passive_ftp; |
|
|
unpack_distfiles || install_failed "couldn't unpack distfiles from ftp.freebsd.org" |
|
|
fi |
|
|
} |
|
|
|