1
0
Fork 0

Workaround issues when the additional fixed repo is in used and is an installed repo, closes #9574

pull/9615/head
Jordi Boggiano 2021-01-12 11:53:41 +01:00
parent f82a888704
commit 92b3725765
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 9 additions and 1 deletions

View File

@ -49,6 +49,7 @@ use Composer\Package\RootPackageInterface;
use Composer\Repository\InstalledArrayRepository; use Composer\Repository\InstalledArrayRepository;
use Composer\Repository\InstalledRepositoryInterface; use Composer\Repository\InstalledRepositoryInterface;
use Composer\Repository\InstalledRepository; use Composer\Repository\InstalledRepository;
use Composer\Repository\FilterRepository;
use Composer\Repository\RootPackageRepository; use Composer\Repository\RootPackageRepository;
use Composer\Repository\PlatformRepository; use Composer\Repository\PlatformRepository;
use Composer\Repository\RepositoryInterface; use Composer\Repository\RepositoryInterface;
@ -766,7 +767,14 @@ class Installer
$repositorySet->addRepository(new RootPackageRepository($this->fixedRootPackage)); $repositorySet->addRepository(new RootPackageRepository($this->fixedRootPackage));
$repositorySet->addRepository($platformRepo); $repositorySet->addRepository($platformRepo);
if ($this->additionalFixedRepository) { if ($this->additionalFixedRepository) {
$repositorySet->addRepository($this->additionalFixedRepository); $additionalFixedRepository = $this->additionalFixedRepository;
// wrap the repository in a FilterRepository if needed to avoid warnings about installed repositories being used in the RepositorySet
// see https://github.com/composer/composer/pull/9574
if ($additionalFixedRepository instanceof InstalledRepository || $additionalFixedRepository instanceof InstalledRepositoryInterface) {
$additionalFixedRepository = new FilterRepository($additionalFixedRepository, array());
}
$repositorySet->addRepository($additionalFixedRepository);
} }
return $repositorySet; return $repositorySet;