]> git.ipfire.org Git - people/stevee/pakfire.git/blame - tools/quality-agent.d/050-root-links-to-usr
Rename scripts dir to tools.
[people/stevee/pakfire.git] / tools / quality-agent.d / 050-root-links-to-usr
CommitLineData
f165e102
MT
1#!/bin/bash
2
3. $(dirname ${0})/qa-include
4
5DESC="Check for binaries in /bin or /sbin that link to /usr/..."
6
7function 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
f165e102
MT
16 continue
17 fi
18
19 libs=$(ldd ${file})
20 if grep -q /usr/lib <<<${libs}; then
dc24b351
MT
21 log WARN "${file} links to libs in /usr/lib..."
22 while read lib; do
23 log WARN " ${lib}"
24 done <<<${libs}
f165e102
MT
25 ret=1
26 fi
27 done
28
29 return ${ret}
30}
31
32run