]>
Commit | Line | Data |
---|---|---|
f165e102 MT |
1 | #!/bin/bash |
2 | ||
3 | . $(dirname ${0})/qa-include | |
4 | ||
5 | DESC="Check for binaries in /bin or /sbin that link to /usr/..." | |
6 | ||
7 | function check() { | |
8 | local ret=0 | |
9 | ||
10 | for file in $(find ${BUILDROOT}/{bin,lib,sbin}/* 2>/dev/null); do | |
11 | [ -f "${file}" ] || continue | |
12 | log DEBUG " ${file}" | |
13 | ||
14 | interpreter=$(file_get_interpreter ${file}) | |
15 | if [ ! -e "${interpreter}" ]; then | |
16 | log WARN " SKIPPED because interpreter is not available" | |
17 | continue | |
18 | fi | |
19 | ||
20 | libs=$(ldd ${file}) | |
21 | if grep -q /usr/lib <<<${libs}; then | |
22 | log ERROR "${file} links to libs in /usr/lib..." | |
23 | log ERROR " ${libs}" | |
24 | ret=1 | |
25 | fi | |
26 | done | |
27 | ||
28 | return ${ret} | |
29 | } | |
30 | ||
31 | run |