Automatic homepage for sourceforge, googlecode, etc.

Ryan Schmidt ryandesign at macports.org
Sat Aug 22 13:32:00 PDT 2009


On Aug 22, 2009, at 15:25, Rainer Müller wrote:

> The use_* approach is possible, but actually I never liked that to  
> be a
> yes/no decision. I would rather like to see a "use_site  
> sourceforge" or
> "use_hosting sourceforge".

That syntax looks nice. But all the existing use_ options are in  
MacPorts base code. Part of the motivation for my suggestion is to  
move this out of MacPorts base and into something inside the dports/ 
_resources directory, e.g. a portgroup.

I wonder if maybe just renaming the "PortGroup" command would provide  
satisfaction. Instead of

PortGroup sourceforge 1.0

it could be

include sourceforge 1.0

or

use sourceforge 1.0


> The problem with PortGroups are that they are usually included at the
> top, even before the name of the port is set. That means that you  
> cannot
> set homepage/master_sites/etc. at the time of inclusion and thus need
> another command in the Portfile.

Not so! We have a delayed expansion mechanism via the default /  
options infrastructure. e.g.


default homepage {http://code.google.com/p/${name}/}


The value will only be expanded at the time that the variable is  
read, not at the time when it is defined. ${name} might not be set at  
the point where the portgroup is included and when the default for  
homepage is set, but it will be by the time homepage gets used.

It took me awhile to understand how this worked, but now that I do,  
it has been very helpful for the php5extension portgroup.




More information about the macports-dev mailing list