On Jun 11, 2008, at 03:45, Caspar Florian Ebeling wrote:

> Is there documentation of the mp-specific commands
> somewhere, that I overlooked? Things like "system"?
> I found the definition in macports/base/src/pextlib1.0/Pextlib.c,
> eventually, but it is still a bit uncomfortable. In this case e.g.
> I wanted to see if it returns output from stdout and
> exit code.

I'm not aware of documentation. I generally just look at other ports  
or parts of base that do what I want and copy it.

If you want to get output from the command, use exec. For example,  
see the nspr port which does:

         set mylibs [exec ${destroot}${prefix}/bin/nspr-config --libs]

To catch errors you can use catch, like src/port1.0/portutil.tcl does  
in MacPorts base:

         if {[catch {exec cp $tmpfile $file} error]} {
             global errorInfo
             ui_debug "$errorInfo"
             ui_error "reinplace: $error"
             file delete "$tmpfile"
             return -code error "reinplace copy failed"
         }

_______________________________________________
macports-dev mailing list
macports-dev@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to