]> git.ipfire.org Git - people/ms/ipfire-3.x.git/blame - pkgs/build-essentials/quality-agent/quality-agent.d/002-bad-symlinks
Move packages to pkgs subdirectory.
[people/ms/ipfire-3.x.git] / pkgs / build-essentials / quality-agent / quality-agent.d / 002-bad-symlinks
CommitLineData
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
8log_debug "Search for absolute symlinks"
9
10function 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
32run
33