[73642] trunk/dports/irc/supybot/Portfile

Ryan Schmidt ryandesign at macports.org
Sat Nov 20 11:38:18 PST 2010


On Nov 20, 2010, at 09:01, snc at macports.org wrote:

> Revision: 73642
>          http://trac.macports.org/changeset/73642
> Author:   snc at macports.org
> Date:     2010-11-20 07:01:24 -0800 (Sat, 20 Nov 2010)
> Log Message:
> -----------
> supybot:
> * switch to python26
> * include license
> * add documentation as default variant
> * fix livecheck
> 
> Modified Paths:
> --------------
>    trunk/dports/irc/supybot/Portfile
> 
> Modified: trunk/dports/irc/supybot/Portfile
> ===================================================================
> --- trunk/dports/irc/supybot/Portfile	2010-11-20 12:47:12 UTC (rev 73641)
> +++ trunk/dports/irc/supybot/Portfile	2010-11-20 15:01:24 UTC (rev 73642)
> @@ -2,12 +2,13 @@
> # $Id$
> 
> PortSystem          1.0
> -PortGroup           python25 1.0
> +PortGroup           python26 1.0
> 
> name			    supybot
> version			    0.83.4.1
> +revision            1
> categories		    irc python
> -#license             BSD
> +license             BSD
> maintainers		    snc openmaintainer
> description		    IRC bot framework in Python
> long_description	${description}
> @@ -19,7 +20,26 @@
> master_sites	    sourceforge
> distname		    Supybot-${version}
> checksums           md5     96ce90559c7d6fde5e3c93174c509408 \
> -                    sha1    e9a0443557c82f983c6144d238a28d2ca83dc2d3 \
> -                    rmd160  19fe768a0d814e902467f7e5aee31c04a3ab0024
> +                    sha1    e9a0443557c82f983c6144d238a28d2ca83dc2d3
> 
> -livecheck.regex     "<title>supybot Supybot-(\\d+\\.\\d+\\.\\d+(\\.\\d+)?) released.*</title>"
> +if {![variant_isset doc]} {
> +    default_variants +doc
> +}

That's not useful; just write "default_variants +doc"; you don't need it in a conditional.


> +variant doc description {Install documentation} {
> +}
> +
> +patch {
> +    if {[variant_isset doc]} {
> +        reinplace s|docs\/|${prefix}/share/${name}/docs/|g ${worksrcpath}/scripts/supybot
> +    }
> +}
> +
> +post-destroot {
> +    if {[variant_isset doc]} {
> +        xinstall -d ${destroot}${prefix}/share/${name}
> +        file copy ${worksrcpath}/docs ${destroot}${prefix}/share/${name}/
> +    }
> +}

Wouldn't it be clearer to put everything related to the variant inside the variant declaration? Like this:


variant doc description {Install documentation} {
    post-patch {
        reinplace s|docs\/|${prefix}/share/${name}/docs/|g ${worksrcpath}/scripts/supybot
    }
    post-destroot {
        xinstall -d ${destroot}${prefix}/share/${name}
        file copy ${worksrcpath}/docs ${destroot}${prefix}/share/${name}/
    }
}





More information about the macports-dev mailing list