On Dec 18, 2007, at 12:43, Daniel J. Luke wrote:
I don't think we should strongly recommend variant_isset usage in portfiles (in fact, I think we should recommend against it unless the alternative is extremely messy).
In the section 4.4.2 example, it seems much cleaner to do the following:
post-destroot { xinstall -m 755 -d ${destroot}${prefix}/etc/ xinstall ${worksrcpath}/examples/foo.conf ${destroot}${prefix}/etc/ } variant carbon { post-destroot { delete ${destroot}${prefix}/bin/emacs delete ${destroot}${prefix}/bin/emacs-${version} } } Since macports will run both post-destroot procs, the variant's code is then all contained within the variant.
I strongly agree. Of course, the example also need not use -m 755 on the xinstall -d command since 755 is the default mode for directories anyway. Of course, the example also need not xinstall -d ${destroot}${prefix}/ etc/ at all since that directory already exists as part of the hierarchy MacPorts creates in the destroot directory right before the destroot phase.