1 |
commit: bbe1a2f0a2e4f6f611db015b17d81d6b8083e36c |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 22 23:42:06 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 22 23:42:06 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=bbe1a2f0 |
7 |
|
8 |
Share variables for CFLAGS and LDFLAGS checks. |
9 |
|
10 |
The rationale is that any exceptions to either of these checks will |
11 |
probably apply to both checks. So, QA_CFLAGS_IGNORED and QA_DT_HASH |
12 |
are merged into QA_FLAGS_IGNORED, and QA_STRICT_CFLAGS_IGNORED and |
13 |
QA_STRICT_DT_HASH are merged into QA_STRICT_FLAGS_IGNORED. |
14 |
|
15 |
--- |
16 |
bin/misc-functions.sh | 77 ++++++++++++++++++++++++++++--------------------- |
17 |
man/ebuild.5 | 11 ++++--- |
18 |
man/make.conf.5 | 7 ++-- |
19 |
3 files changed, 54 insertions(+), 41 deletions(-) |
20 |
|
21 |
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh |
22 |
index c74b4a4..dcfdceb 100755 |
23 |
--- a/bin/misc-functions.sh |
24 |
+++ b/bin/misc-functions.sh |
25 |
@@ -308,6 +308,41 @@ install_qa_check() { |
26 |
sleep 1 |
27 |
fi |
28 |
|
29 |
+ # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since |
30 |
+ # QA_DT_HASH is deprecated. |
31 |
+ qa_var="QA_FLAGS_IGNORED_${ARCH/-/_}" |
32 |
+ eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=(\"\${${qa_var}[@]}\")" |
33 |
+ if [[ ${#QA_FLAGS_IGNORED[@]} -eq 1 ]] ; then |
34 |
+ local shopts=$- |
35 |
+ set -o noglob |
36 |
+ QA_FLAGS_IGNORED=(${QA_FLAGS_IGNORED}) |
37 |
+ set +o noglob |
38 |
+ set -${shopts} |
39 |
+ fi |
40 |
+ |
41 |
+ qa_var="QA_DT_HASH_${ARCH/-/_}" |
42 |
+ eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")" |
43 |
+ if [[ ${#QA_DT_HASH[@]} -eq 1 ]] ; then |
44 |
+ local shopts=$- |
45 |
+ set -o noglob |
46 |
+ QA_DT_HASH=(${QA_DT_HASH}) |
47 |
+ set +o noglob |
48 |
+ set -${shopts} |
49 |
+ fi |
50 |
+ |
51 |
+ if [[ -n ${QA_DT_HASH} ]] ; then |
52 |
+ QA_FLAGS_IGNORED=("${QA_FLAGS_IGNORED[@]}" "${QA_DT_HASH[@]}") |
53 |
+ unset QA_DT_HASH |
54 |
+ fi |
55 |
+ |
56 |
+ # Merge QA_STRICT_FLAGS_IGNORED and QA_STRICT_DT_HASH, since |
57 |
+ # QA_STRICT_DT_HASH is deprecated |
58 |
+ if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] && \ |
59 |
+ [ "${QA_STRICT_DT_HASH-unset}" != unset ] ; then |
60 |
+ QA_STRICT_FLAGS_IGNORED=1 |
61 |
+ unset QA_STRICT_DT_HASH |
62 |
+ fi |
63 |
+ |
64 |
# Check for files built without respecting *FLAGS. Note that |
65 |
# -frecord-gcc-switches must be in all *FLAGS variables, in |
66 |
# order to avoid false positive results here. |
67 |
@@ -316,25 +351,13 @@ install_qa_check() { |
68 |
[[ "${FFLAGS}" == *-frecord-gcc-switches* ]] && \ |
69 |
[[ "${FCFLAGS}" == *-frecord-gcc-switches* ]] && \ |
70 |
! has binchecks ${RESTRICT} ; then |
71 |
- qa_var="QA_CFLAGS_IGNORED_${ARCH/-/_}" |
72 |
- eval "[[ -n \${!qa_var} ]] && QA_CFLAGS_IGNORED=(\"\${${qa_var}[@]}\")" |
73 |
f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::") |
74 |
if [[ -n ${f} ]] ; then |
75 |
echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log |
76 |
- if [ "${QA_STRICT_CFLAGS_IGNORED-unset}" == unset ] ; then |
77 |
- if [[ ${#QA_CFLAGS_IGNORED[@]} -gt 1 ]] ; then |
78 |
- for x in "${QA_CFLAGS_IGNORED[@]}" ; do |
79 |
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log |
80 |
- done |
81 |
- else |
82 |
- local shopts=$- |
83 |
- set -o noglob |
84 |
- for x in ${QA_CFLAGS_IGNORED} ; do |
85 |
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log |
86 |
- done |
87 |
- set +o noglob |
88 |
- set -${shopts} |
89 |
- fi |
90 |
+ if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then |
91 |
+ for x in "${QA_FLAGS_IGNORED[@]}" ; do |
92 |
+ sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log |
93 |
+ done |
94 |
fi |
95 |
# Filter anything under /usr/lib/debug/ in order to avoid |
96 |
# duplicate warnings for splitdebug files. |
97 |
@@ -356,26 +379,14 @@ install_qa_check() { |
98 |
|
99 |
# Check for files built without respecting LDFLAGS |
100 |
if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && \ |
101 |
- ! has binchecks ${RESTRICT} ; then |
102 |
- qa_var="QA_DT_HASH_${ARCH/-/_}" |
103 |
- eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")" |
104 |
+ ! has binchecks ${RESTRICT} ; then |
105 |
f=$(scanelf -qyRF '%k %p' -k .hash "${ED}" | sed -e "s:\.hash ::") |
106 |
if [[ -n ${f} ]] ; then |
107 |
echo "${f}" > "${T}"/scanelf-ignored-LDFLAGS.log |
108 |
- if [ "${QA_STRICT_DT_HASH-unset}" == unset ] ; then |
109 |
- if [[ ${#QA_DT_HASH[@]} -gt 1 ]] ; then |
110 |
- for x in "${QA_DT_HASH[@]}" ; do |
111 |
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-LDFLAGS.log |
112 |
- done |
113 |
- else |
114 |
- local shopts=$- |
115 |
- set -o noglob |
116 |
- for x in ${QA_DT_HASH} ; do |
117 |
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-LDFLAGS.log |
118 |
- done |
119 |
- set +o noglob |
120 |
- set -${shopts} |
121 |
- fi |
122 |
+ if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then |
123 |
+ for x in "${QA_FLAGS_IGNORED[@]}" ; do |
124 |
+ sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-LDFLAGS.log |
125 |
+ done |
126 |
fi |
127 |
# Filter anything under /usr/lib/debug/ in order to avoid |
128 |
# duplicate warnings for splitdebug files. |
129 |
|
130 |
diff --git a/man/ebuild.5 b/man/ebuild.5 |
131 |
index 4f2f3a8..afa2731 100644 |
132 |
--- a/man/ebuild.5 |
133 |
+++ b/man/ebuild.5 |
134 |
@@ -602,19 +602,20 @@ This should contain a list of file paths, relative to the image directory, of |
135 |
files that contain writable and executable segments. These are rare. |
136 |
The paths may contain fnmatch patterns. |
137 |
.TP |
138 |
-\fBQA_CFLAGS_IGNORED\fR |
139 |
+\fBQA_FLAGS_IGNORED\fR |
140 |
This should contain a list of file paths, relative to the image directory, of |
141 |
-files that do not contain .GCC.command.line sections. The paths may contain |
142 |
-regular expressions with escape\-quoted special characters. |
143 |
+files that do not contain .hash or .GCC.command.line sections. The paths may |
144 |
+contain regular expressions with escape\-quoted special characters. |
145 |
.br |
146 |
This variable is intended to be used on files of binary packages which ignore |
147 |
-CFLAGS, CXXFLAGS, FFLAGS, and FCFLAGS variables. |
148 |
+CFLAGS, CXXFLAGS, FFLAGS, FCFLAGS, and LDFLAGS variables. |
149 |
.TP |
150 |
.TP |
151 |
\fBQA_DT_HASH\fR |
152 |
This should contain a list of file paths, relative to the image directory, of |
153 |
files that contain .hash sections. The paths may contain regular expressions |
154 |
-with escape\-quoted special characters. |
155 |
+with escape\-quoted special characters. This variable is deprecated. Use |
156 |
+\fBQA_FLAGS_IGNORED\f instead. |
157 |
.br |
158 |
This variable is intended to be used on files of binary packages which ignore |
159 |
LDFLAGS variable. |
160 |
|
161 |
diff --git a/man/make.conf.5 b/man/make.conf.5 |
162 |
index eff180e..8a66c21 100644 |
163 |
--- a/man/make.conf.5 |
164 |
+++ b/man/make.conf.5 |
165 |
@@ -814,13 +814,14 @@ settings from ebuilds. See also \fBebuild\fR(5). |
166 |
Set this to cause portage to ignore any \fIQA_TEXTREL\fR override |
167 |
settings from ebuilds. See also \fBebuild\fR(5). |
168 |
.TP |
169 |
-\fBQA_STRICT_CFLAGS_IGNORED = \fI"set"\fR |
170 |
-Set this to cause portage to ignore any \fIQA_CFLAGS_IGNORED\fR override |
171 |
+\fBQA_STRICT_FLAGS_IGNORED = \fI"set"\fR |
172 |
+Set this to cause portage to ignore any \fIQA_FLAGS_IGNORED\fR override |
173 |
settings from ebuilds. See also \fBebuild\fR(5). |
174 |
.TP |
175 |
\fBQA_STRICT_DT_HASH = \fI"set"\fR |
176 |
Set this to cause portage to ignore any \fIQA_DT_HASH\fR override |
177 |
-settings from ebuilds. See also \fBebuild\fR(5). |
178 |
+settings from ebuilds. This variable is deprecated. Use |
179 |
+\fIQA_STRICT_FLAGS_IGNORED\fR instead. |
180 |
.TP |
181 |
\fBQA_STRICT_PRESTRIPPED = \fI"set"\fR |
182 |
Set this to cause portage to ignore any \fIQA_PRESTRIPPED\fR override |