diff options
Diffstat (limited to 'scripts/nix-pack-closure.in')
-rw-r--r-- | scripts/nix-pack-closure.in | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/nix-pack-closure.in b/scripts/nix-pack-closure.in index 6c0e85d2a69a..bc58097e25c1 100644 --- a/scripts/nix-pack-closure.in +++ b/scripts/nix-pack-closure.in @@ -21,6 +21,7 @@ mkdir "$tmpDir/contents", 0777 or die; mkdir "$tmpDir/references", 0777 or die; mkdir "$tmpDir/derivers", 0777 or die; +open TOPLEVEL, ">$tmpDir/top-level" or die; my %storePaths; @@ -29,6 +30,12 @@ my %storePaths; while (@ARGV) { my $storePath = shift @ARGV; + # $storePath might be a symlink to the store, so resolve it. + $storePath = (`$binDir/nix-store --query --resolve '$storePath'` + or die "cannot resolve `$storePath'"); + chomp $storePath; + print TOPLEVEL $storePath, "\n"; + # Get the closure of this path. my $pid = open(READ, "$binDir/nix-store --query --requisites '$storePath'|") or die; |