]> git.ipfire.org Git - ipfire-3.x.git/commitdiff
QA: Check dependency libs only if interpreter is available.
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Mar 2010 13:03:08 +0000 (14:03 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 23 Mar 2010 13:03:08 +0000 (14:03 +0100)
tools/quality-agent.d/050-root-links-to-usr
tools/quality-agent.d/qa-include

index c514136ccea55f6e2d8c4adf6a7a435006c89509..0027ff3ae67201137a0267e142a0a9a2cd7d4b12 100755 (executable)
@@ -7,6 +7,13 @@ log "Check for binaries in /bin or /sbin that link to /usr/..."
 for file in ${BUILDROOT}/{bin,lib,sbin}/*; do
        [ -f "${file}" ] || continue
        log "  ${file}"
+
+       interpreter=$(get_interpreter ${file})
+       if [ ! -e "${BUILDROOT}${interpreter}" ]; then
+               log "  SKIPPED because interpreter is not available"
+               continue
+       fi
+
        libs=$(ldd ${file})
        if grep -q /usr/lib <<<${libs}; then
                log "ERROR: ${file} links to libs in /usr/lib..."
index 43e0e5bdef114f3f9f52d9c64600caaeb5b3cd44..45046237d2c0c5e641c9ff0f0a481d4d88272f74 100644 (file)
@@ -8,3 +8,10 @@ if [ -z "${BUILDROOT}" ]; then
        echo "${0##*/}: ERROR: BUILDROOT is not set." >&2
        exit 1
 fi
+
+get_interpreter() {
+       local file=${1}
+
+       readelf -l ${file} | grep "program interpreter" | \
+               tr -d "]" | awk '{ print $NF }'
+}