1
0
Fork 0

Avoid showing alias versions in show command, show the original version

pull/9286/head
Jordi Boggiano 2020-10-14 15:41:36 +02:00
parent 7e223104c7
commit da1357c663
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,7 @@ use Composer\Json\JsonFile;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\CompletePackageInterface; use Composer\Package\CompletePackageInterface;
use Composer\Package\Link; use Composer\Package\Link;
use Composer\Package\AliasPackage;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Package\Version\VersionParser; use Composer\Package\Version\VersionParser;
use Composer\Package\Version\VersionSelector; use Composer\Package\Version\VersionSelector;
@ -365,6 +366,9 @@ EOT
|| !is_object($packages[$type][$package->getName()]) || !is_object($packages[$type][$package->getName()])
|| version_compare($packages[$type][$package->getName()]->getVersion(), $package->getVersion(), '<') || version_compare($packages[$type][$package->getName()]->getVersion(), $package->getVersion(), '<')
) { ) {
while ($package instanceof AliasPackage) {
$package = $package->getAliasOf();
}
if (!$packageFilterRegex || preg_match($packageFilterRegex, $package->getName())) { if (!$packageFilterRegex || preg_match($packageFilterRegex, $package->getName())) {
if (!$packageListFilter || in_array($package->getName(), $packageListFilter, true)) { if (!$packageListFilter || in_array($package->getName(), $packageListFilter, true)) {
$packages[$type][$package->getName()] = $package; $packages[$type][$package->getName()] = $package;