1
0
Fork 0

Fix show --all showing only the installed version if the package is installed, fixes #10095

pull/10150/head
Jordi Boggiano 2021-10-02 22:15:34 +02:00
parent a7963b7fed
commit 532c6e7933
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 2 additions and 1 deletions

View File

@ -27,6 +27,7 @@ use Composer\Plugin\PluginEvents;
use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\ComposerRepository;
use Composer\Repository\CompositeRepository;
use Composer\Repository\FilterRepository;
use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryFactory;
use Composer\Repository\InstalledRepository;
@ -184,7 +185,7 @@ EOT
} else {
$installedRepo = new InstalledRepository(array($localRepo, $platformRepo));
}
$repos = new CompositeRepository(array_merge(array($installedRepo), $composer->getRepositoryManager()->getRepositories()));
$repos = new CompositeRepository(array_merge(array(new FilterRepository($installedRepo, array('canonical' => false))), $composer->getRepositoryManager()->getRepositories()));
} elseif ($input->getOption('all')) {
$defaultRepos = RepositoryFactory::defaultRepos($io);
$io->writeError('No composer.json found in the current directory, showing available packages from ' . implode(', ', array_keys($defaultRepos)));