Don't warn if ownership changes when copying /etc/pacman.d/gnupg

In an unshare environment, /etc/pacman.d/gnupg is owned by the original
root, who is now "nobody". cp will warn about this, since we can't
create files owned by the original root, and it instead creates them as
the unshare'd root (the original user). This is benign, so ignore it.
This commit is contained in:
Sean Anderson 2021-10-17 16:13:06 -04:00
parent bb04ab435a
commit 88c0c9db0b

View File

@ -107,7 +107,7 @@ chroot_setup "$newroot" || die "failed to setup chroot %s" "$newroot"
if (( copykeyring )); then
# if there's a keyring on the host, copy it into the new root, unless it exists already
if [[ -d /etc/pacman.d/gnupg && ! -d $newroot/etc/pacman.d/gnupg ]]; then
cp -a /etc/pacman.d/gnupg "$newroot/etc/pacman.d/"
cp -a --no-preserve=ownership /etc/pacman.d/gnupg "$newroot/etc/pacman.d/"
fi
fi