Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 447370 | Differences between
and this patch

Collapse All | Expand All

(-)a/multibuild.eclass (-5 / +14 lines)
Lines 214-227 multibuild_copy_sources() { Link Here
214
	einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}"
214
	einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}"
215
215
216
	local cp_args=()
216
	local cp_args=()
217
	if cp --reflink=auto --version &>/dev/null; then
217
	if $(multibuild_cpcmd) --reflink=auto --version &>/dev/null; then
218
		# enable reflinking if possible to make this faster
218
		# enable reflinking if possible to make this faster
219
		cp_args+=( --reflink=auto )
219
		cp_args+=( --reflink=auto )
220
	fi
220
	fi
221
221
222
	_multibuild_create_source_copy() {
222
	_multibuild_create_source_copy() {
223
		einfo "${MULTIBUILD_VARIANT}: copying to ${BUILD_DIR}"
223
		einfo "${MULTIBUILD_VARIANT}: copying to ${BUILD_DIR}"
224
		cp -pr "${cp_args[@]}" \
224
		$(multibuild_cpcmd) -pr "${cp_args[@]}" \
225
			"${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die
225
			"${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die
226
	}
226
	}
227
227
Lines 274-291 multibuild_merge_root() { Link Here
274
274
275
	local cp_args=()
275
	local cp_args=()
276
276
277
	if cp -a --version &>/dev/null; then
277
	if $(multibuild_cpcmd) -a --version &>/dev/null; then
278
		cp_args+=( -a )
278
		cp_args+=( -a )
279
	else
279
	else
280
		cp_args+=( -P -R -p )
280
		cp_args+=( -P -R -p )
281
	fi
281
	fi
282
282
283
	if cp --reflink=auto --version &>/dev/null; then
283
	if $(multibuild_cpcmd) --reflink=auto --version &>/dev/null; then
284
		# enable reflinking if possible to make this faster
284
		# enable reflinking if possible to make this faster
285
		cp_args+=( --reflink=auto )
285
		cp_args+=( --reflink=auto )
286
	fi
286
	fi
287
287
288
	cp "${cp_args[@]}" "${src}"/. "${dest}"/
288
	$(multibuild_cpcmd) "${cp_args[@]}" "${src}"/. "${dest}"/
289
	ret=${?}
289
	ret=${?}
290
290
291
	# Remove the lock.
291
	# Remove the lock.
Lines 298-302 multibuild_merge_root() { Link Here
298
	rm -rf "${src}"
298
	rm -rf "${src}"
299
}
299
}
300
300
301
# fix bug 447370
302
multibuild_cpcmd() {
303
	if type -P gcp &> /dev/null; then
304
		echo gcp
305
	else
306
		echo cp
307
	fi
308
}
309
301
_MULTIBUILD=1
310
_MULTIBUILD=1
302
fi
311
fi

Return to bug 447370