From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 118FE198005 for ; Wed, 6 Mar 2013 14:25:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id F418FE0BAD; Wed, 6 Mar 2013 14:25:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1F2F4E0AF3 for ; Wed, 6 Mar 2013 14:25:39 +0000 (UTC) Received: from pomiocik.lan (77-255-31-156.adsl.inetia.pl [77.255.31.156]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 237B633DC0D; Wed, 6 Mar 2013 14:25:36 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 1/3] multibuild: introduce generic multibuild_copy_sources. Date: Wed, 6 Mar 2013 15:25:53 +0100 Message-Id: <1362579955-31813-1-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.5 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Archives-Salt: fcbed8cd-1674-4b61-b54b-e80f63348018 X-Archives-Hash: 0d4453e32b27173e8db736261dbeb58c The new function can be used to create per-variant copies of source trees. Code based on python_copy_sources from python-r1. --- gx86/eclass/multibuild.eclass | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gx86/eclass/multibuild.eclass b/gx86/eclass/multibuild.eclass index 8ccd3b6..65f3926 100644 --- a/gx86/eclass/multibuild.eclass +++ b/gx86/eclass/multibuild.eclass @@ -205,6 +205,27 @@ multibuild_for_best_variant() { multibuild_foreach_variant "${@}" } +# @FUNCTION: multibuild_copy_sources +# @DESCRIPTION: +# Create per-variant copies of source tree. The source tree is assumed +# to be in ${BUILD_DIR}, or ${S} if the former is unset. The copies will +# be placed in directories matching BUILD_DIRs used by +# multibuild_foreach(). +multibuild_copy_sources() { + debug-print-function ${FUNCNAME} "${@}" + + local _MULTIBUILD_INITIAL_BUILD_DIR=${BUILD_DIR:-${S}} + + einfo "Will copy sources from ${_MULTIBUILD_INITIAL_BUILD_DIR}" + + _multibuild_create_source_copy() { + einfo "${impl}: copying to ${BUILD_DIR}" + cp -pr "${_MULTIBUILD_INITIAL_BUILD_DIR}" "${BUILD_DIR}" || die + } + + multibuild_foreach_variant _multibuild_create_source_copy +} + # @FUNCTION: run_in_build_dir # @USAGE: ... # @DESCRIPTION: -- 1.8.1.5