about keeping a checksums table in a separate file
René J.V. Bertin
rjvbertin at gmail.com
Mon Feb 1 13:36:53 PST 2016
On Monday February 01 2016 15:16:29 Daniel J. Luke wrote:
> I don't think this would be as hard to implement as you seem to think it would be.
Maybe, indeed. I've grown a bit more humble in this aspect, over the years ;)
> As a first try, a really simple s/$oldchecksum/$newchecksum/ would probably work (I'm perhaps not creative enough to think of a use-case where that would false-positive and change something unintended).
How likely is it that two files would have the same oldchecksum but a different newchecksum? Probably very small for sha256, but the shorter the hash, the larger that likelihood. That still won't be an issue for most ports that only have checksums for a single file. Still, you'd probably want to know all old checksums of all (old) distfiles, and the corresponding new ones to check for aliasing before you start replacing.
A better non-trivial example than my KF5 Frameworks Portfile would be mcalhoun's port:qt5 Portfile. I'm not sure you need to connect the checksums with the distfile/subport in the Portfile (as opposed to in memory only), but that would probably be a challenge for this kind of coding.
More information about the macports-dev