summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2014-04-15 15:54:13 +0000
committerMichał Górny <mgorny@gentoo.org>2014-04-15 15:54:13 +0000
commit053cb5e1e90a72d0d40b492aba614b009bb17869 (patch)
tree243f32994722be4032cad8ef8100d09e7f43d1fb /eclass/multibuild.eclass
parentDrop old vulnerable version (diff)
downloadgentoo-2-053cb5e1e90a72d0d40b492aba614b009bb17869.tar.gz
gentoo-2-053cb5e1e90a72d0d40b492aba614b009bb17869.tar.bz2
gentoo-2-053cb5e1e90a72d0d40b492aba614b009bb17869.zip
multibuild_merge_root: re-introduce userland_BSD tar fallback, bug #507626.
Diffstat (limited to 'eclass/multibuild.eclass')
-rw-r--r--eclass/multibuild.eclass34
1 files changed, 22 insertions, 12 deletions
diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass
index 4dc9b19444fe..ec112a077acb 100644
--- a/eclass/multibuild.eclass
+++ b/eclass/multibuild.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.16 2014/04/11 08:30:44 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.17 2014/04/15 15:54:13 mgorny Exp $
# @ECLASS: multibuild
# @MAINTAINER:
@@ -272,21 +272,31 @@ multibuild_merge_root() {
done
rm "${lockfile_l}" || die
- local cp_args=()
+ if use userland_BSD; then
+ # Most of BSD variants fail to copy broken symlinks, #447370
+ # also, they do not support --version
- if cp -a --version &>/dev/null; then
- cp_args+=( -a )
+ tar -C "${src}" -f - -c . \
+ | tar -x -f - -C "${dest}"
+ [[ ${PIPESTATUS[*]} == '0 0' ]]
+ ret=${?}
else
- cp_args+=( -P -R -p )
- fi
+ local cp_args=()
- if cp --reflink=auto --version &>/dev/null; then
- # enable reflinking if possible to make this faster
- cp_args+=( --reflink=auto )
- fi
+ if cp -a --version &>/dev/null; then
+ cp_args+=( -a )
+ else
+ cp_args+=( -P -R -p )
+ fi
- cp "${cp_args[@]}" "${src}"/. "${dest}"/
- ret=${?}
+ if cp --reflink=auto --version &>/dev/null; then
+ # enable reflinking if possible to make this faster
+ cp_args+=( --reflink=auto )
+ fi
+
+ cp "${cp_args[@]}" "${src}"/. "${dest}"/
+ ret=${?}
+ fi
# Remove the lock.
rm "${lockfile}" || die