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 @@ -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 @@ -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

Loading…
Cancel
Save