about summary refs log tree commit diff
path: root/scripts/nix-channel.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-13T15·35-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-13T15·35-0400
commitb14717ab9003452fda7afe0f9627673b9f331569 (patch)
treeb2eaea17f4945a484cf5875918afd39bc55e096e /scripts/nix-channel.in
parent6c4ac299173e3b9772c96bef1e6463b22dcd0227 (diff)
Delete manifests in "nix-channel --remove" or when a binary cache is available
Diffstat (limited to 'scripts/nix-channel.in')
-rwxr-xr-xscripts/nix-channel.in4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in
index e057cc91671a..7e50dac1e3a9 100755
--- a/scripts/nix-channel.in
+++ b/scripts/nix-channel.in
@@ -4,6 +4,7 @@ use strict;
 use File::Basename;
 use File::Path qw(mkpath);
 use Nix::Config;
+use Nix::Manifest;
 
 my $manifestDir = $Nix::Config::manifestDir;
 
@@ -65,6 +66,8 @@ sub addChannel {
 sub removeChannel {
     my ($name) = @_;
     readChannels;
+    my $url = $channels{$name};
+    deleteOldManifests($url . "/MANIFEST", undef) if defined $url;
     delete $channels{$name};
     writeChannels;
 
@@ -101,6 +104,7 @@ sub update {
         my $extraAttrs = "";
         if ($? == 0 && $binaryCacheURL ne "") {
             $extraAttrs .= "binaryCacheURL = \"$binaryCacheURL\"; ";
+            deleteOldManifests($origUrl, undef);
         } else {
             # No binary cache, so pull the channel manifest.
             mkdir $manifestDir, 0755 unless -e $manifestDir;