Looking for a cure for weird scope/memory of variables

Mojca Miklavec mojca at macports.org
Tue Jul 9 09:39:48 PDT 2013


Hi,

I just stumbled upon the following problem with Geant4. See the minimal example:

PortSystem          1.0
name                foo
version             1.0
categories          science
maintainers         nomaintainer
description         Foo testing
long_description    ${description}

set foo.versions {
    2.0 x
    3.0 y
    4.1 z
}

foreach {foo.version foo.string} ${foo.versions} {
    subport foo-${foo.version} {
        pre-fetch {
            system "echo ${foo.version}"
        }
        fetch {}
        extract {}
        use_configure no
        build {}
        destroot {}
    }
}

The command "port -v fetch foo-2.0" prints "4.1". How can I fix this?

Thank you,
    Mojca


More information about the macports-dev mailing list