public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/catalyst:master commit in: /, targets/stage1/, files/, modules/
@ 2013-01-25  3:47 Richard Farina
  0 siblings, 0 replies; only message in thread
From: Richard Farina @ 2013-01-25  3:47 UTC (permalink / raw
  To: gentoo-commits

commit:     6b4153ab9a07fb2f2c77484bc60d24d0a491e618
Author:     Rick Farina (Zero_Chaos) <zerochaos <AT> gentoo <DOT> org>
AuthorDate: Fri Jan 25 03:46:05 2013 +0000
Commit:     Richard Farina <zerochaos <AT> gentoo <DOT> org>
CommitDate: Fri Jan 25 03:46:05 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=6b4153ab

make bindist optional

After the recent fixes which ensure the bindist use flag
is always set, users now have no way to disable this flag.
This patch introduces the new "bindist" feature, enabled by
default, which will allow users to turn off bindist if
they are not going to redistribute the builds (or for
tinderbox testing, etc).

---
 catalyst                        |    8 ++++++++
 files/catalyst.conf             |    4 +++-
 modules/generic_stage_target.py |    5 +++--
 modules/grp_target.py           |   11 ++++++-----
 modules/livecd_stage1_target.py |    6 ++++--
 targets/stage1/stage1-chroot.sh |    6 ++++--
 6 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/catalyst b/catalyst
index 93114e9..9f8dd30 100755
--- a/catalyst
+++ b/catalyst
@@ -112,6 +112,14 @@ def parse_config(myconfig):
 		print "Autoresuming support enabled."
 		conf_values["AUTORESUME"]="1"
 
+	if "bindist" in string.split(conf_values["options"]):
+		print "Binary redistribution enabled"
+		conf_values["BINDIST"]="1"
+	else:
+		print "Bindist is not enabled in catalyst.conf"
+		print "Binary redistribution of generated stages/isos may be prohibited by law."
+		print "Please see the use description for bindist on any package you are including."
+
 	if "ccache" in string.split(conf_values["options"]):
 		print "Compiler cache support enabled."
 		conf_values["CCACHE"]="1"

diff --git a/files/catalyst.conf b/files/catalyst.conf
index e2def66..f88f105 100644
--- a/files/catalyst.conf
+++ b/files/catalyst.conf
@@ -49,6 +49,8 @@ hash_function="crc32"
 #	the -a option to the catalyst cmdline.  -p will clear the autoresume flags
 #	as well as your pkgcache and kerncache
 #	( This option is not fully tested, bug reports welcome )
+# bindist = enables the bindist USE flag, please see package specific definition,
+#	however, it is suggested to enable this if redistributing builds.
 # ccache = enables build time ccache support
 # distcc = enable distcc support for building. You have to set distcc_hosts in
 # 	your spec file.
@@ -64,7 +66,7 @@ hash_function="crc32"
 #	your cache. The cache is unlinked before any empty or rm processing, though.
 #
 # (These options can be used together)
-options="autoresume kerncache pkgcache seedcache snapcache"
+options="autoresume bindist kerncache pkgcache seedcache snapcache"
 
 # portdir specifies the source portage tree used by the snapshot target.
 portdir="/usr/portage"

diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py
index 0a473ef..12921d6 100644
--- a/modules/generic_stage_target.py
+++ b/modules/generic_stage_target.py
@@ -490,8 +490,9 @@ class generic_stage_target(generic_target):
 		if type(self.settings["use"])==types.StringType:
 			self.settings["use"]=self.settings["use"].split()
 
-		# Force bindist for all targets
-		self.settings["use"].append("bindist")
+		# Force bindist when options ask for it
+		if "BINDIST" in self.settings:
+			self.settings["use"].append("bindist")
 
 	def set_stage_path(self):
 		self.settings["stage_path"]=normpath(self.settings["chroot_path"])

diff --git a/modules/grp_target.py b/modules/grp_target.py
index 654b5e5..6941522 100644
--- a/modules/grp_target.py
+++ b/modules/grp_target.py
@@ -62,11 +62,12 @@ class grp_target(generic_stage_target):
 				raise CatalystError,"GRP build aborting due to error."
 
 	def set_use(self):
-	    generic_stage_target.set_use(self)
-	    if "use" in self.settings:
-	    	self.settings["use"].append("bindist")
-	    else:
-	    	self.settings["use"]=["bindist"]
+		generic_stage_target.set_use(self)
+		if "BINDIST" in self.settings:
+			if "use" in self.settings:
+				self.settings["use"].append("bindist")
+			else:
+				self.settings["use"]=["bindist"]
 
 	def set_mounts(self):
 	    self.mounts.append("/tmp/grp")

diff --git a/modules/livecd_stage1_target.py b/modules/livecd_stage1_target.py
index 5b552b9..59de9bb 100644
--- a/modules/livecd_stage1_target.py
+++ b/modules/livecd_stage1_target.py
@@ -48,10 +48,12 @@ class livecd_stage1_target(generic_stage_target):
 		generic_stage_target.set_use(self)
 		if "use" in self.settings:
 			self.settings["use"].append("livecd")
-			self.settings["use"].append("bindist")
+			if "BINDIST" in self.settings:
+				self.settings["use"].append("bindist")
 		else:
 			self.settings["use"]=["livecd"]
-			self.settings["use"].append("bindist")
+			if "BINDIST" in self.settings:
+				self.settings["use"].append("bindist")
 
 	def set_packages(self):
 		generic_stage_target.set_packages(self)

diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
index 73d27ff..462ea28 100644
--- a/targets/stage1/stage1-chroot.sh
+++ b/targets/stage1/stage1-chroot.sh
@@ -7,6 +7,8 @@ export clst_buildpkgs="$(/tmp/build.py)"
 
 # Setup our environment
 BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)"
+[ -n "${clst_BINDIST}" ] && BOOTSTRAP_USE="${BOOTSTRAP_USE} bindist"
+
 FEATURES="${clst_myfeatures} nodoc noman noinfo -news"
 
 ## Sanity check profile
@@ -50,8 +52,8 @@ sed -i '/USE="${USE} -build"/d' /etc/portage/make.conf
 
 # Now, we install our packages
 [ -e /etc/portage/make.conf ] && \
-	echo "USE=\"-* bindist build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \
+	echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \
 	>> /etc/portage/make.conf
 run_merge "--oneshot ${clst_buildpkgs}"
-sed -i "/USE=\"-* bindist build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \
+sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \
 	/etc/portage/make.conf


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

only message in thread, other threads:[~2013-01-25  3:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-25  3:47 [gentoo-commits] proj/catalyst:master commit in: /, targets/stage1/, files/, modules/ Richard Farina

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