@@ -350,7 +350,7 @@ public function postInstall(PackageEvent $event)
350
350
$ patch ->url = $ providing_install_path .'/ ' .$ patch ->url ;
351
351
}
352
352
353
- $ this ->getAndApplyPatch ($ downloader , $ install_path , $ patch ->url );
353
+ $ this ->getAndApplyPatch ($ downloader , $ install_path , $ patch ->url , $ package );
354
354
$ this ->eventDispatcher ->dispatch (
355
355
null ,
356
356
new PatchEvent (PatchEvents::POST_PATCH_APPLY , $ package , $ patch ->url , $ patch ->description )
@@ -396,9 +396,10 @@ protected function getPackageFromOperation(OperationInterface $operation)
396
396
* @param RemoteFilesystem $downloader
397
397
* @param $install_path
398
398
* @param $patch_url
399
+ * @param PackageInterface $package
399
400
* @throws \Exception
400
401
*/
401
- protected function getAndApplyPatch (RemoteFilesystem $ downloader , $ install_path , $ patch_url )
402
+ protected function getAndApplyPatch (RemoteFilesystem $ downloader , $ install_path , $ patch_url, PackageInterface $ package )
402
403
{
403
404
404
405
// Local patch file.
@@ -418,6 +419,11 @@ protected function getAndApplyPatch(RemoteFilesystem $downloader, $install_path,
418
419
// it might be useful. p4 is useful for Magento 2 patches
419
420
$ patch_levels = $ this ->getConfig ('patch-levels ' );
420
421
422
+ // Check for specified patch level for this package.
423
+ if (!empty ($ this ->composer ->getPackage ()->getExtra ()['patchLevel ' ][$ package ->getName ()])){
424
+ $ patch_levels = array ($ this ->composer ->getPackage ()->getExtra ()['patchLevel ' ][$ package ->getName ()]);
425
+ }
426
+
421
427
// Attempt to apply with git apply
422
428
$ patched = $ this ->applyPatchWithGit ($ install_path , $ patch_levels , $ filename );
423
429
0 commit comments