[76337] trunk/dports/science/smodels/Portfile

Blair Zajac blair at orcaware.com
Sun Feb 20 11:26:13 PST 2011


On Feb 20, 2011, at 3:16 AM, Ryan Schmidt wrote:

> On Feb 20, 2011, at 04:47, snc at macports.org wrote:
> 
>> Revision: 76337
>>         http://trac.macports.org/changeset/76337
>> Author:   snc at macports.org
>> Date:     2011-02-20 02:47:52 -0800 (Sun, 20 Feb 2011)
>> Log Message:
>> -----------
>> created smodels: stable model semantics for logic programs
> 
> 
>> +patch {
>> +    reinplace s|/usr/bin|/opt/local/bin|g ${worksrcpath}/Makefile
>> +    reinplace s|/usr/local/lib|/opt/local/lib|g ${worksrcpath}/Makefile
>> +    reinplace "s|-O3 -Wall -W|${configure.cxxflags}|g" ${worksrcpath}/Makefile
>> +}
> 
> You already fixed the /opt/local hardcoding...
> 
> But mightn't these reinplaces be better handled as a combo patchfile-with-placeholders / reinplace-placeholders-with-values? In particular the CXXFLAGS -- what if upstream later changes the CXXFLAGS in the Makefile slightly? Unless your MacPorts base is patched to include the patch from #15514, your reinplace will then silently fail, whereas if you use a patchfile, you'll get notification and immediate port failure, which is good because it gives you the chance to fix it; it also gives you context around the line in question, so that you can more easily find the corresponding section in the revised source file.

What about making reinplace fail it it doesn't make any changes?

Blair



More information about the macports-dev mailing list