Gentoo Archives: gentoo-dev

From: "Robin H. Johnson" <robbat2@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH multibuild.eclass] multibuild_merge_root: use a more portable, simpler 'cp -PpR' call.
Date: Fri, 04 Apr 2014 04:45:18
Message-Id: robbat2-20140404T044112-001994531Z@orbis-terrarum.net
In Reply to: [gentoo-dev] [PATCH multibuild.eclass] multibuild_merge_root: use a more portable, simpler 'cp -PpR' call. by "Michał Górny"
1 On Fri, Apr 04, 2014 at 12:30:31AM +0200, Michał Górny wrote:
2 > + if cp --reflink=auto --version &>/dev/null; then
3 > + # enable reflinking if possible to make this faster
4 > + cp_args+=( --reflink=auto )
5 > fi
6 >
7 > + cp -P -R -p "${cp_args[@]}" "${src}"/. "${dest}"/
8 > + ret=${?}
9 -p in GNU cp is --preserve=mode,ownership,timestamps which will cause
10 the loss of selinux contexts, xattr and hardlinks.
11
12 I know you want to be POSIX compatible, but I think passing
13 --preserve=all or -a is important in this case.
14
15 --
16 Robin Hugh Johnson
17 Gentoo Linux: Developer, Infrastructure Lead
18 E-Mail : robbat2@g.o
19 GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85

Replies