[82234] users/pixilla/dports

Ryan Schmidt ryandesign at macports.org
Wed Aug 10 23:40:31 PDT 2011


On Aug 10, 2011, at 20:30, pixilla at macports.org wrote:

> Revision: 82234
>          http://trac.macports.org/changeset/82234
> Author:   pixilla at macports.org
> Date:     2011-08-10 18:30:10 -0700 (Wed, 10 Aug 2011)
> Log Message:
> -----------
> sysutils/logrotate: Upgrade to 3.8.0.
> 
> Added Paths:
> -----------
>    users/pixilla/dports/sysutils/
>    users/pixilla/dports/sysutils/logrotate/
>    users/pixilla/dports/sysutils/logrotate/Portfile
>    users/pixilla/dports/sysutils/logrotate/files/
>    users/pixilla/dports/sysutils/logrotate/files/patch-Makefile.diff
>    users/pixilla/dports/sysutils/logrotate/files/patch-config.c.diff
>    users/pixilla/dports/sysutils/logrotate/files/patch-examples-logrotate-default.diff
>    users/pixilla/dports/sysutils/logrotate/files/patch-logrotate.c.diff

I know this is a private port in your users directory for now, but some comments:


> +maintainers         markd pixilla.com:brad

May want to use your MacPorts handle here.


> +use_configure       no

This probably means you need to manually handle UsingTheRightCompiler and use [get_canonical_archflags] somewhere.


> +destroot.keepdirs   ${destroot}${prefix}/etc/logrotate.d \
> +                    ${destroot}${prefix}/var/run/logrotate
> +
> +post-destroot {
> +		xinstall -m 755 ${worksrcpath}/examples/logrotate-default \
> +			${destroot}${prefix}/etc/logrotate.conf.sample
> +    xinstall -d ${destroot}${prefix}/etc/logrotate.d
> +    xinstall -d ${destroot}${prefix}/var/run/logrotate
> +}
> +
> +post-activate {
> +    delete  ${prefix}/etc/logrotate.d/.turd_${name} \
> +            ${prefix}/var/run/logrotate/.turd_${name}
> +}

It's a bit odd to be deleting the turds... does their presence really cause a problem?


> +variant bzip2 description {change default compression to bzip} {
> +    build.env-append    COMPRESS_COMMAND="${prefix}/bin/bzip2" \
> +                        COMPRESS_EXT=".bz2" \
> +                        UNCOMPRESS_COMMAND="${prefix}/bin/bunzip2"
> +    depends_run-delete  port:gzip
> +    depends_run-append  port:bzip2
> +}
> 

> +default_variants    bzip2

You need a + before the default variant name.

But moreover, you're offering the user a choice between gzip and bzip2. (And not a choice between bzip2 on or off.) In other words, if considered in the context of a GUI preferences dialog, this choice might be represented as two radio buttons; it would not be represented as a checkbox. Standalone variants usually represent checkbox-like on-or-off choices. To implement radio-button-like choices in variants, I find it makes more sense to make two variants that are conflicting with one another. To do this, remove port:gzip from the port's global depends_run, and then:


variant bzip2 conflicts gzip description {Use bzip2 compression by default} {
    build.env-append    COMPRESS_COMMAND="${prefix}/bin/bzip2" \
                        COMPRESS_EXT=".bz2" \
                        UNCOMPRESS_COMMAND="${prefix}/bin/bunzip2"
    depends_run-append  port:bzip2
}

variant gzip conflicts bzip2 description {Use gzip compression by default} {
    depends_run-append  port:gzip
}

if {![variant_isset gzip]} {
    default_variants +bzip2
    variant_set bzip2
}


The variant_set line ensures that even if the user requests to install the port with neither variant (-gzip -bzip2), the bzip2 variant will still be used. (It doesn't make sense to have "all radio buttons off".)




More information about the macports-dev mailing list