commit:     a61a7cc8f25db7482fef700700f2b1e3bbace738
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Mon Aug  8 06:43:05 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Jun  5 11:22:09 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=a61a7cc8

80libraries: use test -v instead of ${param-unset}

Wherever there is a need to test whether a variable is set, employ the
[[ ! -v name ]] command to do so. This is supported as of bash-4.2.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/install-qa-check.d/80libraries | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/install-qa-check.d/80libraries 
b/bin/install-qa-check.d/80libraries
index 4dd392255a..72058b73f4 100644
--- a/bin/install-qa-check.d/80libraries
+++ b/bin/install-qa-check.d/80libraries
@@ -19,7 +19,7 @@ scanelf_lib_check() {
        f=$(scanelf -ByF '%S %p' "${ED%/}"/{,usr/}lib*/lib*.so* | awk '$2 == "" 
{ print }' | sed -e "s:^[[:space:]]${ED%/}/:/:")
        if [[ -n ${f} ]] ; then
                echo "${f}" > "${T}"/scanelf-missing-SONAME.log
-               if [[ "${QA_STRICT_SONAME-unset}" == unset ]] ; then
+               if [[ ! -v QA_STRICT_SONAME ]] ; then
                        if [[ ${#QA_SONAME[@]} -gt 1 ]] ; then
                                for x in "${QA_SONAME[@]}" ; do
                                        sed -e "s#^/${x#/}\$##" -i 
"${T}"/scanelf-missing-SONAME.log
@@ -62,7 +62,7 @@ scanelf_lib_check() {
        fi
        if [[ -n ${f} ]] ; then
                echo "${f}" > "${T}"/scanelf-missing-NEEDED.log
-               if [[ "${QA_STRICT_DT_NEEDED-unset}" == unset ]] ; then
+               if [[ ! -v QA_STRICT_DT_NEEDED ]] ; then
                        if [[ ${#QA_DT_NEEDED[@]} -gt 1 ]] ; then
                                for x in "${QA_DT_NEEDED[@]}" ; do
                                        sed -e "s#^/${x#/}\$##" -i 
"${T}"/scanelf-missing-NEEDED.log

Reply via email to