1 |
-----BEGIN PGP SIGNED MESSAGE----- |
2 |
Hash: SHA1 |
3 |
|
4 |
|
5 |
From: "Rick Farina (Zero_Chaos)" <zerochaos@g.o> |
6 |
|
7 |
After the recent fixes which ensure the bindist use flag |
8 |
is always set, users now have no way to disable this flag. |
9 |
This patch introduces the new "bindist" feature, enabled by |
10 |
default, which will allow users to turn off bindist if |
11 |
they are not going to redistribute the builds (or for |
12 |
tinderbox testing, etc). |
13 |
- --- |
14 |
catalyst | 7 +++++++ |
15 |
files/catalyst.conf | 4 +++- |
16 |
modules/generic_stage_target.py | 5 +++-- |
17 |
modules/grp_target.py | 11 ++++++----- |
18 |
modules/livecd_stage1_target.py | 6 ++++-- |
19 |
targets/stage1/stage1-chroot.sh | 10 +++++++--- |
20 |
6 files changed, 30 insertions(+), 13 deletions(-) |
21 |
|
22 |
diff --git a/catalyst b/catalyst |
23 |
index 3d31599..8485984 100755 |
24 |
- --- a/catalyst |
25 |
+++ b/catalyst |
26 |
@@ -112,6 +112,13 @@ def parse_config(myconfig): |
27 |
print "Autoresuming support enabled." |
28 |
conf_values["AUTORESUME"]="1" |
29 |
|
30 |
+ if "bindist" in string.split(conf_values["options"]): |
31 |
+ print "Binary redistribution enabled" |
32 |
+ conf_values["BINDIST"]="1" |
33 |
+ else: |
34 |
+ print "Bindist is not enabled in catalyst.conf" |
35 |
+ print "Binary redistribution of generated stages/isos is prohibited |
36 |
by law." |
37 |
+ |
38 |
if "ccache" in string.split(conf_values["options"]): |
39 |
print "Compiler cache support enabled." |
40 |
conf_values["CCACHE"]="1" |
41 |
diff --git a/files/catalyst.conf b/files/catalyst.conf |
42 |
index ea74eb1..18c6ab8 100644 |
43 |
- --- a/files/catalyst.conf |
44 |
+++ b/files/catalyst.conf |
45 |
@@ -49,6 +49,8 @@ hash_function="crc32" |
46 |
# the -a option to the catalyst cmdline. -p will clear the autoresume |
47 |
flags |
48 |
# as well as your pkgcache and kerncache |
49 |
# ( This option is not fully tested, bug reports welcome ) |
50 |
+# bindist = enable this option when the builds will be publicly |
51 |
redistributed to prevent |
52 |
+ building of patent encumbered and redistribution restricted items. |
53 |
# ccache = enables build time ccache support (highly recommended) |
54 |
# distcc = enable distcc support for building. You have to set |
55 |
distcc_hosts in |
56 |
# your spec file. |
57 |
@@ -64,7 +66,7 @@ hash_function="crc32" |
58 |
# your cache. The cache is unlinked before any empty or rm processing, |
59 |
though. |
60 |
# |
61 |
# (These options can be used together) |
62 |
- -options="autoresume kerncache pkgcache seedcache snapcache" |
63 |
+options="autoresume bindist kerncache pkgcache seedcache snapcache" |
64 |
|
65 |
# portdir specifies the source portage tree used by the snapshot target. |
66 |
portdir="/usr/portage" |
67 |
diff --git a/modules/generic_stage_target.py |
68 |
b/modules/generic_stage_target.py |
69 |
index 3597680..89082c5 100644 |
70 |
- --- a/modules/generic_stage_target.py |
71 |
+++ b/modules/generic_stage_target.py |
72 |
@@ -490,8 +490,9 @@ class generic_stage_target(generic_target): |
73 |
if type(self.settings["use"])==types.StringType: |
74 |
self.settings["use"]=self.settings["use"].split() |
75 |
|
76 |
- - # Force bindist for all targets |
77 |
- - self.settings["use"].append("bindist") |
78 |
+ # Force bindist when options ask for it |
79 |
+ if self.settings.has_key("BINDIST"): |
80 |
+ self.settings["use"].append("bindist") |
81 |
|
82 |
def set_stage_path(self): |
83 |
self.settings["stage_path"]=normpath(self.settings["chroot_path"]) |
84 |
diff --git a/modules/grp_target.py b/modules/grp_target.py |
85 |
index 12eab08..5d3af2e 100644 |
86 |
- --- a/modules/grp_target.py |
87 |
+++ b/modules/grp_target.py |
88 |
@@ -62,11 +62,12 @@ class grp_target(generic_stage_target): |
89 |
raise CatalystError,"GRP build aborting due to error." |
90 |
|
91 |
def set_use(self): |
92 |
- - generic_stage_target.set_use(self) |
93 |
- - if self.settings.has_key("use"): |
94 |
- - self.settings["use"].append("bindist") |
95 |
- - else: |
96 |
- - self.settings["use"]=["bindist"] |
97 |
+ generic_stage_target.set_use(self) |
98 |
+ if self.settings.has_key("BINDIST"): |
99 |
+ if self.settings.has_key("use"): |
100 |
+ self.settings["use"].append("bindist") |
101 |
+ else: |
102 |
+ self.settings["use"]=["bindist"] |
103 |
|
104 |
def set_mounts(self): |
105 |
self.mounts.append("/tmp/grp") |
106 |
diff --git a/modules/livecd_stage1_target.py |
107 |
b/modules/livecd_stage1_target.py |
108 |
index 17254bb..a27cfe4 100644 |
109 |
- --- a/modules/livecd_stage1_target.py |
110 |
+++ b/modules/livecd_stage1_target.py |
111 |
@@ -48,10 +48,12 @@ class livecd_stage1_target(generic_stage_target): |
112 |
generic_stage_target.set_use(self) |
113 |
if self.settings.has_key("use"): |
114 |
self.settings["use"].append("livecd") |
115 |
- - self.settings["use"].append("bindist") |
116 |
+ if self.settings.has_key("BINDIST"): |
117 |
+ self.settings["use"].append("bindist") |
118 |
else: |
119 |
self.settings["use"]=["livecd"] |
120 |
- - self.settings["use"].append("bindist") |
121 |
+ if self.settings.has_key("BINDIST"): |
122 |
+ self.settings["use"].append("bindist") |
123 |
|
124 |
def set_packages(self): |
125 |
generic_stage_target.set_packages(self) |
126 |
diff --git a/targets/stage1/stage1-chroot.sh |
127 |
b/targets/stage1/stage1-chroot.sh |
128 |
index e40982b..8e5a492 100644 |
129 |
- --- a/targets/stage1/stage1-chroot.sh |
130 |
+++ b/targets/stage1/stage1-chroot.sh |
131 |
@@ -6,7 +6,11 @@ source /tmp/chroot-functions.sh |
132 |
export clst_buildpkgs="$(/tmp/build.py)" |
133 |
|
134 |
# Setup our environment |
135 |
- -BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)" |
136 |
+if [ -n "${clst_BINDIST}" ]; then |
137 |
+ BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE) bindist" |
138 |
+else |
139 |
+ BOOTSTRAP_USE="$(portageq envvar BOOTSTRAP_USE)" |
140 |
+fi |
141 |
FEATURES="${clst_myfeatures} nodoc noman noinfo -news" |
142 |
|
143 |
## Sanity check profile |
144 |
@@ -50,8 +54,8 @@ sed -i '/USE="${USE} -build"/d' /etc/portage/make.conf |
145 |
|
146 |
# Now, we install our packages |
147 |
[ -e /etc/portage/make.conf ] && \ |
148 |
- - echo "USE=\"-* bindist build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \ |
149 |
+ echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \ |
150 |
>> /etc/portage/make.conf |
151 |
run_merge "--oneshot ${clst_buildpkgs}" |
152 |
- -sed -i "/USE=\"-* bindist build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \ |
153 |
+sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \ |
154 |
/etc/portage/make.conf |
155 |
- -- |
156 |
1.7.8.6 |
157 |
|
158 |
|
159 |
|
160 |
|
161 |
-----BEGIN PGP SIGNATURE----- |
162 |
Version: GnuPG v2.0.19 (GNU/Linux) |
163 |
Comment: Using GnuPG with undefined - http://www.enigmail.net/ |
164 |
|
165 |
iQIcBAEBAgAGBQJQwmEmAAoJEKXdFCfdEflKPmgP/2QG+gCEwOnrpqoSb35JWXSw |
166 |
Gf2H2hLs5quTDCaJl9JKG63b8PcsA22GLKArEsdBs2eLVmgAsujj6e7Obwun4RUv |
167 |
SwecZ6wty6N7p4Bvr7TWKTceWORVKWHAlDV65XXg7nE1vzjMg+uLfmuRTJMKcHYh |
168 |
iQJaKOSOXNWlLWfJwZWiqWL7NoB8uf66Pq9IAEwdO54JcGxDIl/H22NW1JjB10H1 |
169 |
RPGTFEXpJA++1FAHqxS02cWqSK/pjzJ1qq9ibVnW0Eupp5U6F3kweAtuQ9IGy3et |
170 |
LUFkhfUW+q51+LswJf75WZFfKT6lML6xf55vZ0vP1T+RByUQTD/r6QxDmO7c0cOz |
171 |
Y7nMP+yT43ieRlGvJvBvE6yYPgNoTOKCDhDkteudNuY7TcqAc2ZVcX9FzR9bcG+H |
172 |
HOlSK+5JnJqemIb4BIi5lUHkCjJd/LrbHl1w4qSvHGZmLBDSXxZYyVPuPuI0a5Sk |
173 |
e6ZQ+0wNEqxiYlM4KMniAkuMseguJK+cp9S9bHx2ZAO+c+kbnsN6V7e2p+LBxg5s |
174 |
VM7wskHuXHzlcUcEw71RMazFRs23vaEVJ7eIU1zBSFK+hxzkeM+9UJq5Bes7zu2L |
175 |
JPLZsRXZbT8lkvuth4FVp0cgMlrNfWHulFoXbYckwanViA7mYzfQVXf+YTqn/bId |
176 |
yi9qhh0pFwykopQ4Qson |
177 |
=lnZN |
178 |
-----END PGP SIGNATURE----- |