From 43b8a74cb643d77c5ac4a6e659bfc076e43b61aa Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 8 Jan 2012 00:44:03 +0100 Subject: [PATCH] QA: Improve libs-location check. Searches also in gcc's libdir (mainly for libgcc_s.so). --- tools/quality-agent.d/003-libs-location | 32 ++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tools/quality-agent.d/003-libs-location b/tools/quality-agent.d/003-libs-location index 185f44f06..39a7f2493 100755 --- a/tools/quality-agent.d/003-libs-location +++ b/tools/quality-agent.d/003-libs-location @@ -4,14 +4,40 @@ DESC="Checking correct installation of libraries" +# Find the system's libdir. +case "$(uname -m)" in + x86_86) + libdir="lib64" + ;; + *) + libdir="lib" + ;; +esac + +# Find gcc libdir. +gcc_libdir=$(gcc -print-libgcc-file-name) +gcc_libdir=$(basename ${gcc_libdir}) + function check() { local failed=0 - for lib in $(find ${BUILDROOT}/lib -type f -name "lib*.so.*" 2>/dev/null); do + for lib in $(find ${BUILDROOT}/${libdir} -type f -name "lib*.so.*" 2>/dev/null); do lib=${lib##*/} lib=${lib%%.so*} - if [ ! -e "${BUILDROOT}/usr/lib/${lib}.so" ]; then - log ERROR " /usr/lib/${lib}.so is missing" + # Indicates if the library in question has been found. + found=0 + + # Check if ${lib}.so is in the linker's search path. + for path in /usr/${libdir} ${gcc_libdir}; do + if [ -e "${BUILDROOT}${path}/${lib}.so" ]; then + found=1 + break + fi + done + + if [ "${found}" = "1" ]; then + log ERROR " ${lib}.so cannot be found in the linker's search path:" + log ERROR " /usr/${libdir} ${gcc_libdir}" failed=1 fi done -- 2.39.5