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 D62F8139082 for ; Wed, 29 Nov 2017 17:20:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 876F1E0C48; Wed, 29 Nov 2017 17:20:49 +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 5C10CE0C48 for ; Wed, 29 Nov 2017 17:20:49 +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 598F333D4A6 for ; Wed, 29 Nov 2017 17:20:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 77126ABD8 for ; Wed, 29 Nov 2017 17:20:45 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1511313381.ef6b486a75530a4f1940c981103f7ab27b24f544.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: targets/support/, targets/stage4/, targets/stage2/, targets/stage3/ X-VCS-Repository: proj/catalyst X-VCS-Files: targets/stage2/stage2-controller.sh targets/stage3/stage3-controller.sh targets/stage4/stage4-controller.sh targets/support/functions.sh X-VCS-Directories: targets/stage4/ targets/support/ targets/stage2/ targets/stage3/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: ef6b486a75530a4f1940c981103f7ab27b24f544 X-VCS-Branch: master Date: Wed, 29 Nov 2017 17:20:45 +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-Archives-Salt: cfcbf615-5775-42b7-aacc-8be6412bca28 X-Archives-Hash: 9ba2d47b6b1f58ed130109ea9a343337 Message-ID: <20171129172045.NoWWMzFP3a418O1erlI5SP845EWYUFCeDMUXoc9TTko@z> commit: ef6b486a75530a4f1940c981103f7ab27b24f544 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo org> AuthorDate: Sat Mar 11 00:43:29 2017 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Wed Nov 22 01:16:21 2017 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=ef6b486a Add prepare_portage and clear_portage to functions.sh and to the controller.sh file for stages 2, 3 and 4. Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) gentoo.org> targets/stage2/stage2-controller.sh | 3 +++ targets/stage3/stage3-controller.sh | 3 +++ targets/stage4/stage4-controller.sh | 3 +++ targets/support/functions.sh | 23 +++++++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/targets/stage2/stage2-controller.sh b/targets/stage2/stage2-controller.sh index 25e51208..41bd43bb 100755 --- a/targets/stage2/stage2-controller.sh +++ b/targets/stage2/stage2-controller.sh @@ -10,6 +10,8 @@ case $1 in ;; run) + prepare_portage + shift export clst_packages="$*" exec_in_chroot \ @@ -17,6 +19,7 @@ case $1 in ;; preclean) + clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh index df1479ea..eaa40b3d 100755 --- a/targets/stage3/stage3-controller.sh +++ b/targets/stage3/stage3-controller.sh @@ -10,12 +10,15 @@ case $1 in ;; run) + prepare_portage + shift export clst_packages="$*" exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-chroot.sh ;; preclean) + clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ;; diff --git a/targets/stage4/stage4-controller.sh b/targets/stage4/stage4-controller.sh index d42f302f..4c5d5a06 100755 --- a/targets/stage4/stage4-controller.sh +++ b/targets/stage4/stage4-controller.sh @@ -10,6 +10,8 @@ case $1 in ;; pre-kmerge) + prepare_portage + # Sets up the build environment before any kernels are compiled exec_in_chroot ${clst_shdir}/support/pre-kmerge.sh ;; @@ -41,6 +43,7 @@ case $1 in ;; preclean) + clear_portage exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ${clst_root_path} ;; diff --git a/targets/support/functions.sh b/targets/support/functions.sh index cca2fd82..f743d419 100755 --- a/targets/support/functions.sh +++ b/targets/support/functions.sh @@ -16,6 +16,29 @@ delete_from_chroot(){ fi } +prepare_portage() { + + echo "CATALYST_USE=\"${clst_CATALYST_USE}\"" >> ${clst_chroot_path}${clst_make_conf} + sed -i -e "/^USE=\"/s//\${CATALYST_USE} ${USE} /" ${clst_chroot_path}${clst_make_conf} +} + +clear_portage() { + # Clean-up USE again + [ -e ${clst_chroot_path}${clst_make_conf} ] && echo "Drop \$CATALYST_USE from USE on ${clst_chroot_path}${clst_make_conf}" + [ -e ${clst_chroot_path}${clst_make_conf} ] && sed -i -e "/^USE=\"/s/\${CATALYST_USE} //" ${clst_chroot_path}${clst_make_conf} + [ -e ${clst_chroot_path}${clst_make_conf} ] && echo "Remove \$CATALYST_USE on ${clst_chroot_path}${clst_make_conf}" + [ -e ${clst_chroot_path}${clst_make_conf} ] && sed -i -e "/^CATALYST_USE/d" ${clst_chroot_path}${clist_make_conf} + + if [ -n "${clst_portage_prefix}" ]; then + for dir in "keywords", "mask", "unmask", "use"; do + [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] && + echo "Clear ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}" + [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] && + rm -R "${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}" + done + fi +} + exec_in_chroot(){ # Takes the full path to the source file as its argument # copies the file to the /tmp directory of the chroot