"locale C" in reinplace (Was: [96139] trunk/dports/x11/lesstif/Portfile)

Jeremy Huddleston Sequoia jeremyhu at macports.org
Wed Aug 1 18:59:48 PDT 2012


The default locale set when building in MacPorts is en_US.UTF-8.  Mountain Lion's regular expression engine got a nice improvement over the version that was there in Lion, and as part of that, it is much stricter about properly dealing with the locale set in the environment.  When it sees that the input stream is not valid UTF-8, it complains, and sed exists with an error.  In most cases, what needs to be done is either of:

1) Fix the input file to be valid UTF-8 (often bad re-encoding of source files)
2) Just use the C locale

--Jeremy

On Aug 1, 2012, at 18:00, Craig Treleaven <ctreleaven at cogeco.ca> wrote:

> Hi:
> 
> I've noticed a number of commits recently inserting "-locale C" into reinplace commands (example below).  Google didn't point to an explanation so I wonder if someone could give me a brief description?
> 
> Thanks,
> 
> Craig
> 
>> From: ryandesign at macports.org
>> To: macports-changes at lists.macosforge.org
>> Subject: [96139] trunk/dports/x11/lesstif/Portfile
>> Date: Wed, 01 Aug 2012 15:12:46 -0700 (PDT)
>> Sender: macports-changes-bounces at lists.macosforge.org
>> 
>> Revision
>> 
>> <https://trac.macports.org/changeset/96139>96139
>> Author
>> 
>> ryandesign at macports.org
>> Date
>> 
>> 2012-08-01 15:12:44 -0700 (Wed, 01 Aug 2012)
>> 
>> Log Message
>> 
>> lesstif: fix "reinplace: sed: RE error: illegal byte sequence" error during patch phase
>> 
>> Modified Paths
>> 
>> <>trunk/dports/x11/lesstif/Portfile
>> Diff
>> 
>> Modified: trunk/dports/x11/lesstif/Portfile (96138 => 96139)
>> 
>> 
>> --- trunk/dports/x11/lesstif/Portfile	2012-08-01 21:39:23 UTC (rev 96138)
>> +++ trunk/dports/x11/lesstif/Portfile	2012-08-01 22:12:44 UTC (rev 96139)
>> @@ -39,8 +39,8 @@
>> 	system "touch ${worksrcpath}/test/{NEWS,README,AUTHORS,ChangeLog,COPYING}"
>> 
>> 	# See #18287
>> -	reinplace "s:LT_HAVE_FREETYPE:FINDXFT_HAVE_FREETYPE:g" ${worksrcpath}/acinclude.m4
>> -	reinplace "s:LT_HAVE_XRENDER:FINDXFT_HAVE_XRENDER:g" ${worksrcpath}/acinclude.m4
>> +	reinplace -locale C "s:LT_HAVE_FREETYPE:FINDXFT_HAVE_FREETYPE:g" ${worksrcpath}/acinclude.m4
>> +	reinplace -locale C "s:LT_HAVE_XRENDER:FINDXFT_HAVE_XRENDER:g" ${worksrcpath}/acinclude.m4
>> }
>> 
>> use_autoreconf yes
>> 
>> 
>> _______________________________________________
>> macports-changes mailing list
>> macports-changes at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo/macports-changes
> 
> 
> -- 
> --
> Craig Treleaven, CA -- Clearview Consulting
> (905) 829-2054  ctreleaven at cogeco.ca
> _______________________________________________
> macports-dev mailing list
> macports-dev at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo/macports-dev



More information about the macports-dev mailing list