infrastructure/fix-links

15 lines
299 B
Bash
Executable file

#!/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