1
0
Fork 0

Make sure the alias package gets added to conflict rules etc, and only add it if aliased package is actually added

pull/9473/head
Jordi Boggiano 2020-11-13 14:16:37 +01:00
parent 7b183956d8
commit b7e1383083
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 4 additions and 3 deletions

View File

@ -262,13 +262,14 @@ class RuleSetGenerator
} }
} }
protected function addRulesForRootAliases() protected function addRulesForRootAliases($ignorePlatformReqs)
{ {
foreach ($this->pool->getPackages() as $package) { foreach ($this->pool->getPackages() as $package) {
// if it is a root alias, make sure that if the aliased version gets installed // if it is a root alias, make sure that if the aliased version gets installed
// the alias must be installed too // the alias must be installed too
if ($package instanceof AliasPackage && $package->isRootPackageAlias()) { if ($package instanceof AliasPackage && $package->isRootPackageAlias() && isset($this->addedMap[$package->getAliasOf()->id])) {
$this->addRule(RuleSet::TYPE_PACKAGE, $this->createRequireRule($package->getAliasOf(), array($package), Rule::RULE_PACKAGE_REQUIRES, $package->getAliasOf())); $this->addRule(RuleSet::TYPE_PACKAGE, $this->createRequireRule($package->getAliasOf(), array($package), Rule::RULE_PACKAGE_REQUIRES, $package->getAliasOf()));
$this->addRulesForPackage($package, $ignorePlatformReqs);
} }
} }
} }
@ -288,7 +289,7 @@ class RuleSetGenerator
$this->addRulesForRequest($request, $ignorePlatformReqs); $this->addRulesForRequest($request, $ignorePlatformReqs);
$this->addRulesForRootAliases(); $this->addRulesForRootAliases($ignorePlatformReqs);
$this->addConflictRules($ignorePlatformReqs); $this->addConflictRules($ignorePlatformReqs);