Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Thu, 30 Jun 2022 12:59:09
Message-Id: 1656593907.577ce5b8552f84efe76c3e5e20abb5453df4a909.sam@gentoo
1 commit: 577ce5b8552f84efe76c3e5e20abb5453df4a909
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 30 12:58:27 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 12:58:27 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=577ce5b8
7
8 bootstrap-prefix.sh: style cleanups
9
10 Signed-off-by: Sam James <sam <AT> gentoo.org>
11
12 scripts/bootstrap-prefix.sh | 55 ++++++++++++++++++++++++---------------------
13 1 file changed, 29 insertions(+), 26 deletions(-)
14
15 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
16 index bafcf0c267..d170bf8706 100755
17 --- a/scripts/bootstrap-prefix.sh
18 +++ b/scripts/bootstrap-prefix.sh
19 @@ -40,7 +40,7 @@ emake() {
20 [[ $* == *install* ]] \
21 && estatus "stage1: installing ${PWD##*/}" \
22 || estatus "stage1: building ${PWD##*/}"
23 - v $MAKE ${MAKEOPTS} "$@" || return 1
24 + v ${MAKE} ${MAKEOPTS} "$@" || return 1
25 }
26
27 efetch() {
28 @@ -80,7 +80,7 @@ efetch() {
29 estatus "stage1: fetching ${1##*/}"
30 pushd "${DISTDIR}" > /dev/null
31
32 - # try for mirrors first, fall back to distfiles, then try given location
33 + # Try for mirrors first, fall back to distfiles, then try given location
34 local locs=( )
35 local loc
36 for loc in ${GENTOO_MIRRORS} ${DISTFILES_G_O} ${DISTFILES_PFX}; do
37 @@ -299,7 +299,7 @@ configure_toolchain() {
38
39 bootstrap_setup() {
40 local profile=""
41 - einfo "setting up some guessed defaults"
42 + einfo "Setting up some guessed defaults"
43
44 # 2.6.32.1 -> 2*256^3 + 6*256^2 + 32 * 256 + 1 = 33955841
45 kver() { uname -r|cut -d\- -f1|awk -F. '{for (i=1; i<=NF; i++){s+=lshift($i,(4-i)*8)};print s}'; }
46 @@ -538,7 +538,7 @@ bootstrap_setup() {
47 # Use package.use to disable in the portage tree to be shared between
48 # stage2 and stage3. The hack will be undone during tree sync in stage3.
49 cat >> "${ROOT}"/etc/portage/make.profile/package.use <<-EOF
50 - # disable bootstrapping libcxx* with libunwind
51 + # Disable bootstrapping libcxx* with libunwind
52 sys-libs/libcxxabi -libunwind
53 sys-libs/libcxx -libunwind
54 # Most binary Linux distributions seem to fancy toolchains that
55 @@ -951,12 +951,12 @@ bootstrap_gnu() {
56 [[ ${PN} == "bash" && ${CHOST} != *-cygwin* ]] \
57 && myconf="${myconf} --disable-readline"
58
59 - # on e.g. musl systems bash will crash with a malloc error if we use
60 + # On e.g. musl systems bash will crash with a malloc error if we use
61 # bash' internal malloc, so disable it during it this stage
62 [[ ${PN} == "bash" ]] && \
63 myconf="${myconf} --without-bash-malloc"
64
65 - # ensure we don't read system-wide shell initialisation, it may
66 + # Ensure we don't read system-wide shell initialisation, it may
67 # contain cruft, bug #650284
68 [[ ${PN} == "bash" ]] && \
69 export CPPFLAGS="${CPPFLAGS} \
70 @@ -1131,7 +1131,7 @@ bootstrap_python() {
71
72 local myconf=""
73
74 - case $CHOST in
75 + case ${CHOST} in
76 (x86_64-*-*|sparcv9-*-*)
77 export CFLAGS="-m64"
78 ;;
79 @@ -1140,7 +1140,7 @@ bootstrap_python() {
80 ;;
81 esac
82
83 - case $CHOST in
84 + case ${CHOST} in
85 *-*-cygwin*)
86 # --disable-shared would link modules against "python.exe"
87 # so renaming to "pythonX.Y.exe" will break them.
88 @@ -1167,7 +1167,7 @@ bootstrap_python() {
89 export CPPFLAGS="-I${ROOT}/tmp/usr/include"
90 export LDFLAGS="${CFLAGS} -L${ROOT}/tmp/usr/lib"
91 # set correct flags for runtime for ELF platforms
92 - case $CHOST in
93 + case ${CHOST} in
94 *-linux*)
95 # GNU ld
96 LDFLAGS="${LDFLAGS} -Wl,-rpath,${ROOT}/tmp/usr/lib ${libdir}"
97 @@ -1193,9 +1193,9 @@ bootstrap_python() {
98
99 einfo "Compiling ${A%.tar.*}"
100
101 - # some ancient versions of hg fail with "hg id -i", so help
102 + # - Some ancient versions of hg fail with "hg id -i", so help
103 # configure to not find them using HAS_HG
104 - # do not find libffi via pkg-config using PKG_CONFIG
105 + # - Do not find libffi via pkg-config using PKG_CONFIG
106 HAS_HG=no \
107 PKG_CONFIG= \
108 econf \
109 @@ -1272,7 +1272,7 @@ bootstrap_cmake() {
110 }
111
112 bootstrap_zlib_core() {
113 - # use 1.2.8 by default, current bootstrap guides
114 + # Use 1.2.8 by default, current bootstrap guides
115 PV="${1:-1.2.8}"
116 A=zlib-${PV}.tar.gz
117
118 @@ -1495,8 +1495,8 @@ bootstrap_stage1() {
119 # bits-size of the compiler, which needs not to match what we're
120 # bootstrapping for. This is no problem since they're just tools,
121 # for which it really doesn't matter how they run, as long AS they
122 - # run. For libraries, this is different, since they are relied on
123 - # by packages we emerge lateron.
124 + # run. For libraries, this is different, since they are relied upon
125 + # by packages we emerge later on.
126 # Changing this to compile the tools for the bits the bootstrap is
127 # for, is a BAD idea, since we're extremely fragile here, so
128 # whatever the native toolchain is here, is what in general works
129 @@ -1513,7 +1513,7 @@ bootstrap_stage1() {
130 configure_toolchain
131 export CC CXX
132
133 - # run all bootstrap_* commands in a subshell since the targets
134 + # Run all bootstrap_* commands in a subshell since the targets
135 # frequently pollute the environment using exports which affect
136 # packages following (e.g. zlib builds 64-bits)
137
138 @@ -1931,7 +1931,7 @@ bootstrap_stage2() {
139 done
140
141 if [[ ${compiler_type} == clang ]] ; then
142 - # we use Clang as our toolchain compiler, so we need to make
143 + # We use Clang as our toolchain compiler, so we need to make
144 # sure we actually use it
145 mkdir -p -- "${MAKE_CONF_DIR}"
146 {
147 @@ -1944,6 +1944,7 @@ bootstrap_stage2() {
148 echo "BUILD_CC=${CHOST}-clang"
149 echo "BUILD_CXX=${CHOST}-clang++"
150 } >> "${MAKE_CONF_DIR}/0100_bootstrap_prefix_clang.conf"
151 +
152 # llvm won't setup symlinks to CHOST-clang here because
153 # we're in a cross-ish situation (at least according to
154 # multilib.eclass -- can't blame it at this point really)
155 @@ -1988,7 +1989,7 @@ bootstrap_stage3() {
156 fi
157 fi
158
159 - # if we resume this stage and python-exec was installed already in
160 + # If we resume this stage and python-exec was installed already in
161 # tmp, we basically made the system unusable, so remove python-exec
162 # here so we can use the python in tmp
163 for pef in python{,3} python{,3}-config ; do
164 @@ -2170,15 +2171,15 @@ bootstrap_stage3() {
165 # in addition, avoid collisions
166 rm -Rf "${ROOT}"/tmp/usr/lib/python${PYTHONMAJMIN}/site-packages/clang
167
168 - # try to get ourself out of the mud, bug #575324
169 + # Try to get ourself out of the mud, bug #575324
170 EXTRA_ECONF="--disable-compiler-version-checks $(rapx '--disable-lto --disable-bootstrap')" \
171 GCC_MAKE_TARGET=$(rapx all) \
172 MYCMAKEARGS="-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV=OFF" \
173 PYTHON_COMPAT_OVERRIDE=python${PYTHONMAJMIN} \
174 pre_emerge_pkgs --nodeps ${compiler} || return 1
175 - # undo libgcc_s.so path of stage2
176
177 - # now we have the compiler right there
178 + # Undo libgcc_s.so path of stage2
179 + # Now we have the compiler right there
180 unset CXX CPPFLAGS LDFLAGS
181
182 rm -f "${ROOT}"/etc/ld.so.conf.d/stage2.conf
183 @@ -2192,10 +2193,11 @@ bootstrap_stage3() {
184 rm -f "${ROOT}"/bin/sh
185 ln -s bash "${ROOT}"/bin/sh
186 fi
187 - # start using apps from new target
188 +
189 + # Start using apps from new target
190 export PREROOTPATH="${ROOT}/usr/bin:${ROOT}/bin"
191
192 - # get a sane bash, overwriting tmp symlinks
193 + # Get a sane bash, overwriting tmp symlinks
194 pre_emerge_pkgs "" "app-shells/bash" || return 1
195
196 # now we have a shell right there
197 @@ -2213,7 +2215,8 @@ bootstrap_stage3() {
198 app-admin/eselect
199 $( [[ ${CHOST} == *-cygwin* ]] && echo sys-libs/cygwin-crypt )
200 )
201 - # for grep we need to do a little workaround as we might use llvm-3.4
202 +
203 + # For grep we need to do a little workaround as we might use llvm-3.4
204 # here, which doesn't necessarily grok the system headers on newer
205 # OSX, confusing the buildsystem
206 ac_cv_c_decl_report=warning \
207 @@ -2251,7 +2254,7 @@ bootstrap_stage3() {
208 emerge --color n --sync || emerge-webrsync || return 1
209 fi
210
211 - # avoid installing git or encryption just for fun while completing @system
212 + # Avoid installing git or encryption just for fun while completing @system
213 export USE="-git -crypt"
214
215 # Portage should figure out itself what it needs to do, if anything.
216 @@ -2260,7 +2263,7 @@ bootstrap_stage3() {
217 unset CFLAGS CXXFLAGS CPPFLAGS
218 emerge --color n -uDNv system || return 1
219
220 - # remove anything that we don't need (compilers most likely)
221 + # Remove anything that we don't need (compilers most likely)
222 einfo "running emerge --depclean"
223 estatus "stage3: emerge --depclean"
224 emerge --color n --depclean
225 @@ -2300,7 +2303,7 @@ set_helper_vars() {
226
227 bootstrap_interactive() {
228 # TODO should immediately die on platforms that we know are
229 - # impossible due extremely hard dependency chains
230 + # impossible due to extremely hard dependency chains
231 # (NetBSD/OpenBSD)
232
233 cat <<"EOF"