internal-to-Portfile variable during upgrade?

Michael Dickens michaelld at macports.org
Thu Jul 8 06:58:40 PDT 2010


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              qt_dir
    set qt_dir          ${prefix}/libexec/qt3-mac
}

variant qt4 conflicts qt3 description {Use qt4-mac} {
    depends_lib-append  port:qt4-mac
    global              qt_dir
    set qt_dir          ${prefix}/libexec/qt4-mac
}

if {![variant_isset qt3] && ![variant_isset qt4]} {
    default_variants    +qt4
#    global              qt_dir
#    set qt_dir          ${prefix}/libexec/qt4-mac
}

configure.cmd       ${qt_dir}/bin/qmake
}}}

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 "set" line), then "install" works but "upgrade"
does not.  Any ideas for other things to try?  Thanks! - MLD


More information about the macports-dev mailing list