mirror of
https://github.com/NixOS/nix
synced 2025-06-24 22:11:15 +02:00
* Substitutes now should produce a path with the same id as they are
substituting for (obvious, really). * For greater efficiency, nix-pull/unnar will place the output in a path that is probably the same as what is actually needed, thus preventing a path copy. * Even if a output id is given in a Fix package expression, ensure that the resulting Nix derive expression has a different id. This is because Nix expressions that are semantically equivalent (i.e., build the same result) might be different w.r.t. efficiency or divergence. It is absolutely vital for the substitute mechanism that such expressions are not used interchangeably.
This commit is contained in:
parent
df648c4967
commit
e877c69d78
8 changed files with 86 additions and 50 deletions
|
@ -28,10 +28,18 @@ while (<CONFFILE>) {
|
|||
my $fn = $1;
|
||||
next if $fn =~ /\.\./;
|
||||
next if $fn =~ /\//;
|
||||
next unless $fn =~ /^([0-9a-z]{32})-([0-9a-z]{32})(-s-([0-9a-z]{32}))?.*\.nar\.bz2$/;
|
||||
next unless $fn =~ /^([0-9a-z]{32})-([0-9a-z]{32})(.*)\.nar\.bz2$/;
|
||||
my $hash = $1;
|
||||
my $id = $2;
|
||||
my $fsid = $4;
|
||||
my $id = $2;
|
||||
my $outname = $3;
|
||||
my $fsid;
|
||||
if ($outname =~ /^-/) {
|
||||
next unless $outname =~ /^-((s-([0-9a-z]{32}))?.*)$/;
|
||||
$outname = $1;
|
||||
$fsid = $3;
|
||||
} else {
|
||||
$outname = "";
|
||||
}
|
||||
|
||||
print "registering $id -> $url/$fn\n";
|
||||
|
||||
|
@ -43,7 +51,8 @@ while (<CONFFILE>) {
|
|||
my $fixexpr =
|
||||
"App(IncludeFix(\"nar/unnar.fix\"), " .
|
||||
"[ (\"nar\", $fetch)" .
|
||||
", (\"name\", \"fetched-$id\")" .
|
||||
", (\"name\", \"$outname\")" .
|
||||
", (\"id\", \"$id\")" .
|
||||
"])";
|
||||
|
||||
my $fixfile = "/tmp/nix-pull-tmp.fix";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue