github portgroup design (was: Re: [MacPorts] #47951: tmux: moved from SF to Github)

Ryan Schmidt ryandesign at macports.org
Thu Jun 4 16:32:48 PDT 2015


On Jun 4, 2015, at 3:07 PM, Lawrence Velázquez wrote:

>> Comment (by ryandesign@…):
>> 
>> Replying to [comment:9 larryv@…]:
>>> Depends on where `github.setup` is called. We’ll actually have to handle
>>> this a bit carefully to get it right. The `github-1.0` portgroup is not
>>> one of our good ones.
>> 
>> I consider the github portgroup quite good. It's thoroughly documented in
>> the comments in the portgroup file, and it works great, as far as I know.
>> If you have problems with it let me know.
> 
> It's not broken or poorly documented, but it does use a setup proc, which I'm not fond of. As far as I can tell, the proc has to be called near the beginning of the portfile, or else it overwrites options that were set beforehand. I prefer that portgroups use "default".
> 
> It's not worth fussing over, though.

Oh, discussing good design of portgroups is worthwhile!

You are correct that the intention is that the github.setup proc be called early in the portfile, and it did used to overwrite a previously-set name variable, but this was since fixed. It looks like it still would overwrite a version variable, but I'm having trouble envisioning a situation in which that is actually a problem. 

I agree setup procs are not the best. But how would you implement the github portgroup differently to avoid it?

I think portgroups that don't do anything by default are best, as this makes it easier for portgroups to be combined or enabled only in subports for example; there must be some command or option that triggers the portgroup to do its thing. For example in the python 1.0 portgroup, setting python.versions is the trigger, and in the php 1.1 portgroup, setting php.branches is.

So what would be the trigger for a hypothetical new github portgroup, if not github.setup? . . . After a bit of consideration, perhaps setting github.author would make sense.

It's not too late to make a github 1.1 or 2.0 portgroup with a revised interface. I wouldn't mind looking into that at some point.




More information about the macports-dev mailing list