xinstall vs file copy/mkdir

Lawrence Velázquez larryv at macports.org
Wed Oct 9 07:39:27 PDT 2013


On Oct 7, 2013, at 11:31 AM, Ryan Schmidt <ryandesign at macports.org> wrote:

> On Oct 7, 2013, at 07:16, Davide Liessi <davide.liessi at gmail.com> wrote:
> 
>> Is there a preferred choice between xinstall and file Tcl extensions?
>> Which one should I use?
> 
> For creating directories, they're pretty equivalent. If you need to specify ownership (which some ports like servers need) or permissions (which you almost never need for directories) xinstall is more convenient because it lets you do it all at once. Otherwise my rule of thumb is usually to use "xinstall" at destroot time and "file mkdir" otherwise.
> 
> For copying files, same rule of thumb. Also, "file copy" preserves modification times; "xinstall" touches the file so you get the current time. And "xinstall" has the convenient "-W" flag that lets you copy multiple files from a single directory without having to name that directory over and over.

All things equal, I generally prefer "xinstall" because it automatically produces a debug message while "file copy" does not. It makes reviewing main.log somewhat easier. (Obviously nothing prevents me from using explicitly using "ui_debug", but I'd rather not.)

vq


More information about the macports-dev mailing list