Browse Source

Fix bogus operations that trigger a "package is not installed" exception for dev installs, refs #789

Jordi Boggiano 12 years ago
parent
commit
b4bcc5b5c8
1 changed files with 13 additions and 0 deletions
  1. 13 0
      src/Composer/Installer.php

+ 13 - 0
src/Composer/Installer.php

@@ -374,6 +374,19 @@ class Installer
             return false;
         }
 
+        if ($devMode) {
+            // remove bogus operations that the solver creates for stuff that was force-updated in the non-dev pass
+            // TODO this should not be necessary ideally, but it seems to work around the problem quite well
+            foreach ($operations as $index => $op) {
+                if ('update' === $op->getJobType() && $op->getInitialPackage()->getUniqueName() === $op->getTargetPackage()->getUniqueName()
+                    && $op->getInitialPackage()->getSourceReference() === $op->getTargetPackage()->getSourceReference()
+                    && $op->getInitialPackage()->getDistReference() === $op->getTargetPackage()->getDistReference()
+                ) {
+                    unset($operations[$index]);
+                }
+            }
+        }
+
         // force dev packages to be updated if we update or install from a (potentially new) lock
         foreach ($localRepo->getPackages() as $package) {
             // skip non-dev packages