1 |
Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto@g.o> |
2 |
--- |
3 |
catalyst/base/stagebase.py | 13 ++++++++++++- |
4 |
catalyst/targets/grp.py | 7 ------- |
5 |
catalyst/targets/livecd_stage1.py | 14 +++++--------- |
6 |
targets/stage1/stage1-chroot.sh | 9 +++++++-- |
7 |
targets/stage2/stage2-chroot.sh | 19 ++++++------------- |
8 |
targets/stage3/stage3-chroot.sh | 10 ++++++++++ |
9 |
6 files changed, 40 insertions(+), 32 deletions(-) |
10 |
|
11 |
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py |
12 |
index 6695ac4..de0fce4 100644 |
13 |
--- a/catalyst/base/stagebase.py |
14 |
+++ b/catalyst/base/stagebase.py |
15 |
@@ -173,6 +173,7 @@ class StageBase(TargetBase, ClearBase, GenBase): |
16 |
self.set_controller_file() |
17 |
self.set_default_action_sequence() |
18 |
self.set_use() |
19 |
+ self.set_catalyst_use() |
20 |
self.set_cleanables() |
21 |
self.set_iso_volume_id() |
22 |
self.set_build_kernel_vars() |
23 |
@@ -547,9 +548,19 @@ class StageBase(TargetBase, ClearBase, GenBase): |
24 |
if isinstance(self.settings['use'], str): |
25 |
self.settings["use"]=self.settings["use"].split() |
26 |
|
27 |
+ def set_catalyst_use(self): |
28 |
+ if self.settings["spec_prefix"]+"/catalyst_use" in self.settings: |
29 |
+ self.settings["catalyst_use"]=\ |
30 |
+ self.settings[self.settings["spec_prefix"]+"/catalyst_use"] |
31 |
+ del self.settings[self.settings["spec_prefix"]+"/catalyst_use"] |
32 |
+ if "catalyst_use" not in self.settings: |
33 |
+ self.settings["catalyst_use"]="" |
34 |
+ if isinstance(self.settings['catalyst_use'], str): |
35 |
+ self.settings["catalyst_use"]=self.settings["catalyst_use"].split() |
36 |
+ |
37 |
# Force bindist when options ask for it |
38 |
if "BINDIST" in self.settings: |
39 |
- self.settings["use"].append("bindist") |
40 |
+ self.settings["catalyst_use"].append("bindist") |
41 |
|
42 |
def set_stage_path(self): |
43 |
self.settings["stage_path"]=normpath(self.settings["chroot_path"]) |
44 |
diff --git a/catalyst/targets/grp.py b/catalyst/targets/grp.py |
45 |
index 049bc55..d47654d 100644 |
46 |
--- a/catalyst/targets/grp.py |
47 |
+++ b/catalyst/targets/grp.py |
48 |
@@ -52,13 +52,6 @@ class grp(StageBase): |
49 |
raise CatalystError("GRP build aborting due to error.", |
50 |
print_traceback=True) |
51 |
|
52 |
- def set_use(self): |
53 |
- StageBase.set_use(self) |
54 |
- if "use" in self.settings: |
55 |
- self.settings["use"].append("bindist") |
56 |
- else: |
57 |
- self.settings["use"]=["bindist"] |
58 |
- |
59 |
def set_mounts(self): |
60 |
self.mounts.append("/tmp/grp") |
61 |
self.mountmap["/tmp/grp"]=self.settings["target_path"] |
62 |
diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py |
63 |
index eea4312..659eb43 100644 |
64 |
--- a/catalyst/targets/livecd_stage1.py |
65 |
+++ b/catalyst/targets/livecd_stage1.py |
66 |
@@ -29,16 +29,12 @@ class livecd_stage1(StageBase): |
67 |
def set_spec_prefix(self): |
68 |
self.settings["spec_prefix"]="livecd" |
69 |
|
70 |
- def set_use(self): |
71 |
- StageBase.set_use(self) |
72 |
- if "use" in self.settings: |
73 |
- self.settings["use"].append("livecd") |
74 |
- if "BINDIST" in self.settings: |
75 |
- self.settings["use"].append("bindist") |
76 |
+ def set_catalyst_use(self): |
77 |
+ StageBase.set_catalyst_use(self) |
78 |
+ if "catalyst_use" in self.settings: |
79 |
+ self.settings["catalyst_use"].append("livecd") |
80 |
else: |
81 |
- self.settings["use"]=["livecd"] |
82 |
- if "BINDIST" in self.settings: |
83 |
- self.settings["use"].append("bindist") |
84 |
+ self.settings["catalyst_use"]=["livecd"] |
85 |
|
86 |
def set_packages(self): |
87 |
StageBase.set_packages(self) |
88 |
diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh |
89 |
index fbda84b..291614b 100755 |
90 |
--- a/targets/stage1/stage1-chroot.sh |
91 |
+++ b/targets/stage1/stage1-chroot.sh |
92 |
@@ -53,7 +53,8 @@ sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf} |
93 |
|
94 |
# Now, we install our packages |
95 |
if [ -e ${clst_make_conf} ]; then |
96 |
- echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf} |
97 |
+ echo "CATALYST_USE=\"-* build ${clst_CATALYST_USE}\"" >> ${clst_make_conf} |
98 |
+ echo "USE=\"${CATALYST_USE} ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf} |
99 |
for useexpand in ${clst_HOSTUSEEXPAND}; do |
100 |
x="clst_${useexpand}" |
101 |
echo "${useexpand}=\"${!x}\"" \ |
102 |
@@ -62,8 +63,12 @@ if [ -e ${clst_make_conf} ]; then |
103 |
fi |
104 |
|
105 |
run_merge "--oneshot ${clst_buildpkgs}" |
106 |
-sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \ |
107 |
+sed -i "/USE=\"/s/\${CATALYST_USE} //" \ |
108 |
${clst_make_conf} |
109 |
+sed -i "/CATALYST_USE/d" \ |
110 |
+ ${clist_make_conf} |
111 |
+ |
112 |
+# Why are we removing these? Don't we need them for final make.conf? |
113 |
for useexpand in ${clst_HOSTUSEEXPAND}; do |
114 |
x="clst_${useexpand}" |
115 |
sed -i "/${useexpand}=\"${!x}\"/d" \ |
116 |
diff --git a/targets/stage2/stage2-chroot.sh b/targets/stage2/stage2-chroot.sh |
117 |
index 38dfea3..1667ffd 100755 |
118 |
--- a/targets/stage2/stage2-chroot.sh |
119 |
+++ b/targets/stage2/stage2-chroot.sh |
120 |
@@ -5,21 +5,14 @@ source /tmp/chroot-functions.sh |
121 |
# Setup the environment |
122 |
export FEATURES="${clst_myfeatures} nodoc noman noinfo -news" |
123 |
|
124 |
-# Set bindist USE flag if clst_BINDIST is set |
125 |
-# The bindist functions have been taken from support/chroot-functions.sh |
126 |
-if [ -e "${clst_make_conf}" ] && [ -n "${clst_BINDIST}" ]; then |
127 |
- if grep -q ^USE "${clst_make_conf}"; then |
128 |
- echo "USE=\"\${USE} bindist\"" >> "${clst_make_conf}" |
129 |
- else |
130 |
- echo "USE=\"bindist\"" >> "${clst_make_conf}" |
131 |
- fi |
132 |
-fi |
133 |
- |
134 |
- |
135 |
+echo "CATALYST_USE=\"${clst_CATALYST_USE}\"" >> ${clst_make_conf} |
136 |
+sed -i -e "/USE=\"/s/\${CATALYST_USE} " ${clst_make_conf} |
137 |
|
138 |
## START BUILD |
139 |
${clst_repo_basedir}/${clst_repo_name}/scripts/bootstrap.sh ${bootstrap_opts} || exit 1 |
140 |
|
141 |
# Clean-up USE again |
142 |
-sed -i "/USE=\"\${USE} bindist\"/d" "${clst_make_conf}" |
143 |
-sed -i "/USE=\"bindist\"/d" "${clst_make_conf}" |
144 |
+sed -i "/USE=\"/s/\${CATALYST_USE} //" \ |
145 |
+ ${clst_make_conf} |
146 |
+sed -i "/CATALYST_USE/d" \ |
147 |
+ ${clist_make_conf} |
148 |
diff --git a/targets/stage3/stage3-chroot.sh b/targets/stage3/stage3-chroot.sh |
149 |
index 6cf9106..d010d5e 100755 |
150 |
--- a/targets/stage3/stage3-chroot.sh |
151 |
+++ b/targets/stage3/stage3-chroot.sh |
152 |
@@ -2,7 +2,17 @@ |
153 |
|
154 |
source /tmp/chroot-functions.sh |
155 |
|
156 |
+echo "CATALYST_USE=\"${clst_CATALYST_USE}\"" >> ${clst_make_conf} |
157 |
+sed -i -e "/USE=\"/s/\${CATALYST_USE} " ${clst_make_conf} |
158 |
+ |
159 |
## START BUILD |
160 |
setup_pkgmgr |
161 |
|
162 |
run_merge "-e @system" |
163 |
+ |
164 |
+# Clean-up USE again |
165 |
+sed -i "/USE=\"/s/\${CATALYST_USE} //" \ |
166 |
+ ${clst_make_conf} |
167 |
+sed -i "/CATALYST_USE/d" \ |
168 |
+ ${clist_make_conf} |
169 |
+ |
170 |
-- |
171 |
2.8.2 |