On Aug 11, 2011, at 10:48, Bradley Giesbrecht wrote:

>>> +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?
> 
> I'm not sure about the var/run/logrotate turd, but the etc/logrotate file 
> globs the contents of etc/logrotate.d. I think there was a problem with that. 
> I'll remove it and test. This is to old for me to remember.

I'm guessing deleting the one in var/run/logrotate is not necessary, and that 
deleting the one in etc/logrotate.d was because as you said the script finds 
all files in that directory and tries to run them. If that's so, then there 
might be other ways of fixing it; for example, the script could only try to run 
files that have the execute bit set.


>> 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".)
> 
> Ah, right. So using variant_set prevents -bzip2, right?

I would say it overwrites / supersedes it. The order seems to be first 
default_variants makes a suggestion. Then the user's choices on the command 
line and in variants.conf are evaluated. Finally variant_set can trump any of 
those.



_______________________________________________
macports-dev mailing list
macports-dev@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macports-dev

Reply via email to