tcl : [exec bash-function] returning 0 leads to 'port install' crashing

Bjarne D Mathiesen macintosh at
Tue Jun 21 14:37:25 PDT 2011

Ryan Schmidt wrote:
> I don't know the answer to your direct questions, but I want to point out that we don't use exec unless there is no Tcl alternative. And Tcl does have existing methods for reading files and looking into strings. Take a look for example at the post-install section of the php5extension portgroup, which looks in the php.ini settings file and prints a message if a particular bad setting exists there.

Well, there's no direct tcl alternative to what I'm attempting.

I've looked in the php portgroup.
You are resorting to exactly what my ultimate solution turned out to be:
programmatically scanning a file line-by-line instead of just grepping
the whole file as I'm attempting.

But I still don't think tcl / port ought to crash
when the result of [exec bash-command] is 0.

> MacPorts also typically does not modify user config files. Instead, we explain to the user how they can modify them.

I know that. I don't agree with that policy, but I'll live with it in
the official repositories. I'm still of the opinion that MacPorts ought
to install the minimum of standard configutations.

I'm running my own mods to some portfiles to get what I want straight
out-of-the-box. I'm setting at least one test-box up and I'm deploying
on at least two public servers, so I'll hate to have to mess around with
setting things up again and again and ... when I can do it once. (I'm
lazy that way ;-) - and that's what computers are for ;-) )

> I also wasn't sure what you meant by the portfile "crashing". If you could be more specific...?

=== debug dump start
DEBUG: installing file:
DEBUG: Executing proc-post-org.macports.install-install-0
Error: Target org.macports.install returned: 0
child process exited abnormally
DEBUG: Backtrace: 0
child process exited abnormally
    while executing
"$post $targetname"
Warning: the following items did not execute (for mod_security2):
org.macports.activate org.macports.install
Log for mod_security2 is at:
Error: Status 1 encountered during processing.
=== debug dump end

the crucial lines are:
child process exited abnormally
    while executing
"$post $targetname"
not very helpful :-(
it took me quite a while to deduct exactly what the problem is !!! :-(

You can see the final whole heavily customised Portfile as an attachment

I'm finding my orignal solution to be much more elegant, shorter, and
more understandable ;-) - but your milage may of course vary :-)

Bjarne D Mathiesen
København N ; Danmark ; Europa
denne besked er skrevet i et totalt M$-frit miljø
MacOS X 10.6.7 Snow Leopard ; 2.8GHz Intel Core i7 ; 16GB 1067MHz DDR3

More information about the macports-users mailing list