1 |
On 05 Jun 2016 20:00, Jorge Manuel B. S. Vicetto wrote: |
2 |
> Subject: [PATCH] Fix USE not "sticking" between stage runs and allow set USE |
3 |
> flags just for building - CATALYST_USE. This should fix bug 473332 and avoid |
4 |
> the current issue of catalyst-3 stages being built without BINDIST. These |
5 |
> changes don't allow setting USE flags for stage 1, |
6 |
> 2 and 3 and don't touch other stages (TODO). |
7 |
|
8 |
looks like the commit message was crammed into one line. when making |
9 |
a commit in git, it should look something like: |
10 |
================== |
11 |
some short summary of the issue |
12 |
|
13 |
A longer explanation down here with multiple sentences. |
14 |
================== |
15 |
|
16 |
> --- a/catalyst/base/stagebase.py |
17 |
> +++ b/catalyst/base/stagebase.py |
18 |
> @@ -173,6 +173,7 @@ class StageBase(TargetBase, ClearBase, GenBase): |
19 |
> self.set_controller_file() |
20 |
> self.set_default_action_sequence() |
21 |
> self.set_use() |
22 |
> + self.set_catalyst_use() |
23 |
|
24 |
looks like leading whitespace is broken here, or at least weird. |
25 |
maybe use `git send-email` instead ? |
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 |
|
33 |
create a variable named "key" to hold this string so you don't have to |
34 |
copy & paste it three times. |
35 |
|
36 |
> + if "catalyst_use" not in self.settings: |
37 |
> + self.settings["catalyst_use"]="" |
38 |
> + if isinstance(self.settings['catalyst_use'], str): |
39 |
> + self.settings["catalyst_use"]=self.settings["catalyst_use"].split() |
40 |
|
41 |
there should be spaces around the assignment. |
42 |
self.settings['catalyst_use'] = '' |
43 |
|
44 |
the code base might not do this everywhere, but it's moving that way |
45 |
|
46 |
|
47 |
> --- a/targets/stage1/stage1-chroot.sh |
48 |
> +++ b/targets/stage1/stage1-chroot.sh |
49 |
> @@ -53,7 +53,8 @@ sed -i "/USE=\"${USE} -build\"/d" ${clst_make_conf} |
50 |
> |
51 |
> # Now, we install our packages |
52 |
> if [ -e ${clst_make_conf} ]; then |
53 |
> - echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf} |
54 |
> + echo "CATALYST_USE=\"-* build ${clst_CATALYST_USE}\"" >> ${clst_make_conf} |
55 |
> + echo "USE=\"${CATALYST_USE} ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" >> ${clst_make_conf} |
56 |
> for useexpand in ${clst_HOSTUSEEXPAND}; do |
57 |
> x="clst_${useexpand}" |
58 |
> echo "${useexpand}=\"${!x}\"" \ |
59 |
> @@ -62,8 +63,12 @@ if [ -e ${clst_make_conf} ]; then |
60 |
> fi |
61 |
> |
62 |
> run_merge "--oneshot ${clst_buildpkgs}" |
63 |
> -sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \ |
64 |
> +sed -i "/USE=\"/s/\${CATALYST_USE} //" \ |
65 |
> ${clst_make_conf} |
66 |
> +sed -i "/CATALYST_USE/d" \ |
67 |
> + ${clist_make_conf} |
68 |
|
69 |
rather than run sed twice on the same file, use the -e option to |
70 |
specify multiple expressions |
71 |
|
72 |
that said, rather than mess with CATALYST_USE, how about just white |
73 |
it out ? |
74 |
sed -i \ |
75 |
-e '/^CATALYST_USE=/s:=.*:="":' \ |
76 |
${clist_make_conf} |
77 |
|
78 |
> +# Why are we removing these? Don't we need them for final make.conf? |
79 |
|
80 |
not a big fan of doing this ... |
81 |
-mike |