[aur-general] "install" recursive?

Dave Reisner d at falconindy.com
Wed Nov 30 08:39:47 EST 2011


On Wed, Nov 30, 2011 at 08:49:57PM +0800, 郑文辉 wrote:
> 2011/11/29 Jonathan Steel <jsteel at vorx.com>
> 
> > Hi,
> >
> > I was told it was best practice to use "install" rather than "mkdir"
> > and "cp" in a PKGBUILD, but how can you copy a directory and its
> > contents (recursively) using "install"?
> >
> > If you cannot, with a folder with lots of files, is it best practice
> > to list every file to copy with "install", or use one command to "cp"
> > the whole folder?
> >
> > Thanks,
> >
> > Jonathan
> >
> 
> I used to combine find and install together to accomplish that.
> 
> For example:
> 
>     find . -type d -exec install -d {,${pkgdir}/opt/xmail/}{} \;
>     find . -type f -exec install -D -m 644 {,${pkgdir}/opt/xmail/}{} \;

Except that brace expansion occurs before parameter expansion, so this
fails. Additionally, any non 644 files just lost any special
permissioning.

Copying entire directory structures is the unusual case. It's always
preferrable that upstream provide some sort of sane build system that
gets all the permissioning correct. I would suggest using:

  cp -dr --no-preserve=ownership

This way, fakeroot installs the files as root but preserves other
metadata.

dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://mailman.archlinux.org/pipermail/aur-general/attachments/20111130/38c8dd70/attachment.asc>


More information about the aur-general mailing list