ASSP out of date

Ryan Schmidt ryandesign at macports.org
Wed Nov 5 21:59:58 PST 2008


On Nov 5, 2008, at 23:50, Jordan K. Hubbard wrote:

> On Nov 5, 2008, at 9:38 PM, Ryan Schmidt wrote:
>
>> You can do something like
>>
>> platform darwin 7 {
>> 	pre-fetch {
>> 		return -code error "${name} requires Mac OS X 10.4 or later"
>> 	}
>> }
>
> Ooh.  People are using pre-fetch as an "initializer" for the  
> Portfile?   Ugh.   I never thought of that scenario,

Yes, using pre-fetch to print out fatal error messages has been the  
recommendation until this point, and it works fine.

What does not work fine (and what some ports were doing, until the  
recommendation to instead use the above) is not wrapping the error in  
such a block. For example, do not do this:

platform darwin 7 {
	return -code error "${name} requires Mac OS X 10.4 or later"
}

That will cause that error to be printed for *any* port command  
relating to that port, even a port command that we do want the user  
to be able to execute, such as "port info".

I should add that you should not add an error code for Panther, as  
above, unless you're sure the port will not work on Panther. If you  
merely haven't tested it, do nothing; let someone test it.


> but had Landon and I been really using our noodles back then, we  
> would have added start and end actions (which did nothing by  
> default) for precisely this purpose, also guaranteeing each to be  
> the very first and last things run, respectively.
>
> I'm tempted to go add this myself right now, but it's too good of a  
> "junior ports hacker" project to deny someone else the learning  
> experience and satisfaction involved. ;-)


Perhaps. What I'd rather have is a defined syntax for specifying a  
minimum Mac OS version for a port, rather than everyone reinventing  
it with their own non-localizable error messages. Goes along with  
wanting a syntax to specify minimum versions of dependent ports.




More information about the macports-users mailing list