mirror of
https://gitlab.com/kernel-firmware/linux-firmware.git
synced 2026-03-14 13:10:10 +01:00
Fix symlink creation for some files
rdfind was trying to duplicate symlinks created by WHENCE causing problems. Move the call before WHENCE creates symlinks. Reported-by: Timur Tabi <ttabi@nvidia.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
This commit is contained in:
parent
16b92b8d68
commit
4c55675d7a
1 changed files with 8 additions and 10 deletions
|
|
@ -9,16 +9,12 @@ 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
|
||||
;;
|
||||
|
||||
|
|
@ -81,6 +77,14 @@ grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g'
|
|||
fi
|
||||
done
|
||||
|
||||
$verbose "Finding duplicate files"
|
||||
rdfind -makesymlinks true -makeresultsfile false "$destdir" >/dev/null
|
||||
find "$destdir" -type l | while read -r l; do
|
||||
target="$(realpath "$l")"
|
||||
$verbose "Correcting path for $l"
|
||||
ln -fs "$(realpath --relative-to="$(dirname "$(realpath -s "$l")")" "$target")" "$l"
|
||||
done
|
||||
|
||||
# shellcheck disable=SC2162 # file/folder name can include escaped symbols
|
||||
grep -E '^Link:' WHENCE | sed -e 's/^Link: *//g;s/-> //g' | while read f d; do
|
||||
if test -L "$f$compext"; then
|
||||
|
|
@ -119,12 +123,6 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue