internal-to-Portfile variable during upgrade?

2010-07-07 Thread Michael Dickens
For many of the Qt-dependent ports (e.g., qwt, qwt52, etc.), I currently need to specify which ${qt_dir} to use, e.g., "${prefix}/libexec/qt4-mac" or "${prefix}/libexec/qt4-mac-devel" or "${prefix}/libexec/qt4-x11", which is dependent on the variant selected by the user (e.g., +qt4, +qt3, +x11, etc

Re: internal-to-Portfile variable during upgrade?

2010-07-08 Thread Rainer Müller
On 07/07/2010 10:37 PM, Michael Dickens wrote: > I can set up the Portfile to default to using, say, "qt4-mac" by either > (1) setting variable defaults such that this is the case, and then > changing those variables when variants are selected; or (2) by creating > a bunch of variants and then sett

Re: internal-to-Portfile variable during upgrade?

2010-07-08 Thread Michael Dickens
Hi Rainer - Using "global" to change variable scope sounds useful, but it still isn't working. Here's my code (augmented from the original by adding in the "global" lines): {{{ set qt_dir "" variant qt3 conflicts qt4 description {Use qt3-mac} { depends_lib-append port:qt3-mac global

Re: internal-to-Portfile variable during upgrade?

2010-07-08 Thread Rainer Müller
On 07/08/2010 03:58 PM, Michael Dickens wrote: > ... > which as you can see is very similar to what you wrote. With the code > as is, doing just "sudo port install ..." fails because ${qt_dir} isn't > properly set; ditto for "upgrade". If I uncomment out the 2 obvious > lines (really, just the "s

Re: internal-to-Portfile variable during upgrade?

2010-07-08 Thread Michael Dickens
On Thu, 08 Jul 2010 16:07 +0200, "Rainer Müller" wrote: > A, sorry, I forgot one important thing... variants are evaluated > *after* the rest of the Portfile (in order to resolve conflicts and > requires first). So this configure.cmd is evaluated before the variants > and therefore qt_dir is n

Re: internal-to-Portfile variable during upgrade?

2010-07-08 Thread Joshua Root
On 2010-7-9 00:56 , Michael Dickens wrote: > On Thu, 08 Jul 2010 16:07 +0200, "Rainer Müller" > wrote: >> A, sorry, I forgot one important thing... variants are evaluated >> *after* the rest of the Portfile (in order to resolve conflicts and >> requires first). So this configure.cmd is evaluat

Re: internal-to-Portfile variable during upgrade?

2010-07-08 Thread Michael Dickens
Taking into account that 'if' statements are processed in-order in the main scope of the Portfile, while variants are processed after everything else & in their own scope, I converted what I wrote before into what's below, which it works and, amazingly, really isn't too ugly even. I don't even nee