about summary refs log tree commit diff
path: root/src/nix-channel/nix-channel.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-11-21T14·54+0100
committerEelco Dolstra <edolstra@gmail.com>2016-11-21T14·54+0100
commit7ee43df8622cc0589d54248fb44cebe1c1d991d2 (patch)
tree95778448ecdfbc1d8f4c254813cc5d91ed62a832 /src/nix-channel/nix-channel.cc
parent349e988903d9cf7559eb4732c2acb671670872c4 (diff)
nix-channel: Fix --update <CHANNELS>
This unbreaks "nixos-rebuild --upgrade".
Diffstat (limited to 'src/nix-channel/nix-channel.cc')
-rwxr-xr-xsrc/nix-channel/nix-channel.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc
index 5b4c2181996c..361627823126 100755
--- a/src/nix-channel/nix-channel.cc
+++ b/src/nix-channel/nix-channel.cc
@@ -76,10 +76,10 @@ static void update(const StringSet & channelNames)
     // Download each channel.
     auto exprs = Strings{};
     for (const auto & channel : channels) {
-        if (!channelNames.empty() && channelNames.find(channel.first) != channelNames.end())
-            continue;
         auto name = channel.first;
         auto url = channel.second;
+        if (!(channelNames.empty() || channelNames.count(name)))
+            continue;
 
         // We want to download the url to a file to see if it's a tarball while also checking if we
         // got redirected in the process, so that we can grab the various parts of a nix channel