SIZE criterion in distinfo
Oliver Eikemeier
eikemeier at fillmore-labs.com
Thu Jan 29 03:01:45 PST 2004
Marc van Woerkom wrote:
> Hi porters,
>
> I just see there is a new criterion in distinfo:
>
> root at 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
More information about the freebsd-ports
mailing list