Tcl list-related 2.3.4 -> 2.3.5 changes?

Joshua Root jmr at macports.org
Sat Dec 3 02:47:47 CET 2016


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. You want [list ${nprefix} ${macports::prefix}] instead.

- Josh


More information about the macports-dev mailing list