Hi Bjarne,

If I get you right you want to save yourself alot of typing!

So, why not simply divide your code up a little.

proc g_doSomething args {
   xinstall -d ${where}[dict get ${apache} libexecdir]
   /do a lot of stuff/
}


Then in whatever phase you are in set where in the script and call  
g_doSomething.
Think modular!

regards
        Keith.

Am 03.06.2012 um 01:34 schrieb Bjarne D Mathiesen:

> Jeremy Lavergne wrote:
>>> I've got a problem where the same action has to be done, but depending
>>> on whether I'm in /post-destroot/ or /post-activate/ I need to create
>>> and install in different directories
>> 
>> That's precisely what the post-destroot and post-activate blocks do: they 
>> execute during post-destroot phase or post-activate phase, respectively.
> 
> I know that, but can I query a variable or something that tells me
> exactly which phase I'm in ??? eg :
> 
> proc doSomething args {
>    switch ${phase} {
>    "destroot"      -
>    "post-destroot" { set where "destroot" }
>    "activate"      -
>    "post-activate" { set where "" }
>    }
>    xinstall -d ${where}[dict get ${apache} libexecdir]
>    /do a lot of stuff/
> }
> 
> -- 
> Bjarne D Mathiesen
> København N ; Danmark ; Europa
> ----------------------------------------------------------------------
> denne besked er skrevet i et totalt M$-frit miljø
> MacOS X 10.7.3 Lion ; 2.8GHz Intel Core i7 ; 16GB 1067MHz DDR3
> _______________________________________________
> macports-users mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

_______________________________________________
macports-users mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macports-users

Reply via email to