From 8cf1719e3e02998c0d22ed9e505a4a98e3335627 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 16 Apr 2012 19:52:31 +0200 Subject: [PATCH] Hack to prevent accumulation of old manifests --- scripts/nix-channel.in | 2 ++ scripts/nix-pull.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in index 64e5aa0128..2bf5e633e8 100755 --- a/scripts/nix-channel.in +++ b/scripts/nix-channel.in @@ -88,6 +88,7 @@ sub update { my $exprs = ""; foreach my $name (keys %channels) { my $url = $channels{$name}; + my $origUrl = $url; # Check if $url is a redirect. If so, follow it now to ensure # consistency if the redirection is changed between @@ -98,6 +99,7 @@ sub update { $url = $1 if $headers =~ /^Location:\s*(.*)\s*$/m; # Pull the channel manifest. + $ENV{'NIX_ORIG_URL'} = $origUrl; system("$Nix::Config::binDir/nix-pull", "--skip-wrong-store", "$url/MANIFEST") == 0 or die "cannot pull manifest from `$url'\n"; diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in index 084197c48a..8d5db2f57c 100755 --- a/scripts/nix-pull.in +++ b/scripts/nix-pull.in @@ -72,7 +72,7 @@ sub processURL { my $urlFile = "$manifestDir/$baseName-$hash.url"; open URL, ">$urlFile" or die "cannot create `$urlFile'"; - print URL "$url"; + print URL ($ENV{'NIX_ORIG_URL'} || $url); close URL; my $finalPath = "$manifestDir/$baseName-$hash.nixmanifest";