Update copy-firmware script

alpha
inference 2023-09-06 14:31:58 +01:00
parent 01b0691176
commit b7a9f03e3a
Signed by: inference
SSH Key Fingerprint: SHA256:FtEVfx1CmTKMy40VwZvF4k+3TC+QhCWy+EmPRg50Nnc
1 changed files with 10 additions and 0 deletions

View File

@ -9,12 +9,16 @@ prune=no
# shellcheck disable=SC2209
compress=cat
compext=
quiet=">/dev/null"
rdfind_results=/dev/null
while test $# -gt 0; do
case $1 in
-v | --verbose)
# shellcheck disable=SC2209
verbose=echo
quiet=
rdfind_results=results.txt
shift
;;
@ -115,6 +119,12 @@ grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do
fi
done
$verbose rdfind -makesymlinks true "$destdir" -outputname $rdfind_results "$quiet"
find "$destdir" -type l | while read -r l; do
target="$(realpath "$l")"
ln -fs "$(realpath --relative-to="$(dirname "$(realpath -s "$l")")" "$target")" "$l"
done
exit 0
# vim: et sw=4 sts=4 ts=4