reinplace loop

Mark Brethen mark.brethen at
Sun Jul 13 14:07:25 PDT 2014

On Jul 13, 2014, at 3:28 PM, Jeremy Lavergne <jeremy at> wrote:

> I’d use fs-traverse, filtering to just the specific files you’re after.
> On Jul 13, 2014, at 16:18, Mark Brethen <mark.brethen at> wrote:
>> In need to reinplace the CMakeLists file in each subdirectory, replacing 'Mod/(subdirectory)' with 'lib/${name}/Mod/(subdirectory). How do you write a tcl loop to accomplish this? (Avoids creating a multitude of patch files.)

Will this traverse the subdirectories?

    fs-traverse file ${worksrcpath}/src/Mod {
        if [string match {/CMakeLists.txt$} ${file}] {
            reinplace "s| Mod/| lib/${name}/Mod/|g" ${file}


More information about the macports-dev mailing list