1
0
Fork 0

fixing error message for higher repository priority, when higher repo has only a dev-branch

pull/9142/head
Oleg Andreyev 2020-08-22 20:07:13 +03:00
parent 38f49acfdd
commit f262feebec
No known key found for this signature in database
GPG Key ID: C7EFA51E830B567D
3 changed files with 54 additions and 4 deletions

View File

@ -279,11 +279,11 @@ class Problem
return array("- Root composer.json requires $packageName".self::constraintToText($constraint) . ', ', 'found '.self::getPackageList($packages, $isVerbose).' but '.(self::hasMultipleNames($packages) ? 'these do' : 'it does').' not match your minimum-stability.');
}
// check if the package is found when bypassing the constraint check
if ($packages = $repositorySet->findPackages($packageName, null)) {
// check if the package is found when bypassing the constraint check and stability checks
if ($packages = $repositorySet->findPackages($packageName, null, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES)) {
// we must first verify if a valid package would be found in a lower priority repository
if ($allReposPackages = $repositorySet->findPackages($packageName, $constraint, RepositorySet::ALLOW_SHADOWED_REPOSITORIES)) {
$higherRepoPackages = $repositorySet->findPackages($packageName, null);
$higherRepoPackages = $repositorySet->findPackages($packageName, null, RepositorySet::ALLOW_UNACCEPTABLE_STABILITIES);
$nextRepoPackages = array();
$nextRepo = null;

View File

@ -193,7 +193,7 @@ class RepositorySet
}
}
return $candidates;
return $result;
}
public function getProviders($packageName)

View File

@ -0,0 +1,50 @@
--TEST--
Packages found in a higher priority repository won't be considered as found if version does not match
--COMPOSER--
{
"repositories": [
{
"type": "package",
"package": [
{
"name": "ruflin/elastica",
"version": "dev-outdated-branch"
}
]
},
{
"type": "package",
"package": [
{
"name": "friendsofsymfony/elastica-bundle",
"version": "dev-foobar-master",
"require": {
"ruflin/elastica": "2.*"
}
}
]
},
{
"type": "composer",
"url": "https://repo.packagist.org"
}
],
"require": {
"friendsofsymfony/elastica-bundle": "dev-foobar-master"
}
}
--RUN--
update
--EXPECT-OUTPUT--
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires friendsofsymfony/elastica-bundle dev-foobar-master -> satisfiable by friendsofsymfony/elastica-bundle[dev-foobar-master].
- friendsofsymfony/elastica-bundle dev-foobar-master requires ruflin/elastica 2.* -> satisfiable by ruflin/elastica[2.0.0, ..., 2.3.3] from composer repo (https://repo.packagist.org) but ruflin/elastica[dev-outdated-branch] from package repo (defining 1 package) has higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.
--EXPECT--
--EXPECT-EXIT-CODE--
2