xinstall glob question

Darren Weber dweber at macports.org
Thu Apr 30 17:14:35 PDT 2009


Many thanks!  These tcl replacements for the system calls are working (still
a few system calls in there, but not nearly as bad as before):

set buildBinPath ${build.dir}/bin
set vtkLibPath ${prefix}/lib/${distname}

foreach f [glob ${buildBinPath}/*] {
    if {![string match {*.dylib} ${f}]} {
      file copy ${f} ${destroot}/${vtkExamplePath}/bin/
    }
}

foreach f [glob ${destroot}/${vtkExamplePath}/bin/*] {
    if [string equal [file extension ${f}] ".app"] {
        set exeName [file rootname [lindex [file split ${f}] end]]
        set f [format "%s/Contents/MacOS/%s" ${f} ${exeName}]
    }
    if [expr [file isfile ${f}] && [file executable ${f}]] {
        foreach dep [exec otool -L ${f}] {
            if [string match "*/libvtk*.dylib" ${dep}] {
                set newdep [strsed ${dep} #${buildBinPath}#${vtkLibPath}#]
                system "install_name_tool -change ${dep} ${newdep} ${f}"
            }
        }
    }
}


Woohoo  (what a way to waste the day!)
Darren




On Thu, Apr 30, 2009 at 5:08 PM, Joshua Root <jmr at macports.org> wrote:

> Darren Weber wrote:
> >
> >
> > I get an error, ie:
> >
> > Error: Target org.macports.destroot returned: syntax error in expression
> > " string equal [file extension ${f}] ".app" ": variable references
> > require preceding $
>
> You're missing [] around the string equal call.
>
> - Josh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20090430/0cab6d14/attachment.html>


More information about the macports-dev mailing list