Skip to content

Commit

Permalink
Merge pull request #210 from christopher-hopper/patch-1
Browse files Browse the repository at this point in the history
Handle patches-ignore when re-patching
  • Loading branch information
cweagans committed May 9, 2018
2 parents 9504fbd + fb10de4 commit a4d6dc0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Patches.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,20 @@ public function checkPatches(Event $event) {
$installationManager = $this->composer->getInstallationManager();
$packages = $localRepository->getPackages();

$extra = $this->composer->getPackage()->getExtra();
$patches_ignore = isset($extra['patches-ignore']) ? $extra['patches-ignore'] : array();

$tmp_patches = $this->grabPatches();
foreach ($packages as $package) {
$extra = $package->getExtra();
if (isset($extra['patches'])) {
if (isset($patches_ignore[$package->getName()])) {
foreach ($patches_ignore[$package->getName()] as $package_name => $patches) {
if (isset($extra['patches'][$package_name])) {
$extra['patches'][$package_name] = array_diff($extra['patches'][$package_name], $patches);
}
}
}
$this->installedPatches[$package->getName()] = $extra['patches'];
}
$patches = isset($extra['patches']) ? $extra['patches'] : array();
Expand Down Expand Up @@ -130,8 +140,8 @@ public function checkPatches(Event $event) {
}
}
}
// If the Locker isn't available, then we don't need to do this.
// It's the first time packages have been installed.
// If the Locker isn't available, then we don't need to do this.
// It's the first time packages have been installed.
catch (\LogicException $e) {
return;
}
Expand Down

0 comments on commit a4d6dc0

Please sign in to comment.