]>
Commit | Line | Data |
---|---|---|
95cdc7ab MT |
1 | #!/bin/bash |
2 | ||
3 | . $(dirname ${0})/qa-include | |
4 | ||
5 | # Check for absolute symlinks. | |
6 | # We do not allow them because they may point to any bad location. | |
7 | ||
8 | log_debug "Search for absolute symlinks" | |
9 | ||
10 | function check() { | |
11 | local failed=0 | |
12 | ||
13 | for link in $(find ${BUILDROOT} -type l); do | |
14 | if fgrep -q "/lib/udev/devices" <<<${link}; then | |
15 | continue | |
16 | fi | |
17 | ||
18 | destination=$(readlink ${link}) | |
19 | if [ "${destination:0:1}" = "/" ]; then | |
20 | log ERROR " Absolute symlink: ${link}" | |
21 | failed=1 | |
22 | fi | |
23 | if [ ! -e "${link%/*}/${destination}" ]; then | |
24 | log ERROR " Not existant destination: ${link} -> ${destination}" | |
25 | failed=1 | |
26 | fi | |
27 | done | |
28 | ||
29 | return ${failed} | |
30 | } | |
31 | ||
32 | run | |
33 |