Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jan 2004 12:01:18 +0100
From:      Oliver Eikemeier <eikemeier@fillmore-labs.com>
To:        Marc van Woerkom <marc.vanwoerkom@fernuni-hagen.de>
Cc:        ports@freebsd.org
Subject:   Re: SIZE criterion in distinfo
Message-ID:  <4018E7FE.3030205@fillmore-labs.com>
In-Reply-To: <opr2iwjx1mdmv4ke@mailstore.fernuni-hagen.de>
References:  <opr2iwjx1mdmv4ke@mailstore.fernuni-hagen.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Marc van Woerkom wrote:

> Hi porters,
> 
> I just see there is a new criterion in distinfo:
> 
>   root@oranje# cat distinfo
>   MD5 (xcdplayer-2.2.tar.Z) = d5d1d86abc4a0f5e2ea99a40ee63f98d
>   SIZE (xcdplayer-2.2.tar.Z) = 89435
> 
> May I ask the rationale behind adding SIZE?
> 
> According to
> 
>   http://www.faqs.org/rfcs/rfc1321.html
> 
> ("3.2 Step 2. Append Length") the size of the input data
> is used in the calculation of the MD5 hash.
> 
> In other words, if a fetched file has a different file length,
> than the original file, it will for sure have a different MD5
> hash.
> 
> So what is the benefit to have that SIZE checked?

- You can check if the file is just truncated (so that a resumed download
  will probably help) or has a mismatched checksum

- You can notify the user about the expected size of the download, including
  estimated download time (something like make downloadsize-recursive)

- You can check if the server has a valid file by asking the it for the size
  of the file without downloading it

- It is cheap ;-)

The distinfo file is smaller than a typical blocksize anyway, so you won't
loose any disk space by adding it. So go ahead, write a `downloadsize-recursive'
before someone else does it ;)

-Oliver



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4018E7FE.3030205>