Ron Pacheco | 16 Jun 2012 16:43

[qmailtoaster-devel] Download script with SHA1 verification

Devel,

Attached is my first shot at a download script that:

(1) Makes 10 retry attempts on a file; in the long run probably 
overkill, but right now with some mirror issues, it should be enough 
attempts to resolve any problems.

(2) Verifies a download against an SHA1 checksum. A checksum fail is 
simply considered a download fail and the download will be reattempted 
up to the retry limit. (On a checksum fail, both the srpm and sha1 file 
are removed before the retry, under the premise that either one could 
have been corrupt on download.)

I tested this extensively on my own servers, but I obviously could not 
test against the live servers since there are no SHA1 checksum files on 
the live download mirrors at present. Well, not that I know of. ;)

The script assumes the standard convention of the SHA1 file being name 
file.ext.sha1 for a file named file.ext.

Cheers,

Ron
#!/bin/sh

# To sha1sum or not to sha1sum
if [ "$1" = "-nosha1" ]; then
(Continue reading)

Eric Shubert | 16 Jun 2012 18:13
Favicon

Re: [qmailtoaster-devel] Download script with SHA1 verification

On 06/16/2012 07:43 AM, Ron Pacheco wrote:
> Devel,
>
> Attached is my first shot at a download script that:
>
> (1) Makes 10 retry attempts on a file; in the long run probably
> overkill, but right now with some mirror issues, it should be enough
> attempts to resolve any problems.
>
> (2) Verifies a download against an SHA1 checksum. A checksum fail is
> simply considered a download fail and the download will be reattempted
> up to the retry limit. (On a checksum fail, both the srpm and sha1 file
> are removed before the retry, under the premise that either one could
> have been corrupt on download.)
>
> I tested this extensively on my own servers, but I obviously could not
> test against the live servers since there are no SHA1 checksum files on
> the live download mirrors at present. Well, not that I know of. ;)
>
> The script assumes the standard convention of the SHA1 file being name
> file.ext.sha1 for a file named file.ext.
>
> Cheers,
>
> Ron
>
> ---------------------------------------------------------------------

That's a nice start, Ron.

(Continue reading)

Ron Pacheco | 16 Jun 2012 18:52

Re: [qmailtoaster-devel] Download script with SHA1 verification

Eric,

Comments noted, I will take a look at the scripts you indicate, and I 
will adhere to the indentation convention, no problems. I haven't 
actually used the qtp-* install procedures, I've always installed using 
the current-download-script.sh and the other distro specific scripts, 
but I'll take a look at the qtp-* stuff. Are there significant 
differences or any gotchas I need to lookout for?

Regards,

Ron

On 6/16/2012 11:13 AM, Eric Shubert wrote:
> On 06/16/2012 07:43 AM, Ron Pacheco wrote:
>> Devel,
>>
>> Attached is my first shot at a download script that:
>>
>> (1) Makes 10 retry attempts on a file; in the long run probably
>> overkill, but right now with some mirror issues, it should be enough
>> attempts to resolve any problems.
>>
>> (2) Verifies a download against an SHA1 checksum. A checksum fail is
>> simply considered a download fail and the download will be reattempted
>> up to the retry limit. (On a checksum fail, both the srpm and sha1 file
>> are removed before the retry, under the premise that either one could
>> have been corrupt on download.)
>>
>> I tested this extensively on my own servers, but I obviously could not
(Continue reading)

Eric Shubert | 16 Jun 2012 23:11
Favicon

Re: [qmailtoaster-devel] Download script with SHA1 verification

On 06/16/2012 09:52 AM, Ron Pacheco wrote:
> Eric,
>
> Comments noted, I will take a look at the scripts you indicate, and I
> will adhere to the indentation convention, no problems. I haven't
> actually used the qtp-* install procedures, I've always installed using
> the current-download-script.sh and the other distro specific scripts,
> but I'll take a look at the qtp-* stuff. Are there significant
> differences or any gotchas I need to lookout for?
>
> Regards,
>
> Ron

Probably, but I can't think of any off hand. The code is all in a 
subversion repo. so you should be able to grab it all en masse. At some 
point I'll give you authority to commit. Personally I use eSVN as a gui 
with svn. You can suit yourself as far as that goes.

Don't hesitate with questions.

--

-- 
-Eric 'shubes'

Gmane