Merge pull request #239658 from rnhmjoj/pr-compress-fw

compressFirmwareXz: preserve meta attributes
This commit is contained in:
Michele Guerini Rocco 2023-06-26 17:25:16 +02:00 committed by GitHub
commit 9e4e0807d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,12 @@
{ runCommand }:
{ runCommand, lib }:
firmware:
runCommand "${firmware.name}-xz" {} ''
let
args = lib.optionalAttrs (firmware ? meta) { inherit (firmware) meta; };
in
runCommand "${firmware.name}-xz" args ''
mkdir -p $out/lib
(cd ${firmware} && find lib/firmware -type d -print0) |
(cd $out && xargs -0 mkdir -v --)