public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:catalyst_use commit in: catalyst/targets/, targets/stage1/, catalyst/base/, targets/stage2/
@ 2017-02-06  3:38 Brian Dolbec
  0 siblings, 0 replies; only message in thread
From: Brian Dolbec @ 2017-02-06  3:38 UTC (permalink / raw
  To: gentoo-commits

commit:     9557d19b921a8f33a4a65c9550dd9a0483f7693f
Author:     Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  9 02:09:41 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Feb  6 02:11:56 2017 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9557d19b

Add initial CATALYST_USE support.

Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>

 catalyst/base/stagebase.py        | 13 ++++++++++++-
 catalyst/targets/grp.py           |  7 -------
 catalyst/targets/livecd_stage1.py | 14 +++++---------
 targets/stage1/stage1-chroot.sh   |  7 ++++---
 targets/stage2/stage2-chroot.sh   | 16 ----------------
 5 files changed, 21 insertions(+), 36 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 68ccb79..8d00fa1 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -175,6 +175,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		self.set_controller_file()
 		self.set_default_action_sequence()
 		self.set_use()
+		self.set_catalyst_use()
 		self.set_cleanables()
 		self.set_iso_volume_id()
 		self.set_build_kernel_vars()
@@ -549,9 +550,19 @@ class StageBase(TargetBase, ClearBase, GenBase):
 		if isinstance(self.settings['use'], str):
 			self.settings["use"]=self.settings["use"].split()
 
+	def set_catalyst_use(self):
+		if self.settings["spec_prefix"] + "/catalyst_use" in self.settings:
+			self.settings["catalyst_use"] = \
+				self.settings[self.settings["spec_prefix"]+"/catalyst_use"]
+			del self.settings[self.settings["spec_prefix"]+"/catalyst_use"]
+		if "catalyst_use" not in self.settings:
+			self.settings["catalyst_use"] = ""
+		if isinstance(self.settings['catalyst_use'], str):
+			self.settings["catalyst_use"] = self.settings["catalyst_use"].split()
+
 		# Force bindist when options ask for it
 		if "BINDIST" in self.settings:
-			self.settings["use"].append("bindist")
+			self.settings["catalyst_use"].append("bindist")
 
 	def set_stage_path(self):
 		self.settings["stage_path"]=normpath(self.settings["chroot_path"])

diff --git a/catalyst/targets/grp.py b/catalyst/targets/grp.py
index 049bc55..d47654d 100644
--- a/catalyst/targets/grp.py
+++ b/catalyst/targets/grp.py
@@ -52,13 +52,6 @@ class grp(StageBase):
 				raise CatalystError("GRP build aborting due to error.",
 					print_traceback=True)
 
-	def set_use(self):
-		StageBase.set_use(self)
-		if "use" in self.settings:
-			self.settings["use"].append("bindist")
-		else:
-			self.settings["use"]=["bindist"]
-
 	def set_mounts(self):
 		self.mounts.append("/tmp/grp")
 		self.mountmap["/tmp/grp"]=self.settings["target_path"]

diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py
index eea4312..c0a664f 100644
--- a/catalyst/targets/livecd_stage1.py
+++ b/catalyst/targets/livecd_stage1.py
@@ -29,16 +29,12 @@ class livecd_stage1(StageBase):
 	def set_spec_prefix(self):
 		self.settings["spec_prefix"]="livecd"
 
-	def set_use(self):
-		StageBase.set_use(self)
-		if "use" in self.settings:
-			self.settings["use"].append("livecd")
-			if "BINDIST" in self.settings:
-				self.settings["use"].append("bindist")
+	def set_catalyst_use(self):
+		StageBase.set_catalyst_use(self)
+		if "catalyst_use" in self.settings:
+			self.settings["catalyst_use"].append("livecd")
 		else:
-			self.settings["use"]=["livecd"]
-			if "BINDIST" in self.settings:
-				self.settings["use"].append("bindist")
+			self.settings["catalyst_use"] = ["livecd"]
 
 	def set_packages(self):
 		StageBase.set_packages(self)

diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
index fbda84b..ce57dfb 100755
--- a/targets/stage1/stage1-chroot.sh
+++ b/targets/stage1/stage1-chroot.sh
@@ -53,7 +53,8 @@ sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf}
 
 # Now, we install our packages
 if [ -e ${clst_make_conf} ]; then
-	echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf}
+	echo "CATALYST_USE=\"-* build ${clst_CATALYST_USE}\"" >> ${clst_make_conf}
+	echo "USE=\"${USE} ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf}
 	for useexpand in ${clst_HOSTUSEEXPAND}; do
 		x="clst_${useexpand}"
 		echo "${useexpand}=\"${!x}\"" \
@@ -62,8 +63,8 @@ if [ -e ${clst_make_conf} ]; then
 fi
 
 run_merge "--oneshot ${clst_buildpkgs}"
-sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \
-	${clst_make_conf}
+
+# Why are we removing these? Don't we need them for final make.conf?
 for useexpand in ${clst_HOSTUSEEXPAND}; do
 	x="clst_${useexpand}"
 	sed -i "/${useexpand}=\"${!x}\"/d" \

diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh
index 38dfea3..5fac858 100755
--- a/targets/stage2/stage2-chroot.sh
+++ b/targets/stage2/stage2-chroot.sh
@@ -5,21 +5,5 @@ source /tmp/chroot-functions.sh
 # Setup the environment
 export FEATURES="${clst_myfeatures} nodoc noman noinfo -news"
 
-# Set bindist USE flag if clst_BINDIST is set
-# The bindist functions have been taken from support/chroot-functions.sh
-if [ -e "${clst_make_conf}" ] && [ -n "${clst_BINDIST}" ]; then
-	if grep -q ^USE "${clst_make_conf}"; then
-		echo "USE=\"\${USE} bindist\"" >> "${clst_make_conf}"
-	else
-		echo "USE=\"bindist\"" >> "${clst_make_conf}"
-	fi
-fi
-
-
-
 ## START BUILD
 ${clst_repo_basedir}/${clst_repo_name}/scripts/bootstrap.sh ${bootstrap_opts} || exit 1
-
-# Clean-up USE again
-sed -i "/USE=\"\${USE} bindist\"/d" "${clst_make_conf}"
-sed -i "/USE=\"bindist\"/d" "${clst_make_conf}"


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-02-06  3:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-06  3:38 [gentoo-commits] proj/catalyst:catalyst_use commit in: catalyst/targets/, targets/stage1/, catalyst/base/, targets/stage2/ Brian Dolbec

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