contrib/download_prerequisites: Use http instead of ftp

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.
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(-)

-- 
2.17.1

Comments

Richard Biener Nov. 13, 2019, 2:32 p.m. | #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

>
Gerald Pfeifer Jan. 18, 2020, 2:11 p.m. | #2
On Tue, 12 Nov 2019, Janne Blomqvist 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:


Plus common web browsers are starting to deprecate and actually
remove support for the FTP protocol.  

Thank you for making this change, and I've made some associated
changes to our web pages, too, this week.  If you see any further
ones, let's proceed.

> 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?


I don't see a strong case for https over http in this context,
but would not be opposed either.

Gerald

Patch

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='.'