mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
compressFirmwareXz: fix links to directories
Only add the `.xz` suffix to links if link target is a regular file. This breaks if the target is a directory. Fixes #283005.
This commit is contained in:
parent
379bf3e0e6
commit
14f83d5c6f
@ -15,6 +15,10 @@ 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")"
|
||||
ln -vs -- "''${target/^${firmware}/$out}.xz" "$out/$link.xz"
|
||||
if [ -f $target ]; then
|
||||
ln -vs -- "''${target/^${firmware}/$out}.xz" "$out/$link.xz"
|
||||
else
|
||||
ln -vs -- "''${target/^${firmware}/$out}" "$out/$link"
|
||||
fi
|
||||
done
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user