summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-12-22 15:42:06 -0800
committerZac Medico <zmedico@gentoo.org>2011-12-22 15:42:06 -0800
commitbbe1a2f0a2e4f6f611db015b17d81d6b8083e36c (patch)
tree879f5160f6b42d07badd26a56eafaeb87566bcc6 /bin
parente20df85cf8579aaa9cf07d59efc453d5837a7598 (diff)
downloadportage-bbe1a2f0a2e4f6f611db015b17d81d6b8083e36c.tar.gz
portage-bbe1a2f0a2e4f6f611db015b17d81d6b8083e36c.tar.bz2
portage-bbe1a2f0a2e4f6f611db015b17d81d6b8083e36c.zip
Share variables for CFLAGS and LDFLAGS checks.
The rationale is that any exceptions to either of these checks will probably apply to both checks. So, QA_CFLAGS_IGNORED and QA_DT_HASH are merged into QA_FLAGS_IGNORED, and QA_STRICT_CFLAGS_IGNORED and QA_STRICT_DT_HASH are merged into QA_STRICT_FLAGS_IGNORED.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/misc-functions.sh77
1 files changed, 44 insertions, 33 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index c74b4a411..dcfdceb94 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -308,6 +308,41 @@ install_qa_check() {
sleep 1
fi
+ # Merge QA_FLAGS_IGNORED and QA_DT_HASH into a single array, since
+ # QA_DT_HASH is deprecated.
+ qa_var="QA_FLAGS_IGNORED_${ARCH/-/_}"
+ eval "[[ -n \${!qa_var} ]] && QA_FLAGS_IGNORED=(\"\${${qa_var}[@]}\")"
+ if [[ ${#QA_FLAGS_IGNORED[@]} -eq 1 ]] ; then
+ local shopts=$-
+ set -o noglob
+ QA_FLAGS_IGNORED=(${QA_FLAGS_IGNORED})
+ set +o noglob
+ set -${shopts}
+ fi
+
+ qa_var="QA_DT_HASH_${ARCH/-/_}"
+ eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")"
+ if [[ ${#QA_DT_HASH[@]} -eq 1 ]] ; then
+ local shopts=$-
+ set -o noglob
+ QA_DT_HASH=(${QA_DT_HASH})
+ set +o noglob
+ set -${shopts}
+ fi
+
+ if [[ -n ${QA_DT_HASH} ]] ; then
+ QA_FLAGS_IGNORED=("${QA_FLAGS_IGNORED[@]}" "${QA_DT_HASH[@]}")
+ unset QA_DT_HASH
+ fi
+
+ # Merge QA_STRICT_FLAGS_IGNORED and QA_STRICT_DT_HASH, since
+ # QA_STRICT_DT_HASH is deprecated
+ if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] && \
+ [ "${QA_STRICT_DT_HASH-unset}" != unset ] ; then
+ QA_STRICT_FLAGS_IGNORED=1
+ unset QA_STRICT_DT_HASH
+ fi
+
# Check for files built without respecting *FLAGS. Note that
# -frecord-gcc-switches must be in all *FLAGS variables, in
# order to avoid false positive results here.
@@ -316,25 +351,13 @@ install_qa_check() {
[[ "${FFLAGS}" == *-frecord-gcc-switches* ]] && \
[[ "${FCFLAGS}" == *-frecord-gcc-switches* ]] && \
! has binchecks ${RESTRICT} ; then
- qa_var="QA_CFLAGS_IGNORED_${ARCH/-/_}"
- eval "[[ -n \${!qa_var} ]] && QA_CFLAGS_IGNORED=(\"\${${qa_var}[@]}\")"
f=$(scanelf -qyRF '%k %p' -k \!.GCC.command.line "${ED}" | sed -e "s:\!.GCC.command.line ::")
if [[ -n ${f} ]] ; then
echo "${f}" > "${T}"/scanelf-ignored-CFLAGS.log
- if [ "${QA_STRICT_CFLAGS_IGNORED-unset}" == unset ] ; then
- if [[ ${#QA_CFLAGS_IGNORED[@]} -gt 1 ]] ; then
- for x in "${QA_CFLAGS_IGNORED[@]}" ; do
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log
- done
- else
- local shopts=$-
- set -o noglob
- for x in ${QA_CFLAGS_IGNORED} ; do
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log
- done
- set +o noglob
- set -${shopts}
- fi
+ if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then
+ for x in "${QA_FLAGS_IGNORED[@]}" ; do
+ sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-CFLAGS.log
+ done
fi
# Filter anything under /usr/lib/debug/ in order to avoid
# duplicate warnings for splitdebug files.
@@ -356,26 +379,14 @@ install_qa_check() {
# Check for files built without respecting LDFLAGS
if [[ "${LDFLAGS}" == *,--hash-style=gnu* ]] && \
- ! has binchecks ${RESTRICT} ; then
- qa_var="QA_DT_HASH_${ARCH/-/_}"
- eval "[[ -n \${!qa_var} ]] && QA_DT_HASH=(\"\${${qa_var}[@]}\")"
+ ! has binchecks ${RESTRICT} ; then
f=$(scanelf -qyRF '%k %p' -k .hash "${ED}" | sed -e "s:\.hash ::")
if [[ -n ${f} ]] ; then
echo "${f}" > "${T}"/scanelf-ignored-LDFLAGS.log
- if [ "${QA_STRICT_DT_HASH-unset}" == unset ] ; then
- if [[ ${#QA_DT_HASH[@]} -gt 1 ]] ; then
- for x in "${QA_DT_HASH[@]}" ; do
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-LDFLAGS.log
- done
- else
- local shopts=$-
- set -o noglob
- for x in ${QA_DT_HASH} ; do
- sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-LDFLAGS.log
- done
- set +o noglob
- set -${shopts}
- fi
+ if [ "${QA_STRICT_FLAGS_IGNORED-unset}" = unset ] ; then
+ for x in "${QA_FLAGS_IGNORED[@]}" ; do
+ sed -e "s#^${x#/}\$##" -i "${T}"/scanelf-ignored-LDFLAGS.log
+ done
fi
# Filter anything under /usr/lib/debug/ in order to avoid
# duplicate warnings for splitdebug files.