Browse Source

Fix regression introduced in beb9a5bd727d49bf539db676f1aa946901090257

Jordi Boggiano 12 years ago
parent
commit
eceda0ffc7
1 changed files with 17 additions and 0 deletions
  1. 17 0
      src/Composer/DependencyResolver/Pool.php

+ 17 - 0
src/Composer/DependencyResolver/Pool.php

@@ -387,6 +387,23 @@ class Pool
             $replaces = $candidate->getReplaces();
         }
 
+        // aliases create multiple replaces/provides for one target so they can not use the shortcut
+        if (isset($replaces[0]) || isset($provides[0])) {
+            foreach ($provides as $link) {
+                if ($link->getTarget() === $name && $constraint->matches($link->getConstraint())) {
+                    return self::MATCH_PROVIDE;
+                }
+            }
+
+            foreach ($replaces as $link) {
+                if ($link->getTarget() === $name && $constraint->matches($link->getConstraint())) {
+                    return self::MATCH_REPLACE;
+                }
+            }
+
+            return self::MATCH_NONE;
+        }
+
         if (isset($provides[$name]) && $constraint->matches($provides[$name]->getConstraint())) {
             return self::MATCH_PROVIDE;
         }