documentation of pextlib1.0 commands

Ryan Schmidt ryandesign at macports.org
Wed Jun 11 03:46:45 PDT 2008


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"
         }



More information about the macports-dev mailing list