From b333d7a4856853c224c4dd15efed146333c577c6 Mon Sep 17 00:00:00 2001 From: Karoly Negyesi Date: Fri, 20 Sep 2013 04:31:24 +0200 Subject: [PATCH] act on target-dir changes during update --- src/Composer/Installer/LibraryInstaller.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Composer/Installer/LibraryInstaller.php b/src/Composer/Installer/LibraryInstaller.php index 281ffa11a..a754eb590 100644 --- a/src/Composer/Installer/LibraryInstaller.php +++ b/src/Composer/Installer/LibraryInstaller.php @@ -157,8 +157,12 @@ class LibraryInstaller implements InstallerInterface protected function updateCode(PackageInterface $initial, PackageInterface $target) { - $downloadPath = $this->getInstallPath($initial); - $this->downloadManager->update($initial, $target, $downloadPath); + $initialDownloadPath = $this->getInstallPath($initial); + $targetDownloadPath = $this->getInstallPath($target); + if ($targetDownloadPath != $initialDownloadPath) { + $this->filesystem->copyThenRemove($initialDownloadPath, $targetDownloadPath); + } + $this->downloadManager->update($initial, $target, $targetDownloadPath); } protected function removeCode(PackageInterface $package)