Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/base/, catalyst/targets/, catalyst/, targets/stage1/, targets/support/
Date: Sun, 30 Aug 2015 02:09:35
Message-Id: 1440900545.6d640c0b9681b81be13ed11c52f1f037abc0d875.dolsen@gentoo
1 commit: 6d640c0b9681b81be13ed11c52f1f037abc0d875
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 24 20:33:18 2013 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 30 02:09:05 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=6d640c0b
7
8 Migrate hardcoded /etc/portage paths
9
10 Create "port_conf" default.
11 Migrate all references to /etc/portage to the config's default.
12 Migrate all make.conf paths to the config'd default.
13
14 catalyst/base/stagebase.py | 15 +++++++++------
15 catalyst/defaults.py | 3 ++-
16 catalyst/targets/stage1.py | 2 +-
17 targets/stage1/stage1-chroot.sh | 18 +++++++++---------
18 targets/stage1/stage1-controller.sh | 6 +++---
19 targets/support/chroot-functions.sh | 16 ++++++++--------
20 targets/support/kmerge.sh | 10 +++++-----
21 targets/support/livecdfs-update.sh | 12 ++++++------
22 8 files changed, 43 insertions(+), 39 deletions(-)
23
24 diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
25 index 644bd7c..4c7f029 100644
26 --- a/catalyst/base/stagebase.py
27 +++ b/catalyst/base/stagebase.py
28 @@ -875,12 +875,15 @@ class StageBase(TargetBase, ClearBase, GenBase):
29 # TODO: zmedico and I discussed making this a directory and pushing
30 # in a parent file, as well as other user-specified configuration.
31 print "Configuring profile link..."
32 - cmd("rm -f "+self.settings["chroot_path"]+"/etc/portage/make.profile",\
33 - "Error zapping profile link",env=self.env)
34 - cmd("mkdir -p "+self.settings["chroot_path"]+"/etc/portage/")
35 - cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/" + \
36 - self.settings["target_profile"]+" "+\
37 - self.settings["chroot_path"]+"/etc/portage/make.profile",\
38 + cmd("rm -f " + self.settings["chroot_path"] +
39 + self.settings["port_conf"] + "/make.profile",
40 + "Error zapping profile link",env=self.env)
41 + cmd("mkdir -p " + self.settings["chroot_path"] +
42 + self.settings["port_conf"])
43 + cmd("ln -sf ../.." + self.settings["portdir"] + "/profiles/" +
44 + self.settings["target_profile"] + " " +
45 + self.settings["chroot_path"] +
46 + self.settings["port_conf"] + "/make.profile",
47 "Error creating profile link",env=self.env)
48 self.resume.enable("config_profile_link")
49
50
51 diff --git a/catalyst/defaults.py b/catalyst/defaults.py
52 index 5cb5e3f..975e55b 100644
53 --- a/catalyst/defaults.py
54 +++ b/catalyst/defaults.py
55 @@ -26,7 +26,8 @@ confdefaults={
56 "hash_function": "crc32",
57 "icecream": "/var/cache/icecream",
58 "local_overlay": "/usr/local/portage",
59 - "make_conf": "/etc/portage/make.conf",
60 + "port_conf": "/etc/portage",
61 + "make_conf": "%(port_conf)s/make.conf",
62 "options": set(),
63 "packagedir": "/usr/portage/packages",
64 "portdir": "/usr/portage",
65
66 diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py
67 index 3d3b9e9..d5cc298 100644
68 --- a/catalyst/targets/stage1.py
69 +++ b/catalyst/targets/stage1.py
70 @@ -32,7 +32,7 @@ class stage1(StageBase):
71 def set_cleanables(self):
72 StageBase.set_cleanables(self)
73 self.settings["cleanables"].extend([\
74 - "/usr/share/zoneinfo", "/etc/portage/package*"])
75 + "/usr/share/zoneinfo", self.settings["port_conf"] + "/package*"])
76
77 # XXX: How do these override_foo() functions differ from the ones in StageBase and why aren't they in stage3_target?
78
79
80 diff --git a/targets/stage1/stage1-chroot.sh b/targets/stage1/stage1-chroot.sh
81 index 63aa563..4afc8fe 100755
82 --- a/targets/stage1/stage1-chroot.sh
83 +++ b/targets/stage1/stage1-chroot.sh
84 @@ -16,7 +16,7 @@ if [ -z "${clst_buildpkgs}" ]
85 then
86 echo "Your profile seems to be broken."
87 echo "Could not build a list of build packages."
88 - echo "Double check your /etc/portage/make.profile link and the 'packages' files."
89 + echo "Double check your ${clst_port_conf}/make.profile link and the 'packages' files."
90 exit 1
91 fi
92
93 @@ -47,27 +47,27 @@ make_destpath /tmp/stage1root
94
95 ## START BUILD
96 # First, we drop in a known-good baselayout
97 -[ -e /etc/portage/make.conf ] && \
98 - echo 'USE="${USE} -build"' >> /etc/portage/make.conf
99 +[ -e ${clst_make_conf} ] && \
100 + echo 'USE="${USE} -build"' >> ${clst_make_conf}
101 run_merge "--oneshot --nodeps sys-apps/baselayout"
102
103 -sed -i '/USE="${USE} -build"/d' /etc/portage/make.conf
104 +sed -i '/USE="${USE} -build"/d' ${clst_make_conf}
105
106 # Now, we install our packages
107 -if [ -e /etc/portage/make.conf ]; then
108 +if [ -e ${clst_make_conf} ] && \
109 echo "USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"" \
110 - >> /etc/portage/make.conf
111 + >> ${clst_make_conf}
112 for useexpand in ${clst_HOSTUSEEXPAND}; do
113 x="clst_${useexpand}"
114 echo "${useexpand}=\"${!x}\"" \
115 - >> /etc/portage/make.conf
116 + >> ${clst_make_conf}
117 done
118 fi
119 run_merge "--oneshot ${clst_buildpkgs}"
120 sed -i "/USE=\"-* build ${BOOTSTRAP_USE} ${clst_HOSTUSE}\"/d" \
121 - /etc/portage/make.conf
122 + ${clst_make_conf}
123 for useexpand in ${clst_HOSTUSEEXPAND}; do
124 x="clst_${useexpand}"
125 sed -i "/${useexpand}=\"${!x}\"/d" \
126 - /etc/portage/make.conf
127 + ${clst_make_conf}
128 done
129
130 diff --git a/targets/stage1/stage1-controller.sh b/targets/stage1/stage1-controller.sh
131 index 09a121d..0f44e97 100755
132 --- a/targets/stage1/stage1-controller.sh
133 +++ b/targets/stage1/stage1-controller.sh
134 @@ -10,11 +10,11 @@ case $1 in
135 cp ${clst_shdir}/stage1/build.py ${clst_chroot_path}/tmp
136
137 # Setup "ROOT in chroot" dir
138 - install -d ${clst_chroot_path}${clst_root_path}/etc
139 - install -d ${clst_chroot_path}${clst_root_path}/etc/portage
140 + install -d ${clst_chroot_path}/${clst_root_path}/etc
141 + install -d ${clst_chroot_path}/${clst_root_path}${clst_port_conf}
142
143 # Setup make.conf and make.profile link in "ROOT in chroot":
144 - copy_to_chroot ${clst_chroot_path}/etc/portage/make.conf ${clst_root_path}/etc/portage
145 + copy_to_chroot ${clst_chroot_path}${clst_make_conf} ${clst_root_path}${clst_port_conf}
146
147 # Enter chroot, execute our build script
148 exec_in_chroot \
149
150 diff --git a/targets/support/chroot-functions.sh b/targets/support/chroot-functions.sh
151 index 3b7f77b..7184984 100755
152 --- a/targets/support/chroot-functions.sh
153 +++ b/targets/support/chroot-functions.sh
154 @@ -75,8 +75,8 @@ setup_myfeatures(){
155 then
156 export clst_myfeatures="${clst_myfeatures} distcc"
157 export DISTCC_HOSTS="${clst_distcc_hosts}"
158 - [ -e /etc/portage/make.conf ] && \
159 - echo 'USE="${USE} -avahi -gtk -gnome"' >> /etc/portage/make.conf
160 + [ -e ${clst_make_conf} ] && \
161 + echo 'USE="${USE} -avahi -gtk -gnome"' >> ${clst_make_conf}
162 # We install distcc to / on stage1, then use --noreplace, so we need to
163 # have some way to check if we need to reinstall distcc without being
164 # able to rely on USE, so we check for the distcc user and force a
165 @@ -87,7 +87,7 @@ setup_myfeatures(){
166 else
167 clst_root_path=/ run_merge --oneshot --noreplace sys-devel/distcc || exit 1
168 fi
169 - sed -i '/USE="${USE} -avahi -gtk -gnome"/d' /etc/portage/make.conf
170 + sed -i '/USE="${USE} -avahi -gtk -gnome"/d' ${clst_make_conf}
171 mkdir -p /etc/distcc
172 echo "${clst_distcc_hosts}" > /etc/distcc/hosts
173
174 @@ -173,9 +173,9 @@ setup_pkgmgr(){
175 # Use --newuse to make sure it rebuilds with any changed use flags.
176 if [ -n "$1" ];then
177 echo "Adding USE='${USE} $1' to make.conf for portage build"
178 - [ -e /etc/portage/make.conf ] && echo 'USE="${USE} $1"' >> /etc/portage/make.conf
179 + [ -e ${clst_make_conf} ] && echo 'USE="${USE} $1"' >> ${clst_make_conf}
180 run_merge --oneshot --update --newuse sys-apps/portage
181 - sed -i '/USE="${USE} $1"/d' /etc/portage/make.conf
182 + sed -i '/USE="${USE} $1"/d' ${clst_make_conf}
183 else
184 echo "Updating portage with USE='${USE}'"
185 run_merge --oneshot --update --newuse sys-apps/portage
186 @@ -245,11 +245,11 @@ die() {
187
188 make_destpath() {
189 # ROOT is / by default, so remove any ROOT= settings from make.conf
190 - sed -i '/ROOT=/d' /etc/portage/make.conf
191 + sed -i '/ROOT=/d' ${clst_make_conf}
192 export ROOT=/
193 if [ "${1}" != "/" -a -n "${1}" ]
194 then
195 - echo "ROOT=\"${1}\"" >> /etc/portage/make.conf
196 + echo "ROOT=\"${1}\"" >> ${clst_make_conf}
197 export ROOT=${1}
198 fi
199 if [ ! -d ${ROOT} ]
200 @@ -300,7 +300,7 @@ show_debug() {
201 emerge --info
202 # TODO: grab our entire env
203 # <zmedico> to get see the ebuild env you can do something like:
204 - # `set > /tmp/env_dump.${EBUILD_PHASE}` inside /etc/portage/bashrc
205 + # `set > /tmp/env_dump.${EBUILD_PHASE}` inside ${clst_port_conf}/bashrc
206 # XXX: Also, portageq does *not* source profile.bashrc at any time.
207 echo
208 echo "BOOTSTRAP_USE: $(portageq envvar BOOTSTRAP_USE)"
209
210 diff --git a/targets/support/kmerge.sh b/targets/support/kmerge.sh
211 index 03869c3..b72eeb6 100755
212 --- a/targets/support/kmerge.sh
213 +++ b/targets/support/kmerge.sh
214 @@ -209,12 +209,12 @@ then
215
216 if [ ! -e ${clst_port_conf}/profile/package.provided ]
217 then
218 - mkdir -p /etc/portage/profile
219 - echo "${KERNELVERSION}" > /etc/portage/profile/package.provided
220 + mkdir -p ${clst_port_conf}/profile
221 + echo "${KERNELVERSION}" > ${clst_port_conf}/profile/package.provided
222 else
223 - if ( ! grep -q "^${KERNELVERSION}\$" /etc/portage/profile/package.provided )
224 + if ( ! grep -q "^${KERNELVERSION}\$" ${clst_port_conf}/profile/package.provided )
225 then
226 - echo "${KERNELVERSION}" >> /etc/portage/profile/package.provided
227 + echo "${KERNELVERSION}" >> ${clst_port_conf}/profile/package.provided
228 fi
229 fi
230
231 @@ -271,7 +271,7 @@ make_destpath
232
233
234 build_kernel
235 -sed -i "/USE=\"\${USE} ${clst_kernel_use} \"/d" /etc/portage/make.conf
236 +sed -i "/USE=\"\${USE} ${clst_kernel_use} \"/d" ${clst_make_conf}
237 # grep out the kernel version so that we can do our modules magic
238 VER=`grep ^VERSION\ \= /usr/src/linux/Makefile | awk '{ print $3 };'`
239 PAT=`grep ^PATCHLEVEL\ \= /usr/src/linux/Makefile | awk '{ print $3 };'`
240
241 diff --git a/targets/support/livecdfs-update.sh b/targets/support/livecdfs-update.sh
242 index aeae88c..12f8293 100755
243 --- a/targets/support/livecdfs-update.sh
244 +++ b/targets/support/livecdfs-update.sh
245 @@ -105,12 +105,12 @@ fi
246
247 # Tweak the livecd make.conf so that users know not to edit it
248 # http://bugs.gentoo.org/show_bug.cgi?id=144647
249 -mv /etc/portage/make.conf /etc/portage/make.conf.old
250 -echo "####################################################" >> /etc/portage/make.conf
251 -echo "## ATTENTION: THIS IS THE MAKE.CONF ON THE LIVECD ##" >> /etc/portage/make.conf
252 -echo "## PLEASE EDIT /mnt/gentoo/etc/portage/make.conf INSTEAD ##" >> /etc/portage/make.conf
253 -echo "####################################################" >> /etc/portage/make.conf
254 -cat /etc/portage/make.conf.old >> /etc/portage/make.conf
255 +mv ${clst_make_conf} ${clst_make_conf}.old
256 +echo "####################################################" >> ${clst_make_conf}
257 +echo "## ATTENTION: THIS IS THE MAKE.CONF ON THE LIVECD ##" >> ${clst_make_conf}
258 +echo "## PLEASE EDIT /mnt/gentoo${clst_make_conf} INSTEAD ##" >> ${clst_make_conf}
259 +echo "####################################################" >> ${clst_make_conf}
260 +cat ${clst_make_conf}.old >> ${clst_make_conf}
261
262 # devfs tweaks
263 [ -e /etc/devfsd.conf ] && sed -i '/dev-state/ s:^:#:' /etc/devfsd.conf