contrib/download_prerequisites: Use http instead of ftp
diff mbox series

Message ID 20191112193416.21246-1-blomqvist.janne@gmail.com
State New
Headers show
Series
  • contrib/download_prerequisites: Use http instead of ftp
Related show

Commit Message

Janne Blomqvist Nov. 12, 2019, 7:34 p.m. UTC
Convert the download_prerequisites script to use http instead of
ftp. This works better with firewalls, proxies, and so on. It's also
faster, a quick test on my system before patch:

time contrib/download_prerequisites --directory=/tmp/foo --force
...
real	0m17,843s

After patch:

time contrib/download_prerequisites --directory=/tmp/foo --force
...
real	0m11,059s

(fastest of three runs)

Question: Should we in fact use https? I haven't used it since
download_prerequisites checks that the sha512/md5 matches the ones in
the GCC tree, but maybe there are reasons? Even https is in fact
faster than ftp:

time contrib/download_prerequisites --directory=/tmp/foo --force
...
real	0m12,729s
---
 contrib/download_prerequisites | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Richard Biener Nov. 13, 2019, 2:32 p.m. UTC | #1
On Tue, Nov 12, 2019 at 8:34 PM Janne Blomqvist
<blomqvist.janne@gmail.com> wrote:
>
> Convert the download_prerequisites script to use http instead of
> ftp. This works better with firewalls, proxies, and so on. It's also
> faster, a quick test on my system before patch:
>
> time contrib/download_prerequisites --directory=/tmp/foo --force
> ...
> real    0m17,843s
>
> After patch:
>
> time contrib/download_prerequisites --directory=/tmp/foo --force
> ...
> real    0m11,059s
>
> (fastest of three runs)

OK.

> Question: Should we in fact use https? I haven't used it since
> download_prerequisites checks that the sha512/md5 matches the ones in
> the GCC tree, but maybe there are reasons? Even https is in fact
> faster than ftp:
>
> time contrib/download_prerequisites --directory=/tmp/foo --force
> ...
> real    0m12,729s
> ---
>  contrib/download_prerequisites | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites
> index 72976c46c92..aa0356e6266 100755
> --- a/contrib/download_prerequisites
> +++ b/contrib/download_prerequisites
> @@ -32,7 +32,7 @@ mpfr='mpfr-3.1.4.tar.bz2'
>  mpc='mpc-1.0.3.tar.gz'
>  isl='isl-0.18.tar.bz2'
>
> -base_url='ftp://gcc.gnu.org/pub/gcc/infrastructure/'
> +base_url='http://gcc.gnu.org/pub/gcc/infrastructure/'
>
>  echo_archives() {
>      echo "${gmp}"
> @@ -58,7 +58,7 @@ esac
>  if type wget > /dev/null ; then
>    fetch='wget'
>  else
> -  fetch='curl -LO -u anonymous:'
> +  fetch='curl -LO'
>  fi
>  chksum_extension='sha512'
>  directory='.'
> --
> 2.17.1
>

Patch
diff mbox series

diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites
index 72976c46c92..aa0356e6266 100755
--- a/contrib/download_prerequisites
+++ b/contrib/download_prerequisites
@@ -32,7 +32,7 @@  mpfr='mpfr-3.1.4.tar.bz2'
 mpc='mpc-1.0.3.tar.gz'
 isl='isl-0.18.tar.bz2'
 
-base_url='ftp://gcc.gnu.org/pub/gcc/infrastructure/'
+base_url='http://gcc.gnu.org/pub/gcc/infrastructure/'
 
 echo_archives() {
     echo "${gmp}"
@@ -58,7 +58,7 @@  esac
 if type wget > /dev/null ; then
   fetch='wget'
 else
-  fetch='curl -LO -u anonymous:'
+  fetch='curl -LO'
 fi
 chksum_extension='sha512'
 directory='.'