diff options
Diffstat (limited to 'scripts/nix-push')
-rw-r--r-- | scripts/nix-push | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/nix-push b/scripts/nix-push index 731532f1e9a4..248a3b9174d6 100644 --- a/scripts/nix-push +++ b/scripts/nix-push @@ -27,11 +27,19 @@ foreach my $hash (@ARGV) { chomp $phash; die unless $phash =~ /^([0-9a-z]{32})$/; - # Construct a Fix expression that creates a Nar archive. + # Construct a name for the Nix archive. If the file is an + # fstate successor, encode this into the name. + my $name = $phash; + if ($path =~ /-s-([0-9a-z]{32}).nix$/) { + $name = "$name-s-$1"; + } + $name = $name . ".nar"; + + # Construct a Fix expression that creates a Nix archive. my $fixexpr = "App(IncludeFix(\"nar/nar.fix\"), " . "[ (\"path\", Path(\"$path\", Hash(\"$phash\"), [Include(\"$hash\")]))" . - ", (\"name\", \"$phash.nar\")" . + ", (\"name\", \"$name\")" . "])"; my $fixfile = "/tmp/nix-push-tmp.fix"; |