diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2007-01-23 16:50:19 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2007-01-23 16:50:19 +0000 |
commit | bae75ca5a18edbb9fb959e2e48065a1987ffb61a (patch) | |
tree | c1b169f6f290cb1e4c412a61051dd3a1ee987bc5 /scripts/nix-pull.in | |
parent | 36d9258c0dbfeab095dc5727b6ebcb55afacb0a6 (diff) |
* New kind of manifest object: "localPath", which denotes that a store
path can be created by copying it from another location in the file
system. This is useful in the NixOS installation.
Diffstat (limited to 'scripts/nix-pull.in')
-rw-r--r-- | scripts/nix-pull.in | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in index 21fa30c61..46f9f147c 100644 --- a/scripts/nix-pull.in +++ b/scripts/nix-pull.in @@ -28,6 +28,7 @@ umask 0022; # Process the URLs specified on the command line. my %narFiles; +my %localPaths; my %patches; my $skipWrongStore = 0; @@ -42,7 +43,7 @@ sub processURL { "'$url' > '$manifest'") == 0 or die "curl failed: $?"; - if (readManifest($manifest, \%narFiles, \%patches) < 3) { + if (readManifest($manifest, \%narFiles, \%localPaths, \%patches) < 3) { die "manifest `$url' is too old (i.e., for Nix <= 0.7)\n"; } @@ -80,7 +81,7 @@ while (@ARGV) { } -my $size = scalar (keys %narFiles); +my $size = scalar (keys %narFiles) + scalar (keys %localPaths); print "$size store paths in manifest\n"; @@ -90,19 +91,32 @@ print STDERR "registering substitutes...\n"; my $pid = open(WRITE, "|$binDir/nix-store --register-substitutes") or die "cannot run nix-store"; +sub writeRegistration { + my $storePath = shift; + my $object = shift; + print WRITE "$storePath\n"; + print WRITE "$object->{deriver}\n"; + print WRITE "$libexecDir/nix/download-using-manifests.pl\n"; + print WRITE "0\n"; + my @references = split " ", $object->{references}; + my $count = scalar @references; + print WRITE "$count\n"; + foreach my $reference (@references) { + print WRITE "$reference\n"; + } +} + foreach my $storePath (keys %narFiles) { my $narFileList = $narFiles{$storePath}; foreach my $narFile (@{$narFileList}) { - print WRITE "$storePath\n"; - print WRITE "$narFile->{deriver}\n"; - print WRITE "$libexecDir/nix/download-using-manifests.pl\n"; - print WRITE "0\n"; - my @references = split " ", $narFile->{references}; - my $count = scalar @references; - print WRITE "$count\n"; - foreach my $reference (@references) { - print WRITE "$reference\n"; - } + writeRegistration $storePath, $narFile; + } +} + +foreach my $storePath (keys %localPaths) { + my $localPathList = $localPaths{$storePath}; + foreach my $localPath (@{$localPathList}) { + writeRegistration $storePath, $localPath; } } |