* nix-pull: using nix-prefetch-url (so that we get caching for free),
and store the manifests in the Nix store. (So now /nix/var/nix/manifests/ just contains symlinks to the store and is searched for GC roots.)
This commit is contained in:
parent
f881f7a017
commit
c5e934dcc9
|
@ -35,11 +35,11 @@ init-state:
|
||||||
$(INSTALL) $(INIT_FLAGS) -d $(DESTDIR)$(localstatedir)/nix/temproots
|
$(INSTALL) $(INIT_FLAGS) -d $(DESTDIR)$(localstatedir)/nix/temproots
|
||||||
$(INSTALL) $(INIT_FLAGS) $(GROUP_WRITABLE) -d $(DESTDIR)$(localstatedir)/nix/gcroots/tmp
|
$(INSTALL) $(INIT_FLAGS) $(GROUP_WRITABLE) -d $(DESTDIR)$(localstatedir)/nix/gcroots/tmp
|
||||||
$(INSTALL) $(INIT_FLAGS) $(GROUP_WRITABLE) -d $(DESTDIR)$(localstatedir)/nix/gcroots/channels
|
$(INSTALL) $(INIT_FLAGS) $(GROUP_WRITABLE) -d $(DESTDIR)$(localstatedir)/nix/gcroots/channels
|
||||||
rm -f $(DESTDIR)$(localstatedir)/nix/gcroots/profiles
|
ln -sfn $(localstatedir)/nix/profiles $(DESTDIR)$(localstatedir)/nix/gcroots/profiles
|
||||||
ln -s $(localstatedir)/nix/profiles $(DESTDIR)$(localstatedir)/nix/gcroots/profiles
|
|
||||||
$(INSTALL) $(INIT_FLAGS) -d $(DESTDIR)$(localstatedir)/nix/userpool
|
$(INSTALL) $(INIT_FLAGS) -d $(DESTDIR)$(localstatedir)/nix/userpool
|
||||||
$(INSTALL) $(INIT_FLAGS) -m 1777 -d $(DESTDIR)$(prefix)/store
|
$(INSTALL) $(INIT_FLAGS) -m 1777 -d $(DESTDIR)$(prefix)/store
|
||||||
$(INSTALL) $(INIT_FLAGS) $(GROUP_WRITABLE) -d $(DESTDIR)$(localstatedir)/nix/manifests
|
$(INSTALL) $(INIT_FLAGS) $(GROUP_WRITABLE) -d $(DESTDIR)$(localstatedir)/nix/manifests
|
||||||
|
ln -sfn $(localstatedir)/nix/manifests $(DESTDIR)$(localstatedir)/nix/gcroots/manifests
|
||||||
# $(bindir)/nix-store --init
|
# $(bindir)/nix-store --init
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
|
@ -7,7 +7,7 @@ use readmanifest;
|
||||||
my $tmpDir = tempdir("nix-pull.XXXXXX", CLEANUP => 1, TMPDIR => 1)
|
my $tmpDir = tempdir("nix-pull.XXXXXX", CLEANUP => 1, TMPDIR => 1)
|
||||||
or die "cannot create a temporary directory";
|
or die "cannot create a temporary directory";
|
||||||
|
|
||||||
my $manifest = "$tmpDir/manifest";
|
#my $manifest = "$tmpDir/manifest";
|
||||||
|
|
||||||
my $binDir = $ENV{"NIX_BIN_DIR"};
|
my $binDir = $ENV{"NIX_BIN_DIR"};
|
||||||
$binDir = "@bindir@" unless defined $binDir;
|
$binDir = "@bindir@" unless defined $binDir;
|
||||||
|
@ -37,11 +37,12 @@ sub processURL {
|
||||||
my $url = shift;
|
my $url = shift;
|
||||||
|
|
||||||
$url =~ s/\/$//;
|
$url =~ s/\/$//;
|
||||||
print "obtaining list of Nix archives at $url...\n";
|
print "obtaining list of Nix archives at `$url'...\n";
|
||||||
|
|
||||||
system("@curl@ --fail -# --show-error --location --max-redirs 20 " .
|
$ENV{"PRINT_PATH"} = 1;
|
||||||
"'$url' > '$manifest'") == 0
|
$ENV{"QUIET"} = 1;
|
||||||
or die "curl failed: $?";
|
my ($dummy, $manifest) = `@bindir@/nix-prefetch-url '$url'`;
|
||||||
|
chomp $manifest;
|
||||||
|
|
||||||
if (readManifest($manifest, \%narFiles, \%localPaths, \%patches) < 3) {
|
if (readManifest($manifest, \%narFiles, \%localPaths, \%patches) < 3) {
|
||||||
die "manifest `$url' is too old (i.e., for Nix <= 0.7)\n";
|
die "manifest `$url' is too old (i.e., for Nix <= 0.7)\n";
|
||||||
|
@ -67,8 +68,8 @@ sub processURL {
|
||||||
|
|
||||||
my $finalPath = "$stateDir/manifests/$baseName-$hash.nixmanifest";
|
my $finalPath = "$stateDir/manifests/$baseName-$hash.nixmanifest";
|
||||||
|
|
||||||
system ("@coreutils@/mv", "-f", "$manifest", "$finalPath") == 0
|
system ("@coreutils@/ln", "-sfn", "$manifest", "$finalPath") == 0
|
||||||
or die "cannot move `$manifest' to `$finalPath";
|
or die "cannot link `$finalPath to `$manifest'";
|
||||||
}
|
}
|
||||||
|
|
||||||
while (@ARGV) {
|
while (@ARGV) {
|
||||||
|
|
Loading…
Reference in a new issue