reinplace - how to escape \. ?
Darren Weber
dweber at macports.org
Tue May 26 23:47:58 PDT 2009
For a regular sed on the following, the last example is what is required:
[ root at X /ports/graphics/InsightToolkit ]# cat tmp.txt
PREFIX/lib/InsightToolkit
"${dir}/../lib/InsightToolkit"
[ root at X /ports/graphics/InsightToolkit ]# cat tmp.txt | sed -e
's|../lib/InsightToolkit|../lib/InsightToolkit-3.12|g'
PREF../lib/InsightToolkit-3.12
"${dir}/../lib/InsightToolkit-3.12"
[ root at X /ports/graphics/InsightToolkit ]# cat tmp.txt | sed -e
's|\.\./lib/InsightToolkit|\.\./lib/InsightToolkit-3.12|g'
PREFIX/lib/InsightToolkit
"${dir}/../lib/InsightToolkit-3.12"
However, when the \. is used in reinplace for a Portfile, e.g.:
reinplace "s|\.\./lib/${name}|\.\./lib/${distname}|g"}
${destroot}${findITKbranch}
The result is the same as the second example above (i.e. PREFIX becomes
PREF..).
I also tried this:
reinplace {"s|[.][.]/lib/${name}|[.][.]/lib/${distname}|g"}
${destroot}${findITKbranch}
That doesn't work. I don't understand how this is parsed through the tcl
and port parsers. How would you do it?
Take care,
Darren
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20090526/fafa299a/attachment-0001.html>
More information about the macports-dev
mailing list