From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2FCBE1382C5 for ; Mon, 18 Jan 2021 19:53:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3A89BE081B; Mon, 18 Jan 2021 19:53:50 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1839FE081B for ; Mon, 18 Jan 2021 19:53:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 19D4C340F0D for ; Mon, 18 Jan 2021 19:53:49 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 321E54AB for ; Mon, 18 Jan 2021 19:53:46 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1608405914.9abe4ca574e11fe2c3810bac44789143399798a7.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:pending/mattst88 commit in: targets/embedded/, targets/support/, targets/netboot/, targets/stage1/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/embedded/chroot.sh targets/netboot/controller.sh targets/netboot/pkg.sh targets/stage1/chroot.sh targets/stage1/controller.sh targets/support/chroot-functions.sh X-VCS-Directories: targets/stage1/ targets/netboot/ targets/embedded/ targets/support/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 9abe4ca574e11fe2c3810bac44789143399798a7 X-VCS-Branch: pending/mattst88 Date: Mon, 18 Jan 2021 19:53:46 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 34fd0e85-2821-4da7-a900-c2dda26b4d13 X-Archives-Hash: 13e5ce0a277222676d98510c75e58233 commit: 9abe4ca574e11fe2c3810bac44789143399798a7 Author: Matt Turner gentoo org> AuthorDate: Sat Dec 19 00:22:09 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Sat Dec 19 19:25:14 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9abe4ca5 targets: Remove make_destpath() function It just read clst_root_path, exported it as ROOT, and ensured that a directory existed at $ROOT. Setting and resetting clst_* variables adds a lot of confusion, so just use ROOT directly. Signed-off-by: Matt Turner gentoo.org> targets/embedded/chroot.sh | 15 ++++++--------- targets/netboot/controller.sh | 2 +- targets/netboot/pkg.sh | 2 +- targets/stage1/chroot.sh | 12 +++++++----- targets/stage1/controller.sh | 4 ++-- targets/support/chroot-functions.sh | 32 ++++++-------------------------- 6 files changed, 23 insertions(+), 44 deletions(-) diff --git a/targets/embedded/chroot.sh b/targets/embedded/chroot.sh index 2fbba278..11068388 100755 --- a/targets/embedded/chroot.sh +++ b/targets/embedded/chroot.sh @@ -2,14 +2,11 @@ source /tmp/chroot-functions.sh -# Setup the environment -export DESTROOT="${clst_root_path}" -export clst_root_path="/" +echo "Installing dependencies..." +ROOT=/ run_merge -o "${clst_embedded_packages}" -echo "Installing dependencies into ${DESTROOT}..." -run_merge -o "${clst_embedded_packages}" +export ROOT="${clst_root_path}" +mkdir -p "$ROOT" -export clst_root_path="${DESTROOT}" -export INSTALL_MASK="${clst_install_mask}" - -run_merge -1 -O "${clst_embedded_packages}" +INSTALL_MASK="${clst_install_mask}" \ + run_merge -1 -O "${clst_embedded_packages}" diff --git a/targets/netboot/controller.sh b/targets/netboot/controller.sh index 9a6e14d2..cc946c2c 100755 --- a/targets/netboot/controller.sh +++ b/targets/netboot/controller.sh @@ -6,7 +6,7 @@ case ${1} in build_packages) echo ">>> Building packages ..." shift - clst_root_path="/" \ + ROOT="/" \ clst_packages="$*" \ exec_in_chroot \ ${clst_shdir}/${clst_target}/pkg.sh diff --git a/targets/netboot/pkg.sh b/targets/netboot/pkg.sh index 2ec27062..2ad9491c 100755 --- a/targets/netboot/pkg.sh +++ b/targets/netboot/pkg.sh @@ -10,4 +10,4 @@ show_debug # START BUILD -run_merge ${clst_packages} +ROOT="$ROOT" run_merge ${clst_packages} diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh index 33d5c3c9..b733fc57 100755 --- a/targets/stage1/chroot.sh +++ b/targets/stage1/chroot.sh @@ -33,9 +33,9 @@ if [ -n "${clst_update_seed}" ]; then if [ "${clst_update_seed}" == "yes" ]; then echo "Updating seed stage..." if [ -n "${clst_update_seed_command}" ]; then - clst_root_path=/ run_merge --buildpkg=n "${clst_update_seed_command}" + ROOT=/ run_merge --buildpkg=n "${clst_update_seed_command}" else - clst_root_path=/ run_merge --update --deep --newuse --complete-graph --rebuild-if-new-ver gcc + ROOT=/ run_merge --update --deep --newuse --complete-graph --rebuild-if-new-ver gcc fi elif [ "${clst_update_seed}" != "no" ]; then echo "Invalid setting for update_seed: ${clst_update_seed}" @@ -50,7 +50,9 @@ fi # Clear USE [ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"${BINDIST} ${USE}\"/d" ${clst_make_conf} -make_destpath "${clst_root_path}" + +export ROOT="${clst_root_path}" +mkdir -p "$ROOT" ## START BUILD # First, we drop in a known-good baselayout @@ -59,7 +61,7 @@ run_merge --oneshot --nodeps sys-apps/baselayout sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf} echo "$locales" > /etc/locale.gen -for etc in /etc "${clst_root_path}"/etc; do +for etc in /etc "$ROOT"/etc; do echo "LANG=C.UTF8" > ${etc}/env.d/02locale done update_env_settings @@ -84,7 +86,7 @@ run_merge --oneshot "${buildpkgs[@]}" # not run locale-gen when ROOT is set. Since we've set LANG, we need to run # locale-gen explicitly. if [ -x "$(command -v locale-gen)" ]; then - locale-gen --destdir "${clst_root_path}"/ || die "locale-gen failed" + locale-gen --destdir "$ROOT"/ || die "locale-gen failed" fi # Why are we removing these? Don't we need them for final make.conf? diff --git a/targets/stage1/controller.sh b/targets/stage1/controller.sh index f9dd4b9b..ab127114 100755 --- a/targets/stage1/controller.sh +++ b/targets/stage1/controller.sh @@ -10,8 +10,8 @@ case "$1" in cp "${clst_shdir}/stage1/build.py" "${clst_chroot_path}/tmp" # Setup "ROOT in chroot" dir - install -d "${clst_chroot_path}/${clst_root_path}/etc" - install -d "${clst_chroot_path}/${clst_root_path}${clst_port_conf}" + install -d "${clst_stage_path}/etc" + install -d "${clst_stage_path}/${clst_port_conf}" # Setup make.conf and make.profile link in "ROOT in chroot": copy_to_chroot "${clst_chroot_path}${clst_make_conf}" "${clst_root_path}${clst_port_conf}" diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index d125756f..2aec018e 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -60,7 +60,7 @@ setup_features() { if [ -n "${clst_CCACHE}" ] then features+=(ccache) - clst_root_path=/ run_merge --oneshot --noreplace dev-util/ccache + ROOT=/ run_merge --oneshot --noreplace dev-util/ccache fi if [ -n "${clst_DISTCC}" ] @@ -75,9 +75,9 @@ setup_features() { # reinstall if it isn't found. if [ "$(getent passwd distcc | cut -d: -f1)" != "distcc" ] then - clst_root_path=/ run_merge --oneshot sys-devel/distcc + ROOT=/ run_merge --oneshot sys-devel/distcc else - clst_root_path=/ run_merge --oneshot --noreplace sys-devel/distcc + ROOT=/ run_merge --oneshot --noreplace sys-devel/distcc fi sed -i '/USE="${USE} -avahi -gtk -gnome"/d' ${clst_make_conf} mkdir -p /etc/distcc @@ -96,7 +96,7 @@ setup_features() { if [ -n "${clst_ICECREAM}" ] then - clst_root_path=/ run_merge --oneshot --noreplace sys-devel/icecream + ROOT=/ run_merge --oneshot --noreplace sys-devel/icecream # This sets up automatic cross-icecc-fu according to # http://www.gentoo-wiki.info/HOWTO_Setup_An_ICECREAM_Compile_Cluster @@ -193,7 +193,6 @@ cleanup_icecream() { } cleanup_stages() { - make_destpath if [ -n "${clst_DISTCC}" ] then cleanup_distcc @@ -238,26 +237,7 @@ die() { exit 1 } -make_destpath() { - # ROOT is / by default, so remove any ROOT= settings from make.conf - sed -i '/ROOT=/d' ${clst_make_conf} - export ROOT=/ - if [ "${1}" != "/" -a -n "${1}" ] - then - echo "ROOT=\"${1}\"" >> ${clst_make_conf} - export ROOT=${1} - fi - if [ ! -d ${ROOT} ] - then - install -d ${ROOT} - fi -} - run_merge() { - # Sets up the ROOT= parameter - # with no options ROOT=/ - make_destpath ${clst_root_path} - export EMERGE_WARNING_DELAY=0 export CLEAN_DELAY=0 [[ $CONFIG_PROTECT != "-*"* ]] && export CONFIG_PROTECT="-*" @@ -265,12 +245,12 @@ run_merge() { if [ -n "${clst_VERBOSE}" ] then echo "ROOT=${ROOT} emerge ${emerge_opts[@]} -pt $@" || exit 1 - emerge ${emerge_opts[@]} -pt $@ || exit 3 + ROOT="$ROOT" emerge ${emerge_opts[@]} -pt $@ || exit 3 fi echo "emerge ${emerge_opts[@]} $@" || exit 1 - emerge ${emerge_opts[@]} $@ || exit 1 + ROOT="$ROOT" emerge ${emerge_opts[@]} $@ || exit 1 } show_debug() { From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0B00A1382C5 for ; Sun, 27 Dec 2020 23:15:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C70AE0E3E; Sun, 27 Dec 2020 23:15:27 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 19138E0E3E for ; Sun, 27 Dec 2020 23:15:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 76F76340F4A for ; Sun, 27 Dec 2020 23:15:25 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 699F6478 for ; Sun, 27 Dec 2020 23:15:22 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1608405914.9abe4ca574e11fe2c3810bac44789143399798a7.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: targets/netboot/, targets/embedded/, targets/stage1/, targets/support/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/embedded/chroot.sh targets/netboot/controller.sh targets/netboot/pkg.sh targets/stage1/chroot.sh targets/stage1/controller.sh targets/support/chroot-functions.sh X-VCS-Directories: targets/embedded/ targets/netboot/ targets/support/ targets/stage1/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 9abe4ca574e11fe2c3810bac44789143399798a7 X-VCS-Branch: master Date: Sun, 27 Dec 2020 23:15:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 1db36f88-3833-4d8d-8216-d4cd2717adfe X-Archives-Hash: c9b112f501077406329c6ffc1e358c64 Message-ID: <20201227231522.P55hz8ODYcEnPz-MfdDB-KnaqnKpZDXHoHkY6bQYu_k@z> commit: 9abe4ca574e11fe2c3810bac44789143399798a7 Author: Matt Turner gentoo org> AuthorDate: Sat Dec 19 00:22:09 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Sat Dec 19 19:25:14 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9abe4ca5 targets: Remove make_destpath() function It just read clst_root_path, exported it as ROOT, and ensured that a directory existed at $ROOT. Setting and resetting clst_* variables adds a lot of confusion, so just use ROOT directly. Signed-off-by: Matt Turner gentoo.org> targets/embedded/chroot.sh | 15 ++++++--------- targets/netboot/controller.sh | 2 +- targets/netboot/pkg.sh | 2 +- targets/stage1/chroot.sh | 12 +++++++----- targets/stage1/controller.sh | 4 ++-- targets/support/chroot-functions.sh | 32 ++++++-------------------------- 6 files changed, 23 insertions(+), 44 deletions(-) diff --git a/targets/embedded/chroot.sh b/targets/embedded/chroot.sh index 2fbba278..11068388 100755 --- a/targets/embedded/chroot.sh +++ b/targets/embedded/chroot.sh @@ -2,14 +2,11 @@ source /tmp/chroot-functions.sh -# Setup the environment -export DESTROOT="${clst_root_path}" -export clst_root_path="/" +echo "Installing dependencies..." +ROOT=/ run_merge -o "${clst_embedded_packages}" -echo "Installing dependencies into ${DESTROOT}..." -run_merge -o "${clst_embedded_packages}" +export ROOT="${clst_root_path}" +mkdir -p "$ROOT" -export clst_root_path="${DESTROOT}" -export INSTALL_MASK="${clst_install_mask}" - -run_merge -1 -O "${clst_embedded_packages}" +INSTALL_MASK="${clst_install_mask}" \ + run_merge -1 -O "${clst_embedded_packages}" diff --git a/targets/netboot/controller.sh b/targets/netboot/controller.sh index 9a6e14d2..cc946c2c 100755 --- a/targets/netboot/controller.sh +++ b/targets/netboot/controller.sh @@ -6,7 +6,7 @@ case ${1} in build_packages) echo ">>> Building packages ..." shift - clst_root_path="/" \ + ROOT="/" \ clst_packages="$*" \ exec_in_chroot \ ${clst_shdir}/${clst_target}/pkg.sh diff --git a/targets/netboot/pkg.sh b/targets/netboot/pkg.sh index 2ec27062..2ad9491c 100755 --- a/targets/netboot/pkg.sh +++ b/targets/netboot/pkg.sh @@ -10,4 +10,4 @@ show_debug # START BUILD -run_merge ${clst_packages} +ROOT="$ROOT" run_merge ${clst_packages} diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh index 33d5c3c9..b733fc57 100755 --- a/targets/stage1/chroot.sh +++ b/targets/stage1/chroot.sh @@ -33,9 +33,9 @@ if [ -n "${clst_update_seed}" ]; then if [ "${clst_update_seed}" == "yes" ]; then echo "Updating seed stage..." if [ -n "${clst_update_seed_command}" ]; then - clst_root_path=/ run_merge --buildpkg=n "${clst_update_seed_command}" + ROOT=/ run_merge --buildpkg=n "${clst_update_seed_command}" else - clst_root_path=/ run_merge --update --deep --newuse --complete-graph --rebuild-if-new-ver gcc + ROOT=/ run_merge --update --deep --newuse --complete-graph --rebuild-if-new-ver gcc fi elif [ "${clst_update_seed}" != "no" ]; then echo "Invalid setting for update_seed: ${clst_update_seed}" @@ -50,7 +50,9 @@ fi # Clear USE [ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"${BINDIST} ${USE}\"/d" ${clst_make_conf} -make_destpath "${clst_root_path}" + +export ROOT="${clst_root_path}" +mkdir -p "$ROOT" ## START BUILD # First, we drop in a known-good baselayout @@ -59,7 +61,7 @@ run_merge --oneshot --nodeps sys-apps/baselayout sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf} echo "$locales" > /etc/locale.gen -for etc in /etc "${clst_root_path}"/etc; do +for etc in /etc "$ROOT"/etc; do echo "LANG=C.UTF8" > ${etc}/env.d/02locale done update_env_settings @@ -84,7 +86,7 @@ run_merge --oneshot "${buildpkgs[@]}" # not run locale-gen when ROOT is set. Since we've set LANG, we need to run # locale-gen explicitly. if [ -x "$(command -v locale-gen)" ]; then - locale-gen --destdir "${clst_root_path}"/ || die "locale-gen failed" + locale-gen --destdir "$ROOT"/ || die "locale-gen failed" fi # Why are we removing these? Don't we need them for final make.conf? diff --git a/targets/stage1/controller.sh b/targets/stage1/controller.sh index f9dd4b9b..ab127114 100755 --- a/targets/stage1/controller.sh +++ b/targets/stage1/controller.sh @@ -10,8 +10,8 @@ case "$1" in cp "${clst_shdir}/stage1/build.py" "${clst_chroot_path}/tmp" # Setup "ROOT in chroot" dir - install -d "${clst_chroot_path}/${clst_root_path}/etc" - install -d "${clst_chroot_path}/${clst_root_path}${clst_port_conf}" + install -d "${clst_stage_path}/etc" + install -d "${clst_stage_path}/${clst_port_conf}" # Setup make.conf and make.profile link in "ROOT in chroot": copy_to_chroot "${clst_chroot_path}${clst_make_conf}" "${clst_root_path}${clst_port_conf}" diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index d125756f..2aec018e 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -60,7 +60,7 @@ setup_features() { if [ -n "${clst_CCACHE}" ] then features+=(ccache) - clst_root_path=/ run_merge --oneshot --noreplace dev-util/ccache + ROOT=/ run_merge --oneshot --noreplace dev-util/ccache fi if [ -n "${clst_DISTCC}" ] @@ -75,9 +75,9 @@ setup_features() { # reinstall if it isn't found. if [ "$(getent passwd distcc | cut -d: -f1)" != "distcc" ] then - clst_root_path=/ run_merge --oneshot sys-devel/distcc + ROOT=/ run_merge --oneshot sys-devel/distcc else - clst_root_path=/ run_merge --oneshot --noreplace sys-devel/distcc + ROOT=/ run_merge --oneshot --noreplace sys-devel/distcc fi sed -i '/USE="${USE} -avahi -gtk -gnome"/d' ${clst_make_conf} mkdir -p /etc/distcc @@ -96,7 +96,7 @@ setup_features() { if [ -n "${clst_ICECREAM}" ] then - clst_root_path=/ run_merge --oneshot --noreplace sys-devel/icecream + ROOT=/ run_merge --oneshot --noreplace sys-devel/icecream # This sets up automatic cross-icecc-fu according to # http://www.gentoo-wiki.info/HOWTO_Setup_An_ICECREAM_Compile_Cluster @@ -193,7 +193,6 @@ cleanup_icecream() { } cleanup_stages() { - make_destpath if [ -n "${clst_DISTCC}" ] then cleanup_distcc @@ -238,26 +237,7 @@ die() { exit 1 } -make_destpath() { - # ROOT is / by default, so remove any ROOT= settings from make.conf - sed -i '/ROOT=/d' ${clst_make_conf} - export ROOT=/ - if [ "${1}" != "/" -a -n "${1}" ] - then - echo "ROOT=\"${1}\"" >> ${clst_make_conf} - export ROOT=${1} - fi - if [ ! -d ${ROOT} ] - then - install -d ${ROOT} - fi -} - run_merge() { - # Sets up the ROOT= parameter - # with no options ROOT=/ - make_destpath ${clst_root_path} - export EMERGE_WARNING_DELAY=0 export CLEAN_DELAY=0 [[ $CONFIG_PROTECT != "-*"* ]] && export CONFIG_PROTECT="-*" @@ -265,12 +245,12 @@ run_merge() { if [ -n "${clst_VERBOSE}" ] then echo "ROOT=${ROOT} emerge ${emerge_opts[@]} -pt $@" || exit 1 - emerge ${emerge_opts[@]} -pt $@ || exit 3 + ROOT="$ROOT" emerge ${emerge_opts[@]} -pt $@ || exit 3 fi echo "emerge ${emerge_opts[@]} $@" || exit 1 - emerge ${emerge_opts[@]} $@ || exit 1 + ROOT="$ROOT" emerge ${emerge_opts[@]} $@ || exit 1 } show_debug() { From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 37EED1382C5 for ; Sat, 19 Dec 2020 19:56:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3ED9B2BC025; Sat, 19 Dec 2020 19:56:08 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 14D342BC025 for ; Sat, 19 Dec 2020 19:56:08 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D05AB340C44 for ; Sat, 19 Dec 2020 19:56:06 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6D2D4476 for ; Sat, 19 Dec 2020 19:56:03 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1608405914.9abe4ca574e11fe2c3810bac44789143399798a7.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:wip/mattst88 commit in: targets/support/, targets/netboot/, targets/stage1/, targets/embedded/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/embedded/chroot.sh targets/netboot/controller.sh targets/netboot/pkg.sh targets/stage1/chroot.sh targets/stage1/controller.sh targets/support/chroot-functions.sh X-VCS-Directories: targets/stage1/ targets/netboot/ targets/support/ targets/embedded/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 9abe4ca574e11fe2c3810bac44789143399798a7 X-VCS-Branch: wip/mattst88 Date: Sat, 19 Dec 2020 19:56:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: cf0bb601-9abe-4cf5-bfd2-ef005254fb60 X-Archives-Hash: 88ae9a932526a1a157a73c3a10478b6e Message-ID: <20201219195603.1LfoTh3SvHwEXM30BT2VIQOJINq3iAnPQIytIo2GBS4@z> commit: 9abe4ca574e11fe2c3810bac44789143399798a7 Author: Matt Turner gentoo org> AuthorDate: Sat Dec 19 00:22:09 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Sat Dec 19 19:25:14 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9abe4ca5 targets: Remove make_destpath() function It just read clst_root_path, exported it as ROOT, and ensured that a directory existed at $ROOT. Setting and resetting clst_* variables adds a lot of confusion, so just use ROOT directly. Signed-off-by: Matt Turner gentoo.org> targets/embedded/chroot.sh | 15 ++++++--------- targets/netboot/controller.sh | 2 +- targets/netboot/pkg.sh | 2 +- targets/stage1/chroot.sh | 12 +++++++----- targets/stage1/controller.sh | 4 ++-- targets/support/chroot-functions.sh | 32 ++++++-------------------------- 6 files changed, 23 insertions(+), 44 deletions(-) diff --git a/targets/embedded/chroot.sh b/targets/embedded/chroot.sh index 2fbba278..11068388 100755 --- a/targets/embedded/chroot.sh +++ b/targets/embedded/chroot.sh @@ -2,14 +2,11 @@ source /tmp/chroot-functions.sh -# Setup the environment -export DESTROOT="${clst_root_path}" -export clst_root_path="/" +echo "Installing dependencies..." +ROOT=/ run_merge -o "${clst_embedded_packages}" -echo "Installing dependencies into ${DESTROOT}..." -run_merge -o "${clst_embedded_packages}" +export ROOT="${clst_root_path}" +mkdir -p "$ROOT" -export clst_root_path="${DESTROOT}" -export INSTALL_MASK="${clst_install_mask}" - -run_merge -1 -O "${clst_embedded_packages}" +INSTALL_MASK="${clst_install_mask}" \ + run_merge -1 -O "${clst_embedded_packages}" diff --git a/targets/netboot/controller.sh b/targets/netboot/controller.sh index 9a6e14d2..cc946c2c 100755 --- a/targets/netboot/controller.sh +++ b/targets/netboot/controller.sh @@ -6,7 +6,7 @@ case ${1} in build_packages) echo ">>> Building packages ..." shift - clst_root_path="/" \ + ROOT="/" \ clst_packages="$*" \ exec_in_chroot \ ${clst_shdir}/${clst_target}/pkg.sh diff --git a/targets/netboot/pkg.sh b/targets/netboot/pkg.sh index 2ec27062..2ad9491c 100755 --- a/targets/netboot/pkg.sh +++ b/targets/netboot/pkg.sh @@ -10,4 +10,4 @@ show_debug # START BUILD -run_merge ${clst_packages} +ROOT="$ROOT" run_merge ${clst_packages} diff --git a/targets/stage1/chroot.sh b/targets/stage1/chroot.sh index 33d5c3c9..b733fc57 100755 --- a/targets/stage1/chroot.sh +++ b/targets/stage1/chroot.sh @@ -33,9 +33,9 @@ if [ -n "${clst_update_seed}" ]; then if [ "${clst_update_seed}" == "yes" ]; then echo "Updating seed stage..." if [ -n "${clst_update_seed_command}" ]; then - clst_root_path=/ run_merge --buildpkg=n "${clst_update_seed_command}" + ROOT=/ run_merge --buildpkg=n "${clst_update_seed_command}" else - clst_root_path=/ run_merge --update --deep --newuse --complete-graph --rebuild-if-new-ver gcc + ROOT=/ run_merge --update --deep --newuse --complete-graph --rebuild-if-new-ver gcc fi elif [ "${clst_update_seed}" != "no" ]; then echo "Invalid setting for update_seed: ${clst_update_seed}" @@ -50,7 +50,9 @@ fi # Clear USE [ -e ${clst_make_conf} ] && sed -i -e "/^USE=\"${BINDIST} ${USE}\"/d" ${clst_make_conf} -make_destpath "${clst_root_path}" + +export ROOT="${clst_root_path}" +mkdir -p "$ROOT" ## START BUILD # First, we drop in a known-good baselayout @@ -59,7 +61,7 @@ run_merge --oneshot --nodeps sys-apps/baselayout sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf} echo "$locales" > /etc/locale.gen -for etc in /etc "${clst_root_path}"/etc; do +for etc in /etc "$ROOT"/etc; do echo "LANG=C.UTF8" > ${etc}/env.d/02locale done update_env_settings @@ -84,7 +86,7 @@ run_merge --oneshot "${buildpkgs[@]}" # not run locale-gen when ROOT is set. Since we've set LANG, we need to run # locale-gen explicitly. if [ -x "$(command -v locale-gen)" ]; then - locale-gen --destdir "${clst_root_path}"/ || die "locale-gen failed" + locale-gen --destdir "$ROOT"/ || die "locale-gen failed" fi # Why are we removing these? Don't we need them for final make.conf? diff --git a/targets/stage1/controller.sh b/targets/stage1/controller.sh index f9dd4b9b..ab127114 100755 --- a/targets/stage1/controller.sh +++ b/targets/stage1/controller.sh @@ -10,8 +10,8 @@ case "$1" in cp "${clst_shdir}/stage1/build.py" "${clst_chroot_path}/tmp" # Setup "ROOT in chroot" dir - install -d "${clst_chroot_path}/${clst_root_path}/etc" - install -d "${clst_chroot_path}/${clst_root_path}${clst_port_conf}" + install -d "${clst_stage_path}/etc" + install -d "${clst_stage_path}/${clst_port_conf}" # Setup make.conf and make.profile link in "ROOT in chroot": copy_to_chroot "${clst_chroot_path}${clst_make_conf}" "${clst_root_path}${clst_port_conf}" diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh index d125756f..2aec018e 100755 --- a/targets/support/chroot-functions.sh +++ b/targets/support/chroot-functions.sh @@ -60,7 +60,7 @@ setup_features() { if [ -n "${clst_CCACHE}" ] then features+=(ccache) - clst_root_path=/ run_merge --oneshot --noreplace dev-util/ccache + ROOT=/ run_merge --oneshot --noreplace dev-util/ccache fi if [ -n "${clst_DISTCC}" ] @@ -75,9 +75,9 @@ setup_features() { # reinstall if it isn't found. if [ "$(getent passwd distcc | cut -d: -f1)" != "distcc" ] then - clst_root_path=/ run_merge --oneshot sys-devel/distcc + ROOT=/ run_merge --oneshot sys-devel/distcc else - clst_root_path=/ run_merge --oneshot --noreplace sys-devel/distcc + ROOT=/ run_merge --oneshot --noreplace sys-devel/distcc fi sed -i '/USE="${USE} -avahi -gtk -gnome"/d' ${clst_make_conf} mkdir -p /etc/distcc @@ -96,7 +96,7 @@ setup_features() { if [ -n "${clst_ICECREAM}" ] then - clst_root_path=/ run_merge --oneshot --noreplace sys-devel/icecream + ROOT=/ run_merge --oneshot --noreplace sys-devel/icecream # This sets up automatic cross-icecc-fu according to # http://www.gentoo-wiki.info/HOWTO_Setup_An_ICECREAM_Compile_Cluster @@ -193,7 +193,6 @@ cleanup_icecream() { } cleanup_stages() { - make_destpath if [ -n "${clst_DISTCC}" ] then cleanup_distcc @@ -238,26 +237,7 @@ die() { exit 1 } -make_destpath() { - # ROOT is / by default, so remove any ROOT= settings from make.conf - sed -i '/ROOT=/d' ${clst_make_conf} - export ROOT=/ - if [ "${1}" != "/" -a -n "${1}" ] - then - echo "ROOT=\"${1}\"" >> ${clst_make_conf} - export ROOT=${1} - fi - if [ ! -d ${ROOT} ] - then - install -d ${ROOT} - fi -} - run_merge() { - # Sets up the ROOT= parameter - # with no options ROOT=/ - make_destpath ${clst_root_path} - export EMERGE_WARNING_DELAY=0 export CLEAN_DELAY=0 [[ $CONFIG_PROTECT != "-*"* ]] && export CONFIG_PROTECT="-*" @@ -265,12 +245,12 @@ run_merge() { if [ -n "${clst_VERBOSE}" ] then echo "ROOT=${ROOT} emerge ${emerge_opts[@]} -pt $@" || exit 1 - emerge ${emerge_opts[@]} -pt $@ || exit 3 + ROOT="$ROOT" emerge ${emerge_opts[@]} -pt $@ || exit 3 fi echo "emerge ${emerge_opts[@]} $@" || exit 1 - emerge ${emerge_opts[@]} $@ || exit 1 + ROOT="$ROOT" emerge ${emerge_opts[@]} $@ || exit 1 } show_debug() {