Skip to content

Commit 3682a58

Browse files
committed
bug #781 Install recipes for packs before any others (nicolas-grekas)
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
2 parents d81196c + b2a536c commit 3682a58

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Flex.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,8 @@ public function fetchRecipes(array $operations): array
806806
'symfony/flex' => null,
807807
'symfony/framework-bundle' => null,
808808
];
809+
$packRecipes = [];
810+
809811
foreach ($operations as $i => $operation) {
810812
if ($operation instanceof UpdateOperation) {
811813
$package = $operation->getTargetPackage();
@@ -843,7 +845,11 @@ public function fetchRecipes(array $operations): array
843845
}
844846

845847
if (isset($manifests[$name])) {
846-
$recipes[$name] = new Recipe($package, $name, $job, $manifests[$name], $locks[$name] ?? []);
848+
if ('symfony-pack' === $package->getType()) {
849+
$packRecipes[$name] = new Recipe($package, $name, $job, $manifests[$name], $locks[$name] ?? []);
850+
} else {
851+
$recipes[$name] = new Recipe($package, $name, $job, $manifests[$name], $locks[$name] ?? []);
852+
}
847853
}
848854

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

872-
return array_filter($recipes);
878+
return array_merge($packRecipes, array_filter($recipes));
873879
}
874880

875881
public function truncatePackages(PrePoolCreateEvent $event)

0 commit comments

Comments
 (0)