[aur-general] "install" recursive?
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
2011/11/29 Jonathan Steel <jsteel@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/}{} \;
On Wed, Nov 30, 2011 at 08:49:57PM +0800, 郑文辉 wrote:
2011/11/29 Jonathan Steel <jsteel@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
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.
In order to preserve mode and timestamps, the command has to be either: cp -dpr --no-preserve=ownership /sourcedir /targetdir or: cp -dr --preserve=mode,timestamp /sourcedir /targetdir Cheers, Christoph
On Wed, Nov 30, 2011 at 03:25:49PM +0100, Christoph wrote:
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.
In order to preserve mode and timestamps, the command has to be either:
cp -dpr --no-preserve=ownership /sourcedir /targetdir
or:
cp -dr --preserve=mode,timestamp /sourcedir /targetdir
Cheers, Christoph
Erm right, thanks. Pre-coffee thinko. I was getting at the former. d
On 28.11.2011 21:38, Jonathan Steel wrote:
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?
Hi, Maybe tar? E.g.: tar -c ./ | tar -x -C ${pkgdir}/... -- Piotr Rogoża
On 1 December 2011 01:25, Piotr Rogoża <rogoza.piotr@gmail.com> wrote:
On 28.11.2011 21:38, Jonathan Steel wrote:
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?
Hi,
Maybe tar? E.g.: tar -c ./ | tar -x -C ${pkgdir}/...
-- Piotr Rogoża
I think this is where we say "enough" :) -- GPG/PGP ID: C0711BF1
participants (6)
-
Christoph
-
Dave Reisner
-
Jonathan Steel
-
Piotr Rogoża
-
Ray Rashif
-
郑文辉