xinstall glob question

Darren Weber dweber at macports.org
Thu Apr 30 15:18:22 PDT 2009


Please take a look at this mess to reset RPATH for all libs in a set of
binaries:

system "
    cd ${build.dir};
    find ${destroot}/${vtkExamplePath}/bin | grep -e '\[^(bin)\]\$' >
find.txt;
    for f in `cat find.txt`; do
        if \[ -f \${f} \] && \[ -x \${f} \]; then
            echo install_name_tool changing link libs for \${f};
            otool -L \${f} | grep 'libvtk' > otool_libs.txt;
            for lib in `cat otool_libs.txt`; do
                newlib=`echo \${lib} | sed
s#${build.dir}/bin#${prefix}/lib/${distname}#`;
                install_name_tool -change \${lib} \${newlib} \${f};
            done;
            rm otool_libs.txt;
        fi;
    done;
    rm find.txt;
    "

It works, but can it be done more efficiently?

Can you do file tests in tcl, like the bash tests [ -f $f ] && [ -x $f ] ?

Darren

PS, Don't ask me why it's required ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20090430/160918ea/attachment.html>


More information about the macports-dev mailing list