16 lines
299 B
Text
16 lines
299 B
Text
|
#!/bin/sh
|
||
|
|
||
|
set -e
|
||
|
|
||
|
cd "$1"
|
||
|
BROKEN_LINKS=$(find . -xtype l)
|
||
|
|
||
|
for link in $BROKEN_LINKS; do
|
||
|
src=$(readlink "$link")
|
||
|
if echo "$src" | grep -q '^\.\./\.\./lib/'; then
|
||
|
# Relink without relative part
|
||
|
new_src=$(echo "$src" | sed 's!^\.\./\.\./lib/!!')
|
||
|
ln -vsf "$new_src" "$link"
|
||
|
fi
|
||
|
done
|