Explorar el Código

Skip platform repo and only force-update packages that have a new source ref

Jordi Boggiano hace 13 años
padre
commit
4233a4823d
Se han modificado 1 ficheros con 8 adiciones y 3 borrados
  1. 8 3
      src/Composer/Command/InstallCommand.php

+ 8 - 3
src/Composer/Command/InstallCommand.php

@@ -196,10 +196,13 @@ EOT
 
         // force dev packages to be updated to latest reference on update
         if ($update) {
-            foreach ($installedPackages as $package) {
+            foreach ($localRepo->getPackages() as $package) {
+                // skip non-dev packages
                 if (!$package->isDev()) {
                     continue;
                 }
+
+                // skip packages that will be updated/uninstalled
                 foreach ($operations as $operation) {
                     if (('update' === $operation->getJobType() && $package === $operation->getInitialPackage())
                         || ('uninstall' === $operation->getJobType() && $package === $operation->getPackage())
@@ -210,8 +213,10 @@ EOT
 
                 // force update
                 $newPackage = $composer->getRepositoryManager()->findPackage($package->getName(), $package->getVersion());
-                $operation = new UpdateOperation($package, $newPackage);
-                $operations[] = $operation;
+                if ($newPackage->getSourceReference() !== $package->getSourceReference()) {
+                    $operation = new UpdateOperation($package, $newPackage);
+                    $operations[] = $operation;
+                }
             }
         }