documentation of pextlib1.0 commands
Rainer Müller
raimue at macports.org
Wed Jun 11 04:17:28 PDT 2008
Ryan Schmidt wrote:
> 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 think this should be documented in this section in the guide, but it
is not.
<http://guide.macports.org/#reference.tcl-extensions>
What is missing besides 'system'?
> 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.
Looking at other Portfiles is always possible, but it is not a
replacement for documentation.
> 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"
> }
But exec and catch are usual Tcl stuff, which are documented in 'man n
exec' and 'man n catch'.
MacPorts adds its own commands for use in Portfiles with Pextlib and
they should be documented.
Rainer
More information about the macports-dev
mailing list