From: Michael Tremer Date: Sat, 7 Jan 2012 23:44:03 +0000 (+0100) Subject: QA: Improve libs-location check. X-Git-Tag: 0.9.20~14^2^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43b8a74cb643d77c5ac4a6e659bfc076e43b61aa;p=pakfire.git QA: Improve libs-location check. Searches also in gcc's libdir (mainly for libgcc_s.so). --- 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