diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-13T15·35-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-09-13T15·35-0400 |
commit | b14717ab9003452fda7afe0f9627673b9f331569 (patch) | |
tree | b2eaea17f4945a484cf5875918afd39bc55e096e /scripts/nix-pull.in | |
parent | 6c4ac299173e3b9772c96bef1e6463b22dcd0227 (diff) |
Delete manifests in "nix-channel --remove" or when a binary cache is available
Diffstat (limited to 'scripts/nix-pull.in')
-rwxr-xr-x | scripts/nix-pull.in | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in index e59a38eec79f..fbd90c2b257d 100755 --- a/scripts/nix-pull.in +++ b/scripts/nix-pull.in @@ -76,26 +76,15 @@ sub processURL { open URL, ">$urlFile" or die "cannot create `$urlFile'"; print URL $origUrl; close URL; - + my $finalPath = "$manifestDir/$baseName-$hash.nixmanifest"; unlink $finalPath if -e $finalPath; - + symlink("$manifest", "$finalPath") or die "cannot link `$finalPath to `$manifest'"; - # Delete all old manifests downloaded from this URL. - for my $urlFile2 (glob "$manifestDir/*.url") { - next if $urlFile eq $urlFile2; - open URL, "<$urlFile2" or die; - my $url2 = <URL>; - chomp $url2; - close URL; - next unless $origUrl eq $url2; - my $base = $urlFile2; $base =~ s/.url$//; - unlink "${base}.url"; - unlink "${base}.nixmanifest"; - } + deleteOldManifests($origUrl, $urlFile); } while (@ARGV) { |