[prev in list] [next in list] [prev in thread] [next in thread]
List: gentoo-alt
Subject: [gentoo-alt] [PATCH 3/3] scripts/bootstrap-prefix.sh: create etc/make.conf as dir (or populate it if
From: Etienne Buira <etienne.buira.lists () free ! fr>
Date: 2021-10-31 15:40:04
Message-ID: b53e34d9e335ba269a3214d844a9931f65bd173f.1635690454.git.etienne.buira.lists () free ! fr
[Download RAW message or body]
This makes it easy to (pre)set some site/host specific vars (like -march
CFLAG), but still using bootstrap generated make.conf
---
scripts/bootstrap-prefix.sh | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 2b9e2e76f2..45d5884648 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 "${ROOT}/etc/portage/make.conf" ]] && mkdir -p \
"${ROOT}/etc/portage/make.conf" + 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
+ } > "${ROOT}"/etc/portage/make.conf/0100_bootstrap_prefix_make.conf
fi
if is-rap ; then
@@ -1399,7 +1400,7 @@ 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 \
${ROOT}/etc/portage/make.conf/0100_bootstrap_prefix_make.conf ]] || (bootstrap_setup) \
|| return 1
prepare_portage
}
@@ -1558,7 +1559,7 @@ 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 \
${ROOT}/etc/portage/make.conf/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
@@ -1629,14 +1630,15 @@ do_emerge_pkgs() {
)
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$' "${PORTAGE_OVERRIDE_EPREFIX}/etc/portage/make.conf" 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 -- "${PORTAGE_OVERRIDE_EPREFIX}/etc/portage/make.conf"
echo "USE=\"\${USE} ${myuse[*]}\" # by bootstrap-prefix.sh" \
- >> "${PORTAGE_OVERRIDE_EPREFIX}/etc/portage/make.conf"
+ >> "${PORTAGE_OVERRIDE_EPREFIX}/etc/portage/make.conf/0101_bootstrap_prefix_stack.conf"
fi
myuse=" ${myuse[*]} "
local use
@@ -1827,6 +1829,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 -- "${ROOT}/etc/portage/make.conf"
{
echo
echo "# System compiler on $(uname) Prefix is Clang, do not remove this"
@@ -1836,7 +1839,7 @@ bootstrap_stage2() {
echo "OBJCXX=${CHOST}-clang++"
echo "BUILD_CC=${CHOST}-clang"
echo "BUILD_CXX=${CHOST}-clang++"
- } >> "${ROOT}"/etc/portage/make.conf
+ } >> "${ROOT}"/etc/portage/make.conf/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)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic