diff options
author | Michał Górny <mgorny@gentoo.org> | 2014-04-10 16:43:25 +0000 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2014-04-10 16:43:25 +0000 |
commit | 5e45e940028c4eb763f3c3c3260b9038b65adcb0 (patch) | |
tree | 4980bfb767daf596f41a86d222d534b528c5f522 /eclass | |
parent | Stable for HPPA (bug #507070). (diff) | |
download | gentoo-2-5e45e940028c4eb763f3c3c3260b9038b65adcb0.tar.gz gentoo-2-5e45e940028c4eb763f3c3c3260b9038b65adcb0.tar.bz2 gentoo-2-5e45e940028c4eb763f3c3c3260b9038b65adcb0.zip |
Use a more portable and clobbering "cp" call for multibuild_merge_root().
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 5 | ||||
-rw-r--r-- | eclass/multibuild.eclass | 30 |
2 files changed, 18 insertions, 17 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 0b25e5bfdb52..20d71bb83ac3 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1202 2014/04/09 21:55:12 radhermit Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1203 2014/04/10 16:43:25 mgorny Exp $ + + 10 Apr 2014; Michał Górny <mgorny@gentoo.org> multibuild.eclass: + Use a more portable and clobbering "cp" call for multibuild_merge_root(). 09 Apr 2014; Tim Harder <radhermit@gentoo.org> java-utils-2.eclass: Only refer to DESTTREE within the src_install phase. diff --git a/eclass/multibuild.eclass b/eclass/multibuild.eclass index 0a2771e66326..03e6ad0f6df7 100644 --- a/eclass/multibuild.eclass +++ b/eclass/multibuild.eclass @@ -1,6 +1,6 @@ -# Copyright 1999-2013 Gentoo Foundation +# 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.14 2013/09/18 08:49:33 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/multibuild.eclass,v 1.15 2014/04/10 16:43:25 mgorny Exp $ # @ECLASS: multibuild # @MAINTAINER: @@ -265,24 +265,22 @@ multibuild_merge_root() { done rm "${lockfile_l}" || die - if use userland_BSD; then - # 'cp -a -n' is broken: - # http://www.freebsd.org/cgi/query-pr.cgi?pr=174489 - # using tar instead which is universal but terribly slow. + local cp_args=() - tar -C "${src}" -f - -c . \ - | tar -x -f - -C "${dest}" - [[ ${PIPESTATUS[*]} == '0 0' ]] - ret=${?} - elif use userland_GNU; then - # cp works with '-a -n'. - - cp -a -l -n "${src}"/. "${dest}"/ - ret=${?} + if cp -a --version &>/dev/null; then + cp_args+=( -a ) else - die "Unsupported userland (${USERLAND}), please report." + cp_args+=( -P -R -p ) + fi + + 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=${?} + # Remove the lock. rm "${lockfile}" || die |