Browse Source

Force a redownload to source when updating from dist to dev package

Jordi Boggiano 13 years ago
parent
commit
983de81b1d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      src/Composer/Downloader/DownloadManager.php

+ 7 - 0
src/Composer/Downloader/DownloadManager.php

@@ -164,6 +164,13 @@ class DownloadManager
             $targetType  = $target->getSourceType();
         }
 
+        // upgrading from a dist stable package to a dev package, force source reinstall
+        if ($target->isDev() && 'dist' === $installationSource) {
+            $downloader->remove($initial, $targetDir);
+            $this->download($target, $targetDir, 'source' === $installationSource);
+            return;
+        }
+
         if ($initialType === $targetType) {
             $target->setInstallationSource($installationSource);
             $downloader->update($initial, $target, $targetDir);