Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:catalyst_use commit in: targets/support/, targets/stage2/, targets/stage1/, catalyst/base/, ...
Date: Mon, 06 Feb 2017 03:38:38
Message-Id: 1486347122.eef609335a51e9a04038e91a34ee694a866ec2ca.dolsen@gentoo
1 commit: eef609335a51e9a04038e91a34ee694a866ec2ca
2 Author: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 4 21:43:01 2017 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 6 02:12:02 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=eef60933
7
8 Add initial support for portage_prefix.
9
10 Signed-off-by: Jorge Manuel B. S. Vicetto (jmbsvicetto) <jmbsvicetto <AT> gentoo.org>
11
12 catalyst/base/stagebase.py | 10 ++++++++--
13 targets/stage1/stage1-controller.sh | 3 +++
14 targets/stage2/stage2-controller.sh | 3 +++
15 targets/stage3/stage3-controller.sh | 3 +++
16 targets/support/functions.sh | 16 ++++++++++++++++
17 5 files changed, 33 insertions(+), 2 deletions(-)
18
19 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
20 index 8d00fa1..2fd8925 100644
21 --- a/catalyst/base/stagebase.py
22 +++ b/catalyst/base/stagebase.py
23 @@ -36,8 +36,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
24 "rel_type","profile","snapshot","source_subpath"])
25
26 self.valid_values.extend(["version_stamp","target","subarch",
27 - "rel_type","profile","snapshot","source_subpath","portage_confdir",
28 - "cflags","cxxflags","fcflags","fflags","ldflags","asflags","cbuild","hostuse","portage_overlay",
29 + "rel_type","profile","snapshot","source_subpath",
30 + "portage_confdir","portage_prefix","portage_overlay",
31 + "cflags","cxxflags","fcflags","fflags","ldflags","asflags",
32 + "cbuild","hostuse","catalyst_use",
33 "distcc_hosts","makeopts","pkgcache_path","kerncache_path",
34 "compression_mode", "decompression_mode"])
35
36 @@ -601,6 +603,10 @@ class StageBase(TargetBase, ClearBase, GenBase):
37 log.info('portage_overlay directories are set to: %s',
38 ' '.join(self.settings['portage_overlay']))
39
40 +# def set_portage_prefix(self):
41 +# if "portage_prefix" in self.settings:
42 +# self.settings["portage_prefix"]=
43 +
44 def set_overlay(self):
45 if self.settings["spec_prefix"]+"/overlay" in self.settings:
46 if isinstance(self.settings[self.settings['spec_prefix']+'/overlay'], str):
47
48 diff --git a/targets/stage1/stage1-controller.sh b/targets/stage1/stage1-controller.sh
49 index ac813de..798d679 100755
50 --- a/targets/stage1/stage1-controller.sh
51 +++ b/targets/stage1/stage1-controller.sh
52 @@ -16,6 +16,8 @@ case "$1" in
53 # Setup make.conf and make.profile link in "ROOT in chroot":
54 copy_to_chroot "${clst_chroot_path}${clst_make_conf}" "${clst_root_path}${clst_port_conf}"
55
56 + prepare_portage
57 +
58 # Enter chroot, execute our build script
59 exec_in_chroot \
60 "${clst_shdir}/${clst_target}/${clst_target}-chroot.sh" \
61 @@ -23,6 +25,7 @@ case "$1" in
62 ;;
63
64 preclean)
65 + clear_portage
66 exec_in_chroot "${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh" || exit 1
67 ;;
68
69
70 diff --git a/targets/stage2/stage2-controller.sh b/targets/stage2/stage2-controller.sh
71 index 25e5120..41bd43b 100755
72 --- a/targets/stage2/stage2-controller.sh
73 +++ b/targets/stage2/stage2-controller.sh
74 @@ -10,6 +10,8 @@ case $1 in
75 ;;
76
77 run)
78 + prepare_portage
79 +
80 shift
81 export clst_packages="$*"
82 exec_in_chroot \
83 @@ -17,6 +19,7 @@ case $1 in
84 ;;
85
86 preclean)
87 + clear_portage
88 exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh
89 ;;
90
91
92 diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh
93 index df1479e..eaa40b3 100755
94 --- a/targets/stage3/stage3-controller.sh
95 +++ b/targets/stage3/stage3-controller.sh
96 @@ -10,12 +10,15 @@ case $1 in
97 ;;
98
99 run)
100 + prepare_portage
101 +
102 shift
103 export clst_packages="$*"
104 exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-chroot.sh
105 ;;
106
107 preclean)
108 + clear_portage
109 exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh
110 ;;
111
112
113 diff --git a/targets/support/functions.sh b/targets/support/functions.sh
114 index cca2fd8..eded8b7 100755
115 --- a/targets/support/functions.sh
116 +++ b/targets/support/functions.sh
117 @@ -16,6 +16,22 @@ delete_from_chroot(){
118 fi
119 }
120
121 +prepare_portage() {
122 +
123 + echo "CATALYST_USE=\"${clst_CATALYST_USE}\"" >> ${clst_make_conf}
124 + sed -i -e "/USE=\"/s/\${CATALYST_USE} " ${clst_make_conf}
125 +}
126 +
127 +clear_portage() {
128 + # Clean-up USE again
129 + sed -i "/USE=\"/s/\${CATALYST_USE} //" ${clst_make_conf}
130 + sed -i "/CATALYST_USE/d" ${clist_make_conf}
131 +
132 + if [ -n "${clst_portage_prefix}" ]; then
133 + rm -R "${clst_chroot_path}/etc/portage/${clst_portage_prefix}"
134 + fi
135 +}
136 +
137 exec_in_chroot(){
138 # Takes the full path to the source file as its argument
139 # copies the file to the /tmp directory of the chroot