loading checksums table from pre-checksum block?

Rainer Müller raimue at macports.org
Sat Oct 27 08:17:47 UTC 2018


On 2018-10-27 09: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).
> 
> Currently I have an explicit check that tests if the file exists in $filespath before sourcing it, to prevent errors when run from the registry.

Indeed, sourcing additional files is incompatible with storing the
Portfile in the registry. Don't do it.

> Doing it from a pre-checksum block would be more elegant and more efficient, but I cannot seem to figure out how to get the `source` command to apply to the correct context. 
> 
> How should I do that? I tried versions of the below with and without the quotes or the uplevel, none works:

pre-checksum would be run in a deeply nested context inside the port1.0
module. This is an implementation detail and Portfiles should not rely
on that. If you need to modify state outside of the proc, use a "global"
variable.

Rainer


More information about the macports-dev mailing list