loading checksums table from pre-checksum block?

Ryan Schmidt ryandesign at macports.org
Sat Oct 27 18:17:44 UTC 2018



On Oct 27, 2018, at 02:16, René J.V. Bertin wrote:

> I have a port with lots of subports for which I keep the checksums in a table-like structure in a dedicated file, so as to keep the Portfile a bit more manageable (and to be able to generate said table with a script when it's upgrade time).

As Rainer said, sourcing a separate file into a Portfile is not supported. You can either set the checksums in the Portfile normally, or keep your table-like structure in the Portfile itself (which several other more complicated portfiles already do, such as qt5). Your script to automate upgrading this could either print out the new checksums directives or the table-like structure for you to manually copy into the Portfile, or it could find and replace the relevant section of the Portfile.

If each subport has distinct distfiles, it would be more straightforward to just put the checksums directive for that subport into the subport. If some subports share the same distfiles, then I could see the value of keeping each file's data in a table only once to avoid repeating it in several places.


> (the Portfile contains a procedure called from each subport that gets and sets the checksums for that subport.)

It is acceptable to list checksums for files a port does not use. So you could use a single checksums directive and list all files used by all subports, if that makes it easier.



More information about the macports-dev mailing list