Port review of pure-ftpd

Ryan Schmidt ryandesign at macports.org
Tue Oct 27 16:10:12 PDT 2009


On Oct 27, 2009, at 18:00, Scott Haneda wrote:

> If one was to do this:
> port install +foo +bar +baz
>
> In any of the most initial of phases, which I am not sure that is,  
> but before anything happens, how can I grab ahold of the variant  
> names passed on the command line?

I don't think you can do that, but you can use

if {[variant_isset foo]} {
...
}


> Here is what I am thinking, and I also need help with how to abort  
> out of a port install, but I think the php5 port should show me that  
> well.

To abort, use

return -code error "some error message"


> Given this:
> port install +foo +bar +baz I actually will have port install  
> +lang_foo +lang_bar +lang_baz

You're not suggesting that you have variant aliases now are you --  
where +foo becomes a synonym for +lang_foo?


> repeat with aVariant in variantList
> 	if aVariant starts with lang_ then counter++
> 	if counter > 1 then abort with message
> end repeat
>
> That seems short and to the point to me.

It would work. This would basically be reimplementing the conflicts  
mechanism yourself, but hiding that fact in the output of "port  
variants". I'm not sure I agree with reimplementing existing MacPorts  
features in individual portfiles, but I will grant that the conflicts  
output from "port variants" is very ugly when there are many variants  
with many conflicts. Perhaps there is a way "port variants" could  
display this information in a more succinct and less cluttered way;  
that would solve the problem not just for you but all other ports that  
have many conflicting variants. (See "port variants minivmac".)


>>> description         Pure-FTPd is a fast, production-quality,  
>>> standard-conformant FTP (SSL/TLS)
>>
>> Missing backslash at end of the above line.
>
> Do I need one after the last hash in the checksums also then?

No, you don't put a backslash after the last line. The above  
description line is the first line of a two-line description. "port"  
experienced a syntax error until I added the backslash here.



More information about the macports-dev mailing list