Browse Source

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>
main
Emil Velikov 2 years ago committed by Josh Boyer
parent
commit
40fa2b2096
No known key found for this signature in database
GPG Key ID: A31B6BD72486CFD6
  1. 10
      copy-firmware.sh

10
copy-firmware.sh

@ -34,16 +34,16 @@ done
grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do
test -f "$f" || continue test -f "$f" || continue
$verbose "copying file $f" $verbose "copying file $f"
install -d $destdir/$(dirname "$f") install -d "$destdir/$(dirname "$f")"
cp -d "$f" $destdir/"$f" cp -d "$f" "$destdir/$f"
done done


grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do
if test -L "$f"; then if test -L "$f"; then
test -f "$destdir/$f" && continue test -f "$destdir/$f" && continue
$verbose "copying link $f" $verbose "copying link $f"
install -d $destdir/$(dirname "$f") install -d "$destdir/$(dirname "$f")"
cp -d "$f" $destdir/"$f" cp -d "$f" "$destdir/$f"


if test "x$d" != "x"; then if test "x$d" != "x"; then
target=`readlink "$f"` 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 fi
else else
$verbose "creating link $f -> $d" $verbose "creating link $f -> $d"
install -d $destdir/$(dirname "$f") install -d "$destdir/$(dirname "$f")"
ln -sf "$d" "$destdir/$f" ln -sf "$d" "$destdir/$f"
fi fi
done done

Loading…
Cancel
Save