1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 01:51:47 +02:00

* Nix can now fetch prebuilts (and other files) from the network, iff

a mapping from the hash to a url has been registered through `nix
  regurl'.

* Bug fix in nix: don't pollute stdout when running tar, it made
  nix-switch barf.

* Bug fix in nix-push-prebuilts: don't create a subdirectory on the
  target when rsync'ing.
This commit is contained in:
Eelco Dolstra 2003-05-26 09:44:18 +00:00
parent 13176d74cc
commit f8d91f20e6
6 changed files with 121 additions and 58 deletions

View file

@ -9,13 +9,25 @@ my $conffile = "$etcdir/prebuilts.conf";
sub register {
my $fn = shift;
my $url = shift;
return unless $fn =~ /([^\/]*)-([0-9a-z]{32})-([0-9a-z]{32})\.tar\.bz2/;
my $id = $1;
my $pkghash = $2;
my $prebuilthash = $3;
print "$pkghash => $prebuilthash ($id)\n";
system "nix regprebuilt $pkghash $prebuilthash";
if ($?) { die "`nix regprebuilt' failed"; }
if ($url =~ /^\//) {
system "nix regfile $url";
if ($?) { die "`nix regfile' failed"; }
} else {
system "nix regurl $prebuilthash $url";
if ($?) { die "`nix regurl' failed"; }
}
print KNOWNS "$pkghash\n";
}
@ -35,7 +47,7 @@ while (<CONFFILE>) {
# It's a local path.
foreach my $fn (glob "$url/*") {
register $fn;
register($fn, $fn);
}
} else {
@ -54,7 +66,7 @@ while (<CONFFILE>) {
my $fn = $1;
next if $fn =~ /\.\./;
next if $fn =~ /\//;
register $fn;
register($fn, "$url/$fn");
}
close INDEX;