1
0
Fork 0

resolve issue

pull/4817/head
Rob Bast 2016-02-02 10:45:57 +01:00
parent 17d6b98707
commit 0e584aa980
3 changed files with 48 additions and 33 deletions

View File

@ -1199,6 +1199,7 @@ class Installer
foreach ($requirePackages as $requirePackage) { foreach ($requirePackages as $requirePackage) {
if (isset($skipPackages[$requirePackage->getName()])) { if (isset($skipPackages[$requirePackage->getName()])) {
$this->io->writeError('<warning>Dependency "' . $requirePackage->getName() . '" is also a root requirement, but is not explicitly whitelisted. Ignoring.</warning>');
continue; continue;
} }
$packageQueue->enqueue($requirePackage); $packageQueue->enqueue($requirePackage);

View File

@ -0,0 +1,47 @@
--TEST--
See Github issue #4795 ( github.com/composer/composer/issues/4795 ).
Composer\Installer::whitelistUpdateDependencies intentionally ignores root requirements even if said package is also a
dependency of one the requirements that is whitelisted for update.
--COMPOSER--
{
"repositories": [
{
"type": "package",
"package": [
{ "name": "a", "version": "1.0.0" },
{ "name": "a", "version": "1.1.0" },
{ "name": "b", "version": "1.0.0", "require": { "a": "~1.0" } },
{ "name": "b", "version": "1.1.0", "require": { "a": "~1.1" } },
{ "name": "c", "version": "1.0.0", "require": { "a": "~1.0" } }
]
}
],
"require": {
"a": "~1.0",
"b": "~1.0",
"c": "~1.0"
}
}
--INSTALLED--
[
{ "name": "a", "version": "1.0.0" },
{ "name": "b", "version": "1.0.0", "require": { "a": "~1.0" } },
{ "name": "c", "version": "1.0.0", "require": { "a": "~1.0" } }
]
--RUN--
update B --with-dependencies
--EXPECT-OUTPUT--
<warning>Dependency "a" is also a root requirement, but is not explicitly whitelisted. Ignoring.</warning>
<info>Loading composer repositories with package information</info>
<info>Updating dependencies (including require-dev)</info>
Nothing to install or update
<info>Writing lock file</info>
<info>Generating autoload files</info>
--EXPECT--

View File

@ -1,33 +0,0 @@
--TEST--
Refs issue #4795
--COMPOSER--
{
"repositories": [
{
"type": "package",
"package": [
{ "name": "A", "version": "1.0.0" },
{ "name": "A", "version": "1.1.0" },
{ "name": "B", "version": "1.0.0", "require": { "A": "~1.0" } },
{ "name": "B", "version": "1.1.0", "require": { "A": "~1.1" } },
{ "name": "C", "version": "1.0.0", "require": { "A": "~1.0" } }
]
}
],
"require": {
"A": "~1.0",
"B": "~1.0",
"C": "~1.0"
}
}
--INSTALLED--
[
{ "name": "A", "version": "1.0.0" },
{ "name": "B", "version": "1.0.0", "require": { "A": "~1.0" } },
{ "name": "C", "version": "1.0.0", "require": { "A": "~1.0" } }
]
--RUN--
update B --with-dependencies
--EXPECT--
Updating A (1.0.0) to A (1.1.0)
Updating B (1.0.0) to B (1.1.0)