Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkgs/build-support/compress-drv/default.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
lib,
xorg,
runCommand,
}:
{ lib, runCommand }:
/**
Compresses files of a given derivation, and returns a new derivation with
compressed files
Expand Down Expand Up @@ -72,7 +68,11 @@ let
in
runCommand "${drv.name}-compressed" { } ''
mkdir $out
(cd $out; ${xorg.lndir}/bin/lndir ${drv})

# cannot use lndir here, because it also symlinks directories,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That comment is wrong. lndir never symlinks directories directly. Only if they are a symlink and then the input file is technically not a directory but a symlink to a directory.

# which we do not need; we only need to symlink files.
(cd ${drv}; find -L -type d -exec mkdir -p $out/{} ';')
(cd ${drv}; find -L -type f -exec ln -s ${drv}/{} $out/{} ';')
Comment on lines +72 to +75
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also just find this so much easier to reason about than lndir. I'm glad to see the return.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is just how lndir functions, that it doesn't recurse into other symlinks. Probably mainly to avoid symlink loops?


${lib.concatStringsSep "\n\n" (lib.mapAttrsToList mkCmd compressors)}
''
2 changes: 1 addition & 1 deletion pkgs/by-name/gi/gitea/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ in buildGoModule rec {
'';

passthru = {
data-compressed = lib.warn "gitea.passthru.data-compressed is deprecated. Use \"compressDrvWeb gitea.data\"." (compressDrvWeb gitea.data);
data-compressed = lib.warn "gitea.passthru.data-compressed is deprecated. Use \"compressDrvWeb gitea.data\"." (compressDrvWeb gitea.data {});

tests = nixosTests.gitea;
};
Expand Down