forked from lix-project/lix
Hack to prevent accumulation of old manifests
This commit is contained in:
parent
1132dd27ea
commit
8cf1719e3e
|
@ -88,6 +88,7 @@ sub update {
|
||||||
my $exprs = "";
|
my $exprs = "";
|
||||||
foreach my $name (keys %channels) {
|
foreach my $name (keys %channels) {
|
||||||
my $url = $channels{$name};
|
my $url = $channels{$name};
|
||||||
|
my $origUrl = $url;
|
||||||
|
|
||||||
# Check if $url is a redirect. If so, follow it now to ensure
|
# Check if $url is a redirect. If so, follow it now to ensure
|
||||||
# consistency if the redirection is changed between
|
# consistency if the redirection is changed between
|
||||||
|
@ -98,6 +99,7 @@ sub update {
|
||||||
$url = $1 if $headers =~ /^Location:\s*(.*)\s*$/m;
|
$url = $1 if $headers =~ /^Location:\s*(.*)\s*$/m;
|
||||||
|
|
||||||
# Pull the channel manifest.
|
# Pull the channel manifest.
|
||||||
|
$ENV{'NIX_ORIG_URL'} = $origUrl;
|
||||||
system("$Nix::Config::binDir/nix-pull", "--skip-wrong-store", "$url/MANIFEST") == 0
|
system("$Nix::Config::binDir/nix-pull", "--skip-wrong-store", "$url/MANIFEST") == 0
|
||||||
or die "cannot pull manifest from `$url'\n";
|
or die "cannot pull manifest from `$url'\n";
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ sub processURL {
|
||||||
|
|
||||||
my $urlFile = "$manifestDir/$baseName-$hash.url";
|
my $urlFile = "$manifestDir/$baseName-$hash.url";
|
||||||
open URL, ">$urlFile" or die "cannot create `$urlFile'";
|
open URL, ">$urlFile" or die "cannot create `$urlFile'";
|
||||||
print URL "$url";
|
print URL ($ENV{'NIX_ORIG_URL'} || $url);
|
||||||
close URL;
|
close URL;
|
||||||
|
|
||||||
my $finalPath = "$manifestDir/$baseName-$hash.nixmanifest";
|
my $finalPath = "$manifestDir/$baseName-$hash.nixmanifest";
|
||||||
|
|
Loading…
Reference in a new issue