On Fri, Apr 04, 2014 at 12:30:31AM +0200, Michał Górny wrote:
> + if cp --reflink=auto --version &>/dev/null; then
> + # enable reflinking if possible to make this faster
> + cp_args+=( --reflink=auto )
> fi
>
> + cp -P -R -p "${cp_args[@]}" "${src}"/. "${dest}"/
> + ret=${?}
-p in GNU cp is --preserve=mode,ownership,timestamps which will cause
the loss of selinux contexts, xattr and hardlinks.
I know you want to be POSIX compatible, but I think passing
--preserve=all or -a is important in this case.
--
Robin Hugh Johnson
Gentoo Linux: Developer, Infrastructure Lead
E-Mail : [email protected]
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85