Don't print messages inside platform directives

Ryan Schmidt ryandesign at macports.org
Fri May 25 15:21:58 PDT 2007


On May 25, 2007, at 17:14, Ryan Schmidt wrote:

> On May 25, 2007, at 16:49, N_Ox wrote:
>
>> Le 25 mai 07 à 23:44, Ryan Schmidt a écrit :
>>
>>> platform darwin 8 {}
>>> pre-fetch {
>>> 	if { [variant_isset darwin_8] } {
>>> 		ui_error "==== ATTENTION!!!! ===="
>>> 		ui_error "Sockstat is not working under darwin 8 nor tiger.  
>>> Please use"
>>> 		ui_error "lsof -i6/lsof -i4/lsof -U instead."
>>> 		ui_error "==== ATTENTION!!!! ===="
>>> 		ui_error "Please sudo port uninstall sockstat"
>>> 	}
>>> }
>>
>> there's just something bothering me with platform/variant  
>> directives i've seen here and there.
>> Why do you use a dummy platform and use variant_isset in the stage  
>> directive?
>>
>> From what i've seen (and coded, of course), every stage in every  
>> activated variant/platform is executed.
>
> If you don't declare "platform darwin 8" to be *something*, even an  
> empty "{}", then "[variant_isset _darwin_8]" will be false and the  
> message will not be printed. Try it out. I just did.

Or perhaps it would be better and clearer to use the syntax shown in  
the ipcs portfile:

platform darwin 8 {
	pre-fetch {
		ui_msg "\n
			This port is broken on OS X 10.4, but not necessary on 10.4 either  
because
			beginning with 10.4, Apple includes the ipcs and ipcrm utilities  
as standard.\n"
		exit 1
	}
}




More information about the macports-dev mailing list