<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Bjarne,<div><br></div><div>If I get you right you want to save yourself alot of typing!</div><div><br></div><div>So, why not simply divide your code up a little.</div><div><br></div><div>proc g_doSomething args {</div><div><span class="Apple-style-span" style="font-family: monospace; "> xinstall -d ${where}[dict get ${apache} libexecdir]</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; "> /do a lot of stuff/</span><span class="Apple-style-span" style="font-family: monospace; "><br></span><span class="Apple-style-span" style="font-family: monospace; ">}</span></div><div><span class="Apple-style-span" style="font-family: monospace; "><br></span></div><div><font class="Apple-style-span" face="monospace"><br></font></div><div><span class="Apple-style-span" style="font-family: monospace; "><span class="Apple-style-span" style="font-family: Palatino; ">Then in whatever phase you are in set where in the script and call </span></span>g_doSomething.</div><div>Think modular!</div><div><br></div><div>regards</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>Keith.</div><div><br></div><div><div><div>Am 03.06.2012 um 01:34 schrieb Bjarne D Mathiesen:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Jeremy Lavergne wrote:<br><blockquote type="cite"><blockquote type="cite">I've got a problem where the same action has to be done, but depending<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">on whether I'm in /post-destroot/ or /post-activate/ I need to create<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">and install in different directories<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">That's precisely what the post-destroot and post-activate blocks do: they execute during post-destroot phase or post-activate phase, respectively.<br></blockquote><br>I know that, but can I query a variable or something that tells me<br>exactly which phase I'm in ??? eg :<br><br>proc doSomething args {<br> switch ${phase} {<br> "destroot" -<br> "post-destroot" { set where "destroot" }<br> "activate" -<br> "post-activate" { set where "" }<br> }<br> xinstall -d ${where}[dict get ${apache} libexecdir]<br> /do a lot of stuff/<br>}<br><br>-- <br>Bjarne D Mathiesen<br>København N ; Danmark ; Europa<br>----------------------------------------------------------------------<br>denne besked er skrevet i et totalt M$-frit miljø<br>MacOS X 10.7.3 Lion ; 2.8GHz Intel Core i7 ; 16GB 1067MHz DDR3<br>_______________________________________________<br>macports-users mailing list<br><a href="mailto:macports-users@lists.macosforge.org">macports-users@lists.macosforge.org</a><br>http://lists.macosforge.org/mailman/listinfo.cgi/macports-users<br></div></blockquote></div><br></div></body></html>