@@ -306,6 +306,14 @@ public function configureInstaller()
306
306
foreach ($ backtrace as $ trace ) {
307
307
if (isset ($ trace ['object ' ]) && $ trace ['object ' ] instanceof Installer) {
308
308
$ this ->installer = $ trace ['object ' ]->setSuggestedPackagesReporter (new SuggestedPackagesReporter (new NullIO ()));
309
+
310
+ $ updateAllowList = \Closure::bind (function () {
311
+ return $ this ->updateWhitelist ?? $ this ->updateAllowList ;
312
+ }, $ this ->installer , $ this ->installer )();
313
+
314
+ if (['php ' => 0 ] === $ updateAllowList ) {
315
+ $ this ->dryRun = true ; // prevent recipes from being uninstalled when removing a pack
316
+ }
309
317
}
310
318
311
319
if (isset ($ trace ['object ' ]) && $ trace ['object ' ] instanceof GlobalCommand) {
@@ -754,6 +762,7 @@ public function fetchRecipes(array $operations, bool $reset): array
754
762
$ recipes = [
755
763
'symfony/framework-bundle ' => null ,
756
764
];
765
+ $ packRecipes = [];
757
766
$ metaRecipes = [];
758
767
759
768
foreach ($ operations as $ operation ) {
@@ -803,12 +812,16 @@ public function fetchRecipes(array $operations, bool $reset): array
803
812
}
804
813
805
814
if (isset ($ manifests [$ name ])) {
806
- if ('metapackage ' === $ package ->getType ()) {
807
- $ metaRecipes [$ name ] = new Recipe ($ package , $ name , $ job , $ manifests [$ name ], $ locks [$ name ] ?? []);
815
+ $ recipe = new Recipe ($ package , $ name , $ job , $ manifests [$ name ], $ locks [$ name ] ?? []);
816
+
817
+ if ('symfony-pack ' === $ package ->getType ()) {
818
+ $ packRecipes [$ name ] = $ recipe ;
819
+ } elseif ('metapackage ' === $ package ->getType ()) {
820
+ $ metaRecipes [$ name ] = $ recipe ;
808
821
} elseif ('symfony/flex ' === $ name ) {
809
- $ flexRecipe = [$ name => new Recipe ( $ package , $ name , $ job , $ manifests [ $ name ], $ locks [ $ name ] ?? []) ];
822
+ $ flexRecipe = [$ name => $ recipe ];
810
823
} else {
811
- $ recipes [$ name ] = new Recipe ( $ package , $ name , $ job , $ manifests [ $ name ], $ locks [ $ name ] ?? []) ;
824
+ $ recipes [$ name ] = $ recipe ;
812
825
}
813
826
}
814
827
@@ -834,7 +847,7 @@ public function fetchRecipes(array $operations, bool $reset): array
834
847
}
835
848
}
836
849
837
- return array_merge ($ flexRecipe , $ metaRecipes , array_filter ($ recipes ));
850
+ return array_merge ($ flexRecipe , $ packRecipes , $ metaRecipes , array_filter ($ recipes ));
838
851
}
839
852
840
853
public function truncatePackages (PrePoolCreateEvent $ event )
0 commit comments