Repository: conda/conda

Issue:
Conda 4.4 doesn't support --platform flag correctly?
For example, the portpicker package is not available for Windows. But it still reports it:
```
(base) [nwani@centos6x64 aggregate]$ conda search portpicker --platform win-64
Loading channels: done
Name                       Version                   Build  Channel
portpicker                 1.2.0            py27h86e0a49_0  https://repo.continuum.io/pkgs/main
portpicker                 1.2.0            py35h8f64c34_0  https://repo.continuum.io/pkgs/main
portpicker                 1.2.0            py36h7b3aa6a_0  https://repo.continuum.io/pkgs/main
```

Conda 4.3 is right here:
```
(root) [nwani@some-machine test-pkgs-nwani]$ conda search portpicker --platform win-64
Fetching package metadata ...........

PackageNotFoundError: Packages missing in current channels:

  - portpicker

We have searched for the packages in the following channels:

  - https://repo.continuum.io/pkgs/main/linux-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/linux-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/linux-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/linux-64
  - https://repo.continuum.io/pkgs/pro/noarch
```


Discussion:
Equivalent syntax in conda 4.4 is

    conda search */win-64::portpicker
    conda search portpicker[subdir=win-64]
I'm not seeing what you are I don't think

```
kfranz@0283:~/continuum/conda *4.4.x ❯ python -m conda search portpicker --platform win-64
Loading channels: done

PackagesNotFoundError: The following packages are not available from current channels:

  - portpicker

Current channels:

  - https://repo.continuum.io/pkgs/main/osx-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/osx-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/osx-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/osx-64
  - https://repo.continuum.io/pkgs/pro/noarch


(1)kfranz@0283:~/continuum/conda *4.4.x ❯ python -m conda search */win-64::portpicker
Loading channels: done

PackagesNotFoundError: The following packages are not available from current channels:

  - portpicker[subdir=win-64]

Current channels:

  - https://repo.continuum.io/pkgs/main/osx-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/osx-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/osx-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/osx-64
  - https://repo.continuum.io/pkgs/pro/noarch


(1)kfranz@0283:~/continuum/conda *4.4.x ❯ python -m conda search */linux-64::portpicker
Loading channels: done
Name                       Version                   Build  Channel
portpicker                 1.1.1                    py27_0  defaults
portpicker                 1.1.1                    py35_0  defaults
portpicker                 1.1.1                    py36_0  defaults
portpicker                 1.2.0            py27h86e0a49_0  defaults
portpicker                 1.2.0            py35h8f64c34_0  defaults
portpicker                 1.2.0            py36h7b3aa6a_0  defaults
```

However, I do see that the error message is wrong.  The error message is giving `osx-64` subdirs even though I'm specifying something else.

Resolving patch:
diff --git a/conda/cli/main_search.py b/conda/cli/main_search.py
--- a/conda/cli/main_search.py
+++ b/conda/cli/main_search.py
@@ -36,7 +36,7 @@ def execute(args, parser):
         channels_urls = tuple(calculate_channel_urls(
             channel_urls=context.channels,
             prepend=not args.override_channels,
-            platform=None,
+            platform=subdirs[0],
             use_local=args.use_local,
         ))
         from ..exceptions import PackagesNotFoundError


Test patch: