public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] proj/catalyst:master commit in: targets/support/, targets/stage4/, targets/stage2/, targets/stage3/
  @ 2017-11-29 17:20 99% ` Brian Dolbec
  0 siblings, 0 replies; 1+ results
From: Brian Dolbec @ 2017-11-29 17:20 UTC (permalink / raw
  To: gentoo-commits

commit:     ef6b486a75530a4f1940c981103f7ab27b24f544
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 11 00:43:29 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> 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) <jmbsvicetto <AT> 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


^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2017-11-22 15:52     [gentoo-commits] proj/catalyst:pending commit in: targets/stage4/, targets/support/, targets/stage2/, targets/stage3/ Brian Dolbec
2017-11-29 17:20 99% ` [gentoo-commits] proj/catalyst:master commit in: targets/support/, targets/stage4/, " Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox