From bae75ca5a18edbb9fb959e2e48065a1987ffb61a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 23 Jan 2007 16:50:19 +0000 Subject: * 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. --- scripts/download-using-manifests.pl.in | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scripts/download-using-manifests.pl.in') diff --git a/scripts/download-using-manifests.pl.in b/scripts/download-using-manifests.pl.in index e02d82c140f7..65ab36084ab9 100644 --- a/scripts/download-using-manifests.pl.in +++ b/scripts/download-using-manifests.pl.in @@ -34,17 +34,31 @@ print "\n*** Trying to download/patch `$targetPath'\n"; # Load all manifests. my %narFiles; +my %localPaths; my %patches; for my $manifest (glob "$manifestDir/*.nixmanifest") { # print STDERR "reading $manifest\n"; - if (readManifest($manifest, \%narFiles, \%patches) < 3) { + if (readManifest($manifest, \%narFiles, \%localPaths, \%patches) < 3) { print STDERR "you have an old-style manifest `$manifest'; please delete it\n"; exit 1; } } +# If we can copy from a local path, do that. +my $localPathList = $localPaths{$targetPath}; +foreach my $localPath (@{$localPathList}) { + my $sourcePath = $localPath->{copyFrom}; + if (-e $sourcePath) { + print "\n*** Step 1/1: copying from $sourcePath\n"; + system("@bindir@/nix-store --dump $sourcePath | @bindir@/nix-store --restore $targetPath") == 0 + or die "cannot copy `$sourcePath' to `$targetPath'"; + exit 0; + } +} + + # Build a graph of all store paths that might contribute to the # construction of $targetPath, and the special node "start". The # edges are either patch operations, or downloads of full NAR files. -- cgit 1.4.1