Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: bin/, bin/install-qa-check.d/
Date: Sun, 20 Jun 2021 21:46:17
Message-Id: 1624225565.c3e4919fd004ce0f5c91c67ea377bbda83558ca9.mgorny@gentoo
1 commit: c3e4919fd004ce0f5c91c67ea377bbda83558ca9
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 20 20:54:36 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 20 21:46:05 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=c3e4919f
7
8 Use PORTAGE_PROPERTIES and PORTAGE_RESTRICT internally
9
10 Use PORTAGE_PROPERTIES and PORTAGE_RESTRICT directly for internal
11 purposes rather than relying on PROPERTIES and RESTRICT having
12 the flattened values.
13
14 Reviewed-by: Zac Medico <zmedico <AT> gentoo.org>
15 Closes: https://github.com/gentoo/portage/pull/734
16 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
17
18 bin/ebuild.sh | 2 +-
19 bin/estrip | 14 +++++++-------
20 bin/install-qa-check.d/10executable-issues | 2 +-
21 bin/install-qa-check.d/10ignored-flags | 4 ++--
22 bin/install-qa-check.d/80libraries | 2 +-
23 bin/misc-functions.sh | 2 +-
24 bin/phase-functions.sh | 8 ++++----
25 bin/phase-helpers.sh | 2 +-
26 8 files changed, 18 insertions(+), 18 deletions(-)
27
28 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
29 index 904fdf54e..5916bedfc 100755
30 --- a/bin/ebuild.sh
31 +++ b/bin/ebuild.sh
32 @@ -737,7 +737,7 @@ if ! has "$EBUILD_PHASE" clean cleanrm ; then
33 fi
34 fi
35
36 -if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT}
37 +if has nostrip ${FEATURES} ${PORTAGE_RESTRICT} || has strip ${PORTAGE_RESTRICT}
38 then
39 export DEBUGBUILD=1
40 fi
41
42 diff --git a/bin/estrip b/bin/estrip
43 index 81f78e847..7ef1ec35c 100755
44 --- a/bin/estrip
45 +++ b/bin/estrip
46 @@ -16,7 +16,7 @@ exp_tf() {
47 done
48 }
49 exp_tf FEATURES compressdebug installsources nostrip splitdebug xattr
50 -exp_tf RESTRICT binchecks installsources splitdebug strip
51 +exp_tf PORTAGE_RESTRICT binchecks installsources splitdebug strip
52
53 if ! ___eapi_has_prefix_variables; then
54 EPREFIX= ED=${D}
55 @@ -24,7 +24,7 @@ fi
56
57 banner=false
58 SKIP_STRIP=false
59 -if ${RESTRICT_strip} || ${FEATURES_nostrip} ; then
60 +if ${PORTAGE_RESTRICT_strip} || ${FEATURES_nostrip} ; then
61 SKIP_STRIP=true
62 banner=true
63 ${FEATURES_installsources} || exit 0
64 @@ -167,7 +167,7 @@ mkdir -p "${tmpdir}"/{inodes,splitdebug,sources}
65 # Usage: save_elf_sources <elf>
66 save_elf_sources() {
67 ${FEATURES_installsources} || return 0
68 - ${RESTRICT_installsources} && return 0
69 + ${PORTAGE_RESTRICT_installsources} && return 0
70 if ! ${debugedit_found} ; then
71 if ! ${debugedit_warned} ; then
72 debugedit_warned=true
73 @@ -192,7 +192,7 @@ save_elf_sources() {
74 # Usage: save_elf_debug <elf> [splitdebug file]
75 save_elf_debug() {
76 ${FEATURES_splitdebug} || return 0
77 - ${RESTRICT_splitdebug} && return 0
78 + ${PORTAGE_RESTRICT_splitdebug} && return 0
79
80 # NOTE: Debug files must be installed in
81 # ${EPREFIX}/usr/lib/debug/${EPREFIX} (note that ${EPREFIX} occurs
82 @@ -318,7 +318,7 @@ process_ar() {
83 # There is no concept of splitdebug for objects not yet
84 # linked in (only for finally linked ELFs), so we have to
85 # retain the debug info in the archive itself.
86 - if ! ${FEATURES_splitdebug} || ${RESTRICT_splitdebug} ; then
87 + if ! ${FEATURES_splitdebug} || ${PORTAGE_RESTRICT_splitdebug} ; then
88 ${STRIP} -g "${x}" && ${RANLIB} "${x}"
89 fi
90 fi
91 @@ -327,7 +327,7 @@ process_ar() {
92 # The existance of the section .symtab tells us that a binary is stripped.
93 # We want to log already stripped binaries, as this may be a QA violation.
94 # They prevent us from getting the splitdebug data.
95 -if ! ${RESTRICT_binchecks} ; then
96 +if ! ${PORTAGE_RESTRICT_binchecks} ; then
97 # We need to do the non-stripped scan serially first before we turn around
98 # and start stripping the files ourselves. The log parsing can be done in
99 # parallel though.
100 @@ -459,7 +459,7 @@ __multijob_finish
101 cd "${tmpdir}"/sources/ && cat * > "${tmpdir}/debug.sources" 2>/dev/null
102 if [[ -s ${tmpdir}/debug.sources ]] && \
103 ${FEATURES_installsources} && \
104 - ! ${RESTRICT_installsources} && \
105 + ! ${PORTAGE_RESTRICT_installsources} && \
106 ${debugedit_found}
107 then
108 __vecho "installsources: rsyncing source files"
109
110 diff --git a/bin/install-qa-check.d/10executable-issues b/bin/install-qa-check.d/10executable-issues
111 index 6b33d281d..c2355ab8f 100644
112 --- a/bin/install-qa-check.d/10executable-issues
113 +++ b/bin/install-qa-check.d/10executable-issues
114 @@ -2,7 +2,7 @@
115 # text relocations, executable stacks
116
117 elf_check() {
118 - if ! type -P scanelf >/dev/null || has binchecks ${RESTRICT}; then
119 + if ! type -P scanelf >/dev/null || has binchecks ${PORTAGE_RESTRICT}; then
120 return
121 fi
122
123
124 diff --git a/bin/install-qa-check.d/10ignored-flags b/bin/install-qa-check.d/10ignored-flags
125 index 062f51325..89706cd4c 100644
126 --- a/bin/install-qa-check.d/10ignored-flags
127 +++ b/bin/install-qa-check.d/10ignored-flags
128 @@ -2,7 +2,7 @@
129
130 ignored_flag_check() {
131 type -P scanelf > /dev/null || return
132 - has binchecks ${RESTRICT} && return
133 + has binchecks ${PORTAGE_RESTRICT} && return
134
135 local qa_var="QA_FLAGS_IGNORED_${ARCH/-/_}"
136 eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=(\"\${${qa_var}[@]}\")"
137 @@ -65,7 +65,7 @@ ignored_flag_check() {
138
139 # Check for files built without respecting LDFLAGS
140 if [[ "${LDFLAGS}" == *,--defsym=__gentoo_check_ldflags__* ]] && \
141 - ! has binchecks ${RESTRICT} ; then
142 + ! has binchecks ${PORTAGE_RESTRICT} ; then
143 f=$(LC_ALL=C comm -2 -3 <(scanelf -qyRF '#k%p' -k .dynsym "${ED%/}/" | LC_ALL=C sort) \
144 <(scanelf -qyRF '#s%p' -s __gentoo_check_ldflags__ "${ED%/}/" | LC_ALL=C sort))
145 if [[ -n ${f} ]] ; then
146
147 diff --git a/bin/install-qa-check.d/80libraries b/bin/install-qa-check.d/80libraries
148 index d1d2c4fdd..8dc35bb87 100644
149 --- a/bin/install-qa-check.d/80libraries
150 +++ b/bin/install-qa-check.d/80libraries
151 @@ -92,7 +92,7 @@ scanelf_lib_check() {
152 lib_check() {
153 local f x i j
154
155 - if type -P scanelf >/dev/null && ! has binchecks ${RESTRICT}; then
156 + if type -P scanelf >/dev/null && ! has binchecks ${PORTAGE_RESTRICT}; then
157 scanelf_lib_check
158 fi
159
160
161 diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
162 index 97bd78ec8..bd1fb7553 100755
163 --- a/bin/misc-functions.sh
164 +++ b/bin/misc-functions.sh
165 @@ -206,7 +206,7 @@ install_qa_check() {
166 eqawarn "QA Notice: <stabilize-allarches/> found on package installing ELF files"
167 fi
168
169 - if has binchecks ${RESTRICT}; then
170 + if has binchecks ${PORTAGE_RESTRICT}; then
171 eqawarn "QA Notice: RESTRICT=binchecks prevented checks on these ELF files:"
172 eqawarn "$(while read -r x; do x=${x#*;} ; x=${x%%;*} ; echo "${x#${EPREFIX}}" ; done < "${PORTAGE_BUILDDIR}"/build-info/NEEDED.ELF.2)"
173 fi
174
175 diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
176 index 71411d414..0bb5d86e1 100644
177 --- a/bin/phase-functions.sh
178 +++ b/bin/phase-functions.sh
179 @@ -490,8 +490,8 @@ __dyn_test() {
180 die "The source directory '${S}' doesn't exist"
181 fi
182
183 - if has test ${RESTRICT} && ! has all ${ALLOW_TEST} &&
184 - ! { has test_network ${PROPERTIES} && has network ${ALLOW_TEST}; }
185 + if has test ${PORTAGE_RESTRICT} && ! has all ${ALLOW_TEST} &&
186 + ! { has test_network ${PORTAGE_PROPERTIES} && has network ${ALLOW_TEST}; }
187 then
188 einfo "Skipping make test/check due to ebuild restriction."
189 __vecho ">>> Test phase [disabled because of RESTRICT=test]: ${CATEGORY}/${PF}"
190 @@ -704,7 +704,7 @@ __dyn_install() {
191
192 cp "${EBUILD}" "${PF}.ebuild"
193 [ -n "${PORTAGE_REPO_NAME}" ] && echo "${PORTAGE_REPO_NAME}" > repository
194 - if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT}
195 + if has nostrip ${FEATURES} ${PORTAGE_RESTRICT} || has strip ${PORTAGE_RESTRICT}
196 then
197 >> DEBUGBUILD
198 fi
199 @@ -759,7 +759,7 @@ __dyn_help() {
200 echo " c++ flags : ${CXXFLAGS}"
201 echo " make flags : ${MAKEOPTS}"
202 echo -n " build mode : "
203 - if has nostrip ${FEATURES} ${RESTRICT} || has strip ${RESTRICT} ;
204 + if has nostrip ${FEATURES} ${PORTAGE_RESTRICT} || has strip ${PORTAGE_RESTRICT}
205 then
206 echo "debug (large)"
207 else
208
209 diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
210 index 3f53e6c57..94f4f24f2 100644
211 --- a/bin/phase-helpers.sh
212 +++ b/bin/phase-helpers.sh
213 @@ -21,7 +21,7 @@ export PORTAGE_DOCOMPRESS_SIZE_LIMIT="128"
214 declare -a PORTAGE_DOCOMPRESS=( /usr/share/{doc,info,man} )
215 declare -a PORTAGE_DOCOMPRESS_SKIP=( /usr/share/doc/${PF}/html )
216 declare -a PORTAGE_DOSTRIP=( / )
217 -has strip ${RESTRICT} && PORTAGE_DOSTRIP=()
218 +has strip ${PORTAGE_RESTRICT} && PORTAGE_DOSTRIP=()
219 declare -a PORTAGE_DOSTRIP_SKIP=()
220
221 into() {