Fix selection of best package to force update of dev packages, fixes #1252
parent
125ff3e4f5
commit
9856e9e3f5
|
@ -429,25 +429,31 @@ class Installer
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$newPackage = null;
|
// find similar packages (name/version) in all repositories
|
||||||
$matches = $pool->whatProvides($package->getName(), new VersionConstraint('=', $package->getVersion()));
|
$matches = $pool->whatProvides($package->getName(), new VersionConstraint('=', $package->getVersion()));
|
||||||
foreach ($matches as $match) {
|
foreach ($matches as $index => $match) {
|
||||||
// skip local packages
|
// skip local packages
|
||||||
if (!in_array($match->getRepository(), $repositories, true)) {
|
if (!in_array($match->getRepository(), $repositories, true)) {
|
||||||
|
unset($matches[$index]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip providers/replacers
|
// skip providers/replacers
|
||||||
if ($match->getName() !== $package->getName()) {
|
if ($match->getName() !== $package->getName()) {
|
||||||
|
unset($matches[$index]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$newPackage = $match;
|
$matches[$index] = $match->getId();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($newPackage && $newPackage->getSourceReference() !== $package->getSourceReference()) {
|
// select prefered package according to policy rules
|
||||||
$operations[] = new UpdateOperation($package, $newPackage);
|
if ($matches = $policy->selectPreferedPackages($pool, array(), $matches)) {
|
||||||
|
$newPackage = $pool->literalToPackage($matches[0]);
|
||||||
|
|
||||||
|
if ($newPackage && $newPackage->getSourceReference() !== $package->getSourceReference()) {
|
||||||
|
$operations[] = new UpdateOperation($package, $newPackage);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue