1
0
Fork 0

Revert "Added minor-only option to only show packages with minor updates"

This reverts commit 4b0e40d482.
pull/5552/head
Frank van den Brink 2016-08-26 10:32:57 +02:00
parent 4b0e40d482
commit 28851ecdca
No known key found for this signature in database
GPG Key ID: F6CBCF6CB657D94D
1 changed files with 5 additions and 17 deletions

View File

@ -71,7 +71,6 @@ class ShowCommand extends BaseCommand
new InputOption('tree', 't', InputOption::VALUE_NONE, 'List the dependencies as a tree'),
new InputOption('latest', 'l', InputOption::VALUE_NONE, 'Show the latest version'),
new InputOption('outdated', 'o', InputOption::VALUE_NONE, 'Show the latest version but only for packages that are outdated'),
new InputOption('minor-only', 'm', InputOption::VALUE_NONE, 'Show only packages which have minor updates. Use in combination with --outdated'),
new InputOption('direct', 'D', InputOption::VALUE_NONE, 'Shows only packages that are directly required by the root package'),
))
->setHelp(<<<EOT
@ -315,11 +314,6 @@ EOT
if ($showLatest && isset($latestPackages[$package->getPrettyName()])) {
$latestPackackage = $latestPackages[$package->getPrettyName()];
}
if ($input->getOption('outdated') && $input->getOption('minor-only') && $latestPackackage && (!$this->isImmediateSemverCompliantUpgradeNeeded($package, $latestPackackage) || $latestPackackage->isAbandoned())) {
continue;
}
if ($input->getOption('outdated') && $latestPackackage && $latestPackackage->getFullPrettyVersion() === $package->getFullPrettyVersion() && !$latestPackackage->isAbandoned()) {
continue;
}
@ -396,7 +390,11 @@ EOT
return 'info';
}
if ($this->isImmediateSemverCompliantUpgradeNeeded($package, $latestPackage)) {
$constraint = $package->getVersion();
if (0 !== strpos($constraint, 'dev-')) {
$constraint = '^'.$constraint;
}
if ($latestPackage->getVersion() && Semver::satisfies($latestPackage->getVersion(), $constraint)) {
// print red as it needs an immediate semver-compliant upgrade
return 'highlight';
}
@ -405,16 +403,6 @@ EOT
return 'comment';
}
protected function isImmediateSemverCompliantUpgradeNeeded(PackageInterface $package, PackageInterface $latestPackage)
{
$constraint = $package->getVersion();
if (0 !== strpos($constraint, 'dev-')) {
$constraint = '^'.$constraint;
}
return $latestPackage->getVersion() && Semver::satisfies($latestPackage->getVersion(), $constraint);
}
/**
* finds a package by name and version if provided
*