Skip to content

Commit

Permalink
Added support for recipes conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
HeahDude committed Dec 20, 2018
1 parent faca898 commit 7ae43a1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Flex.php
Expand Up @@ -587,6 +587,18 @@ private function fetchRecipes(): array
$name = $package->getNames()[0];
$job = $operation->getJobType();

if (!empty($manifests[$name]['manifest']['conflict']) && !$operation instanceof UninstallOperation) {
$lockedRepository = $this->composer->getLocker()->getLockedRepository();

foreach ($manifests[$name]['manifest']['conflict'] as $conflictingPackage => $constraint) {
if ($lockedRepository->findPackage($conflictingPackage, $constraint)) {
$this->io->writeError(sprintf(' - Skipping recipe for %s: it conflicts with %s %s.', $name, $conflictingPackage, $constraint), true, IOInterface::VERBOSE);

continue 2;
}
}
}

if ($operation instanceof InstallOperation && isset($locks[$name])) {
$ref = $this->lock->get($name)['recipe']['ref'] ?? null;
if ($ref && ($locks[$name]['recipe']['ref'] ?? null) === $ref) {
Expand Down

0 comments on commit 7ae43a1

Please sign in to comment.