about summary refs log tree commit diff
path: root/scripts/nix-channel.in
diff options
context:
space:
mode:
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;