[71380] trunk/base/src/pextlib1.0/system.c

Rainer Müller raimue at macports.org
Fri Sep 10 16:06:06 PDT 2010


On 2010-09-11 01:00 , raimue at macports.org wrote:
> Revision: 71380
>           http://trac.macports.org/changeset/71380
> Author:   raimue at macports.org
> Date:     2010-09-10 16:00:39 -0700 (Fri, 10 Sep 2010)
> Log Message:
> -----------
> pextlib1.0:
> Add new 'system -W path' which changes into the given directory before
> executing the command.

As a longer explanation, this revision adds a new parameter to `system`
which changes to the given directory before executing the shell command.
This should make it easier to write often used constructs as shown below.

This example
  system "cd ${worksrcpath} && touch foo"

can now be written as
  system -W ${worksrcpath} "touch foo"

The new form has better readability in my opinion, especially with
syntax highlighting.

I called this new parameter `-W`, as there is the pre-existing `xinstall
-W` in our Tcl extensions which is similar.

Rainer


More information about the macports-dev mailing list