mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 19:34:06 +00:00
compressFirmwareXz: fix symlink type check
The previous version didn't work in the case of relative symlinks in
subdirectories. If "foo/bar" was a link to "baz", it would check for
a link to "baz" in the root, rather than under "foo".
We don't need to dereference the symlink ourselves for [ anyway, as it
dereferences its arguments itself, so all we need to do to fix this is
to pass it the link.
Fixes: 14f83d5c6f
("compressFirmwareXz: fix links to directories")
This commit is contained in:
parent
9a9ed628da
commit
a136def4f7
@ -15,7 +15,7 @@ runCommand "${firmware.name}-xz" args ''
|
||||
sh -c 'xz -9c -T1 -C crc32 --lzma2=dict=2MiB "${firmware}/$1" > "$1.xz"' --)
|
||||
(cd ${firmware} && find lib/firmware -type l) | while read link; do
|
||||
target="$(readlink "${firmware}/$link")"
|
||||
if [ -f $target ]; then
|
||||
if [ -f "${firmware}/$link" ]; then
|
||||
ln -vs -- "''${target/^${firmware}/$out}.xz" "$out/$link.xz"
|
||||
else
|
||||
ln -vs -- "''${target/^${firmware}/$out}" "$out/$link"
|
||||
|
Loading…
Reference in New Issue
Block a user