copy-firmware: quote deskdir and dirname

Properly quote, otherwise we'll get word splitting. In other words:
Files might end up installed to /some/foo/, where /some path/foo bar/ is
expected.

v2:
 - rebase/split && also quote the $() output

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Josh Boyer <jwboyer@kernel.org>
This commit is contained in:
Emil Velikov 2023-06-05 14:58:08 +01:00 committed by Josh Boyer
parent 77f92e0b9d
commit 40fa2b2096
No known key found for this signature in database
GPG Key ID: A31B6BD72486CFD6

View File

@ -34,16 +34,16 @@ done
grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do
test -f "$f" || continue
$verbose "copying file $f"
install -d $destdir/$(dirname "$f")
cp -d "$f" $destdir/"$f"
install -d "$destdir/$(dirname "$f")"
cp -d "$f" "$destdir/$f"
done
grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do
if test -L "$f"; then
test -f "$destdir/$f" && continue
$verbose "copying link $f"
install -d $destdir/$(dirname "$f")
cp -d "$f" $destdir/"$f"
install -d "$destdir/$(dirname "$f")"
cp -d "$f" "$destdir/$f"
if test "x$d" != "x"; then
target=`readlink "$f"`
@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d
fi
else
$verbose "creating link $f -> $d"
install -d $destdir/$(dirname "$f")
install -d "$destdir/$(dirname "$f")"
ln -sf "$d" "$destdir/$f"
fi
done