Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2003 11:15:19 -0400
From:      David Magda <dmagda+fports@magda.ca>
To:        ports@freebsd.org
Cc:        doc@freebsd.org
Subject:   suggestion for copying files: use cpio(1)
Message-ID:  <20030406151518.GB65167@number6.magda.ca>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030406151518.GB65167>