From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: <gentoo-commits+bounces-1346248-garchives=archives.gentoo.org@lists.gentoo.org> Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 89CA1158086 for <garchives@archives.gentoo.org>; Sun, 5 Dec 2021 13:47:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4DF0AE07B3; Sun, 5 Dec 2021 13:47:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EC4C4E07B3 for <gentoo-commits@lists.gentoo.org>; Sun, 5 Dec 2021 13:47:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C322B343516 for <gentoo-commits@lists.gentoo.org>; Sun, 5 Dec 2021 13:47:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 28B10200 for <gentoo-commits@lists.gentoo.org>; Sun, 5 Dec 2021 13:47:32 +0000 (UTC) From: "Fabian Groffen" <grobian@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" <grobian@gentoo.org> Message-ID: <1638711742.abad93d08ba1c08af8c7588d4a4915b111edace0.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: scripts/bootstrap-prefix.sh X-VCS-Directories: scripts/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: abad93d08ba1c08af8c7588d4a4915b111edace0 X-VCS-Branch: master Date: Sun, 5 Dec 2021 13:47:32 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 173275d2-9a7e-48c5-bdb1-b2074ee3af16 X-Archives-Hash: f4a134e3690501ba84044e7f91f2970c commit: abad93d08ba1c08af8c7588d4a4915b111edace0 Author: Etienne Buira <etienne.buira.lists <AT> free <DOT> fr> AuthorDate: Sat Dec 4 07:53:50 2021 +0000 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> CommitDate: Sun Dec 5 13:42:22 2021 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=abad93d0 scripts/bootstrap-prefix.sh: create etc/make.conf as dir This makes it easy to (pre)set some site/host specific portage configuration that will only get picked once portage is in shape enough to run on its own, while letting bootstrap-prefix set its own settings. v2: - added MAKE_CONF_DIR global helper variable - added local override var where appropriate - some reformating (not strictly adhering to 80 chars, but close to) - shortened $subject Thanks grobian for review Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> scripts/bootstrap-prefix.sh | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 4d345ad437..e372fb21da 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -309,7 +309,8 @@ bootstrap_setup() { [[ -e ${ROOT}/foo.$$ ]] && FS_INSENSITIVE=1 rm "${ROOT}"/FOO.$$ - if [[ ! -f ${ROOT}/etc/portage/make.conf ]] ; then + [[ ! -e "${MAKE_CONF_DIR}" ]] && mkdir -p -- "${MAKE_CONF_DIR}" + if [[ ! -f ${ROOT}/etc/portage/make.conf/0100_bootstrap_prefix_make.conf ]] ; then { echo "# Added by bootstrap-prefix.sh for ${CHOST}" echo 'USE="unicode nls"' @@ -340,7 +341,7 @@ bootstrap_setup() { echo "USE=\"\${USE} ${MAKE_CONF_ADDITIONAL_USE}\"" [[ ${OFFLINE_MODE} ]] && \ echo 'FETCHCOMMAND="bash -c \"echo I need \${FILE} from \${URI} in \${DISTDIR}; read\""' - } > "${ROOT}"/etc/portage/make.conf + } > "${MAKE_CONF_DIR}/0100_bootstrap_prefix_make.conf" fi if is-rap ; then @@ -1415,7 +1416,9 @@ bootstrap_stage_host_gentoo() { (bootstrap_tree) || return 1 # setup a profile - [[ -e ${ROOT}/etc/portage/make.profile && -e ${ROOT}/etc/portage/make.conf ]] || (bootstrap_setup) || return 1 + [[ -e ${ROOT}/etc/portage/make.profile && \ + -e ${MAKE_CONF_DIR}/0100_bootstrap_prefix_make.conf ]] \ + || (bootstrap_setup) || return 1 prepare_portage } @@ -1574,7 +1577,9 @@ bootstrap_stage1() { (bootstrap_tree) || return 1 # setup a profile - [[ -e ${ROOT}/etc/portage/make.profile && -e ${ROOT}/etc/portage/make.conf ]] || (bootstrap_setup) || return 1 + [[ -e ${ROOT}/etc/portage/make.profile && \ + -e ${MAKE_CONF_DIR}/0100_bootstrap_prefix_make.conf ]] \ + || (bootstrap_setup) || return 1 mkdir -p "${ROOT}"/tmp/etc/. || return 1 [[ -e ${ROOT}/tmp/etc/portage/make.profile ]] || cp -dpR "${ROOT}"/etc/portage "${ROOT}"/tmp/etc || return 1 @@ -1643,16 +1648,20 @@ do_emerge_pkgs() { clang internal-glib ) + local override_make_conf_dir=\ + "${PORTAGE_OVERRIDE_EPREFIX}/etc/portage/make.conf/" + if [[ " ${USE} " == *" prefix-stack "* ]] && [[ ${PORTAGE_OVERRIDE_EPREFIX} == */tmp ]] && - ! grep -q '^USE=".*" # by bootstrap-prefix.sh$' "${PORTAGE_OVERRIDE_EPREFIX}/etc/portage/make.conf" + ! grep -Rq '^USE=".*" # by bootstrap-prefix.sh$' "${override_make_conf_dir}" then # With prefix-stack, the USE env var does apply to the stacked # prefix only, not the base prefix (any more? since some portage # version?), so we have to persist the base USE flags into the # base prefix - without the additional incoming USE flags. + mkdir -p -- "${override_make_conf_dir}" echo "USE=\"\${USE} ${myuse[*]}\" # by bootstrap-prefix.sh" \ - >> "${PORTAGE_OVERRIDE_EPREFIX}/etc/portage/make.conf" + >> "${override_make_conf_dir}/0101_bootstrap_prefix_stack.conf" fi myuse=" ${myuse[*]} " local use @@ -1843,6 +1852,7 @@ bootstrap_stage2() { if [[ ${compiler_type} == clang ]] ; then # we use Clang as our toolchain compiler, so we need to make # sure we actually use it + mkdir -p -- "${MAKE_CONF_DIR}" { echo echo "# System compiler on $(uname) Prefix is Clang, do not remove this" @@ -1852,7 +1862,7 @@ bootstrap_stage2() { echo "OBJCXX=${CHOST}-clang++" echo "BUILD_CC=${CHOST}-clang" echo "BUILD_CXX=${CHOST}-clang++" - } >> "${ROOT}"/etc/portage/make.conf + } >> "${MAKE_CONF_DIR}/0100_bootstrap_prefix_clang.conf" # llvm won't setup symlinks to CHOST-clang here because # we're in a cross-ish situation (at least according to # multilib.eclass -- can't blame it at this point really) @@ -2197,6 +2207,7 @@ set_helper_vars() { export PORTDIR=${PORTDIR:-"${ROOT}/var/db/repos/gentoo"} export DISTDIR=${DISTDIR:-"${ROOT}/var/cache/distfiles"} PORTAGE_TMPDIR=${PORTAGE_TMPDIR:-${ROOT}/var/tmp} + MAKE_CONF_DIR="${ROOT}/etc/portage/make.conf/" DISTFILES_URL=${DISTFILES_URL:-"http://dev.gentoo.org/~grobian/distfiles"} GNU_URL=${GNU_URL:="http://ftp.gnu.org/gnu"} DISTFILES_G_O="http://distfiles.prefix.bitzolder.nl"