Tcl list-related 2.3.4 -> 2.3.5 changes?
Lawrence Velázquez
larryv at macports.org
Sat Dec 3 03:12:38 CET 2016
> On Dec 2, 2016, at 8:47 PM, Joshua Root <jmr at macports.org> wrote:
>
>> On 2016-12-3 02:45, René J.V. Bertin wrote:
>>
>> Hi,
>>
>> I'm trying to understand a regression that seems coupled to the
>> 2.3.4 -> 2.3.5 upgrade (or more exactly, "master just after 2.3.4"
>> -> "master 25 commits after 2.3.5").
>>
>> I had
>>
>> {{{
>> proc macports::normalize { filename } {
>> set nprefix [file dirname [file normalize "${macports::prefix}/foo"]]
>> return [string map {${nprefix} ${macports::prefix}} [file normalize $filename]]
>> }
>> }}}
>
> This was wrong all along. The enclosing braces on {${nprefix}
> ${macports::prefix}} mean that no substitution will happen, so you're
> mapping between those literal strings.
Additionally, "string map" does not evaluate any of its arguments, as
certain other commands do (e.g., "if", "expr", "uplevel").
vq
More information about the macports-dev
mailing list