On 04/13/2017 05:29 PM, Damian Rouson wrote:
Resending as plain text:

 On April 12, 2017 at 3:03:19 PM, Jeff Law 
(l...@redhat.com(mailto:l...@redhat.com)) wrote:

 > >
 > > 2017-04-05 Damian Rouson
 > >
 > > * download_prerequisites (md5_check): New function emulates Linux
 > > 'md5 --check' on macOS. Modified script for macOS compatibility.
 > I wonder if we should just switch to curl from wget in general rather
 > than conditionalizing the code at all.

 Hi Jeff,


Thanks for your comments. The conditionals are more portable than hardwiring 
one choice. On macOS, curl is always present but not wget. On the Linux 
distribution that I use (Lubuntu), wget is always present but curl isn’t 
installed by default.

It sounds like using the first of the two utilities that's in PATH,
similarly to the sha512/md5sum approach discussed below, would be
a more robust solution.  That way it will work on any distribution
that provides either utility, and it will also be possible to test
the script both ways on either kind of system without having to make
changes to it.

Martin

My goal was to support as many users as possible without requiring them to 
install prerequisites just to download the prerequisites. :) As my first 
contribution of a patch to GCC, I took the baby step of allowing for the use of 
curl. If acceptable, my next step would be to allow for the use of ftp when 
neither curl nor wget is present. That’s what I do in the scripts from which I 
culled the code in the patch. In those scripts, I invoke ftp via the following 
function:

https://github.com/sourceryinstitute/OpenCoarrays/blob/master/prerequisites/build-functions/ftp_url.sh

 >
 >
 > For the sums, rather than doing a check of the OS, just see if
 > sha512/md5sum exists. If not, then fallback to the Darwin defaults.

I think I tried that first and ran into some difficulties. I’ll make another 
attempt. My recent shell programming experience is with the bash shell and I 
have some experience with the C-shell from years ago, but I had no experience 
with writing Bourne shell scripts before writing this patch and I think the 
problem I encountered was related to differences between Bourne and bash.


 Damian


Reply via email to