Executing scripts during configure
Daniel J. Luke
dluke at geeklair.net
Tue Feb 5 19:06:29 PST 2008
On Feb 5, 2008, at 9:40 PM, Michael Franz wrote:
> Add a pre-configure phase which finds those files and generates the
> string/path that you want to pass to configure, put it in a portfile-
> local variable and then add it to your configure args by using that
> variable.
>
> Any hints on how to do this? I have not found many examples. The
> one that I did find uses perl.
You probably want to use fs-traverse, which is described in the
portfile man page:
fs-traverse [-depth] [-ignoreErrors] varname target-list body
Traverse the filesystem hierarchy rooted in each element of
target-list and execute body for each found file/directory.
varname
is set to the path of the file/directory. If break is called
during
execution, the filesystem traversal is stopped. If continue
is called
during execution, the current file and any children are
skipped and
traversal continues with the next file/directory.
-depth Equivalent to the -d switch to find(1). Please note
that
using -depth means you cannot prune a directory with
continue
as it will be processed after its children.
-ignoreErrors
Causes fs-traverse to ignore any permissions/read
errors
encountered during processing.
If fs-traverse is called directly on a symbolic link, the
link will
be followed. All other links encountered during traversal
will not be
followed.
fs-traverse will not descend into directories that have a
different
device number than the root of the descent.
If you remove the current directory during traversal, be
aware that
you must call continue to inform fs-traverse that the
directory
should not be descended into.
--
Daniel J. Luke
+========================================================+
| *---------------- dluke at geeklair.net ----------------* |
| *-------------- http://www.geeklair.net -------------* |
+========================================================+
| Opinions expressed are mine and do not necessarily |
| reflect the opinions of my employer. |
+========================================================+
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://lists.macosforge.org/pipermail/macports-users/attachments/20080205/c3552f18/PGP.bin
More information about the macports-users
mailing list