Fix incorrect --no-dev handling of replaced packages
parent
5aff184fbc
commit
339ee953e5
|
@ -939,16 +939,23 @@ INITIALIZER;
|
||||||
{
|
{
|
||||||
$packages = array();
|
$packages = array();
|
||||||
$include = array();
|
$include = array();
|
||||||
|
$replacedBy = array();
|
||||||
|
|
||||||
foreach ($packageMap as $item) {
|
foreach ($packageMap as $item) {
|
||||||
$package = $item[0];
|
$package = $item[0];
|
||||||
$name = $package->getName();
|
$name = $package->getName();
|
||||||
$packages[$name] = $package;
|
$packages[$name] = $package;
|
||||||
|
foreach ($package->getReplaces() as $replace) {
|
||||||
|
$replacedBy[$replace->getTarget()] = $name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$add = function (PackageInterface $package) use (&$add, $packages, &$include) {
|
$add = function (PackageInterface $package) use (&$add, $packages, &$include, $replacedBy) {
|
||||||
foreach ($package->getRequires() as $link) {
|
foreach ($package->getRequires() as $link) {
|
||||||
$target = $link->getTarget();
|
$target = $link->getTarget();
|
||||||
|
if (isset($replacedBy[$target])) {
|
||||||
|
$target = $replacedBy[$target];
|
||||||
|
}
|
||||||
if (!isset($include[$target])) {
|
if (!isset($include[$target])) {
|
||||||
$include[$target] = true;
|
$include[$target] = true;
|
||||||
if (isset($packages[$target])) {
|
if (isset($packages[$target])) {
|
||||||
|
|
Loading…
Reference in New Issue