On Apr 10, 2012, at 15:14, [email protected] wrote:

> Revision: 91798
>          https://trac.macports.org/changeset/91798
> Author:   [email protected]
> Date:     2012-04-10 13:14:28 -0700 (Tue, 10 Apr 2012)
> Log Message:
> -----------
> zeroinstall-injector: reset all variables affected by variant
> 
> Modified Paths:
> --------------
>    trunk/dports/sysutils/zeroinstall-injector/Portfile
> 
> Modified: trunk/dports/sysutils/zeroinstall-injector/Portfile
> ===================================================================
> --- trunk/dports/sysutils/zeroinstall-injector/Portfile       2012-04-10 
> 20:13:12 UTC (rev 91797)
> +++ trunk/dports/sysutils/zeroinstall-injector/Portfile       2012-04-10 
> 20:14:28 UTC (rev 91798)
> @@ -4,7 +4,7 @@
> 
> name          zeroinstall-injector
> version               1.7
> -revision     3
> +revision     4
> platforms     darwin freebsd linux
> categories    sysutils
> license               LGPL
> @@ -37,6 +37,10 @@
> 
> set python.branch     2.6
> set python.bin                ${prefix}/bin/python${python.branch}
> +
> +build.cmd    ${python.bin} setup.py
> +destroot.cmd ${python.bin} setup.py
> +test.cmd     ${python.bin}
> }
> 
> variant python27 conflicts python26 description "use python 2.7" {
> @@ -45,6 +49,10 @@
> 
> set python.branch     2.7
> set python.bin                ${prefix}/bin/python${python.branch}
> +
> +build.cmd    ${python.bin} setup.py
> +destroot.cmd ${python.bin} setup.py
> +test.cmd     ${python.bin}
> }

Instead of repeating these lines, it would be better to set them just a single 
time. [1] So that the variants can influence them, set them in the respective 
pre- blocks.

pre-build {
    build.cmd   ${python.bin} setup.py
}

pre-destroot {
    destroot.cmd        ${python.bin} setup.py
}

pre-test {
    test.cmd    ${python.bin}
}




[1] http://en.wikipedia.org/wiki/DRY


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

Reply via email to