suggestion for copying files: use cpio(1)

David Magda dmagda+fports at magda.ca
Sun Apr 6 08:15:22 PDT 2003


Hello,

A suggestion for general Ports policy and for the Porter's handbook.

Can you suggest/encourage the use of cpio(1) to copy file from one
directory to another? Many ports use tar(1) or cp(1) which can sometimes
lead to unexpected results.

For paranoia reasons, I tend to build all my ports as a regular,
non-priviledged user, and then do a 'make install' as root. If a port
uses tar(1) or cp(1) then the installed files are owned by the building
user. I personally think this is Not Good.

An example of what I think is good would be the www/mozilla port:

    [...]
do-install:
    ${MKDIR} ${PREFIX}/lib/${MOZILLA}
    ${CHMOD} 755 ${PREFIX}/lib/${MOZILLA}
    cd ${WRKSRC}/dist/bin && ${FIND} . | \
        cpio -pdm -L -R ${LIBOWN}:${LIBGRP} ${PREFIX}/lib/${MOZILLA}
    [...]

The '-R' option makes sure that the proper permissions are set, but also
makes them user-definable through the variables that are used.

Just a suggestion.

-- 
David Magda <dmagda at ee.ryerson.ca>
Because the innovator has for enemies all those who have done well under
the old conditions, and lukewarm defenders in those who may do well 
under the new. -- Niccolo Machiavelli, _The Prince_, Chapter VI


More information about the freebsd-ports mailing list