Skip to content

Commit

Permalink
Issue cweagans#26: Package deleted but not reinstalled and patched.
Browse files Browse the repository at this point in the history
  • Loading branch information
grasmash committed Aug 3, 2016
1 parent 91b5eed commit 7f79d07
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Patches.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,18 @@ public function gatherPatches(PackageEvent $event) {
if ($operation->getJobType() == 'install' || $operation->getJobType() == 'update') {
$package = $this->getPackageFromOperation($operation);
$extra = $package->getExtra();
// Packages that were removed for re-download and re-patching are
// sometimes missing their upstream patch information. If so, use
// patch info from patches_applied.
if (!isset($extra['patches'])
&& (!array_key_exists($package->getName(), $this->patches) || empty($this->patches[$package->getName()]))
&& isset($extra['patches_applied'])) {
if ($this->io->isVerbose()) {
$this->io->write('<info>Resetting patch information for re-downloaded package ' . $package . '.</info>');
}
$extra['patches'][$package->getName()] = $extra['patches_applied'];
unset($extra['patches_applied']);
}
if (isset($extra['patches'])) {
$this->patches = array_merge_recursive($this->patches, $extra['patches']);
}
Expand Down

0 comments on commit 7f79d07

Please sign in to comment.