소스 검색

Ensure packages in additional installed repository are not updated

The underlying assumption of the additional installed repository is that those
packages are installed in such a way that they cannot be updated. Prior to this
fix they were still candidates for change. This ensures that they are treated
like platform and root packages and are not candidates for update.
Beau Simensen 12 년 전
부모
커밋
3a0e4af132
1개의 변경된 파일7개의 추가작업 그리고 1개의 파일을 삭제
  1. 7 1
      src/Composer/Installer.php

+ 7 - 1
src/Composer/Installer.php

@@ -560,8 +560,14 @@ class Installer
         $constraint->setPrettyString($rootPackage->getPrettyVersion());
         $request->install($rootPackage->getName(), $constraint);
 
+        $installedPackages = $platformRepo->getPackages();
+        if ($this->additionalInstalledRepository) {
+            $additionalInstalledPackages = $this->additionalInstalledRepository->getPackages();
+            $installedPackages = array_merge($installedPackages, $additionalInstalledPackages);
+        }
+
         // fix the version of all platform packages to prevent the solver trying to remove those
-        foreach ($platformRepo->getPackages() as $package) {
+        foreach ($installedPackages as $package) {
             $constraint = new VersionConstraint('=', $package->getVersion());
             $constraint->setPrettyString($package->getPrettyVersion());