Skip to content

Commit

Permalink
bug #781 Install recipes for packs before any others (nicolas-grekas)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.13-dev branch.

Discussion
----------

Install recipes for packs before any others

Commits
-------

b2a536c Install recipes for packs before any others
  • Loading branch information
fabpot committed Aug 20, 2021
2 parents d81196c + b2a536c commit 3682a58
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,8 @@ public function fetchRecipes(array $operations): array
'symfony/flex' => null,
'symfony/framework-bundle' => null,
];
$packRecipes = [];

foreach ($operations as $i => $operation) {
if ($operation instanceof UpdateOperation) {
$package = $operation->getTargetPackage();
Expand Down Expand Up @@ -843,7 +845,11 @@ public function fetchRecipes(array $operations): array
}

if (isset($manifests[$name])) {
$recipes[$name] = new Recipe($package, $name, $job, $manifests[$name], $locks[$name] ?? []);
if ('symfony-pack' === $package->getType()) {
$packRecipes[$name] = new Recipe($package, $name, $job, $manifests[$name], $locks[$name] ?? []);
} else {
$recipes[$name] = new Recipe($package, $name, $job, $manifests[$name], $locks[$name] ?? []);
}
}

$noRecipe = !isset($manifests[$name]) || (isset($manifests[$name]['not_installable']) && $manifests[$name]['not_installable']);
Expand All @@ -869,7 +875,7 @@ public function fetchRecipes(array $operations): array
}
}

return array_filter($recipes);
return array_merge($packRecipes, array_filter($recipes));
}

public function truncatePackages(PrePoolCreateEvent $event)
Expand Down

0 comments on commit 3682a58

Please sign in to comment.