diff options
Diffstat (limited to 'scripts/nix-pull')
-rw-r--r-- | scripts/nix-pull | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/nix-pull b/scripts/nix-pull index 86d9f4b11..6404cb79a 100644 --- a/scripts/nix-pull +++ b/scripts/nix-pull @@ -7,6 +7,7 @@ my $tmpfile = "$prefix/var/nix/pull.tmp"; my $conffile = "$etcdir/prebuilts.conf"; my @subs; +my @sucs; open CONFFILE, "<$conffile"; @@ -30,8 +31,9 @@ while (<CONFFILE>) { my $fn = $1; next if $fn =~ /\.\./; next if $fn =~ /\//; - next unless $fn =~ /([0-9a-z]{32})-([0-9a-z]{32})\.nar/; - my $hash = $2; + next unless $fn =~ /-([0-9a-z]{32})(-s-([0-9a-z]{32}))?\.nar/; + my $hash = $1; + my $fshash = $3; print "registering $hash -> $url/$fn\n"; @@ -60,6 +62,12 @@ while (<CONFFILE>) { push @subs, $hash; push @subs, $nhash; + # Does the name encode a successor relation? + if (defined $fshash) { + print "NORMAL $fshash -> $hash\n"; + push @sucs, $fshash; + push @sucs, $hash; + } } close INDEX; @@ -71,3 +79,6 @@ while (<CONFFILE>) { system "nix --substitute @subs"; if ($?) { die "`nix --substitute' failed"; } + +system "nix --successor @sucs"; +if ($?) { die "`nix --successor' failed"; } |