Browse Source

sde-build: warn about absolute, dirty and broken symlinks

user/chris/test/patchcksum
Alejandro Mery 13 years ago
parent
commit
7a6a96548d
1 changed files with 20 additions and 3 deletions
  1. +20
    -3
      lib/functions.in

+ 20
- 3
lib/functions.in

@ -311,12 +311,29 @@ function run_check() {
# make symlinks relative
#
postflist_dirty_symlinks() {
local dfn= ffn=
echo "Processing symlink corrections ..."
while read fn; do
local ffn="$root/$fn"
if [ -L "$ffn" -a ! -e "$ffn" ]; then
echo_warning "broken symlink: $fn"
if [ -L "$ffn" ]; then
local dfn=$(readlink "$ffn")
if [ "${dfn:0:1}" = '/' ]; then
local dfn2="${dfn#$root}"
if [ "$dfn2" != "$dfn" ]; then
echo_warning "dirty symlink: $fn"
dfn="$dfn2"
else
dfn2=
fi
if [ ! -e "$root$dfn" ]; then
echo_warning "broken absolute symlink: $fn"
elif [ -z "$dfn2" ]; then # haven't said it's dirty already
echo_warning "absolute symlink: $fn"
fi
elif [ ! -e "$ffn" ]; then
echo_warning "broken symlink: $fn"
fi
fi
done < "$builddir/flist.txt"
}

Loading…
Cancel
Save