1
0
Fork 0

Fix partial updates from a dirty state and apply exactly the locked state, fixes #3468

pull/5210/head
Jordi Boggiano 2016-04-18 23:33:04 +01:00
parent aed818fda2
commit de5bfcb4c5
3 changed files with 24 additions and 11 deletions

View File

@ -450,7 +450,7 @@ class Installer
$candidates[$link->getTarget()] = true; $candidates[$link->getTarget()] = true;
$rootRequires[$link->getTarget()] = $link; $rootRequires[$link->getTarget()] = $link;
} }
foreach ($localRepo->getPackages() as $package) { foreach ($currentPackages as $package) {
$candidates[$package->getName()] = true; $candidates[$package->getName()] = true;
} }

View File

@ -53,7 +53,8 @@ update c/uptodate
"packages": [ "packages": [
{ "name": "a/old", "version": "1.0.0", "type": "library" }, { "name": "a/old", "version": "1.0.0", "type": "library" },
{ "name": "b/unstable", "version": "1.0.0", "type": "library" }, { "name": "b/unstable", "version": "1.0.0", "type": "library" },
{ "name": "c/uptodate", "version": "2.0.0", "type": "library" } { "name": "c/uptodate", "version": "2.0.0", "type": "library" },
{ "name": "d/removed", "version": "1.0.0", "type": "library" }
], ],
"packages-dev": [], "packages-dev": [],
"aliases": [], "aliases": [],
@ -67,3 +68,4 @@ update c/uptodate
--EXPECT-- --EXPECT--
Updating b/unstable (1.1.0-alpha) to b/unstable (1.0.0) Updating b/unstable (1.1.0-alpha) to b/unstable (1.0.0)
Updating a/old (0.9.0) to a/old (1.0.0) Updating a/old (0.9.0) to a/old (1.0.0)
Installing d/removed (1.0.0)

View File

@ -8,10 +8,13 @@ Partial update from lock file should update everything to the state of the lock,
"package": [ "package": [
{ "name": "a/old", "version": "1.0.0" }, { "name": "a/old", "version": "1.0.0" },
{ "name": "a/old", "version": "2.0.0" }, { "name": "a/old", "version": "2.0.0" },
{ "name": "b/unstable", "version": "1.0.0" }, { "name": "b/unstable", "version": "1.0.0", "require": {"f/dependency": "1.*"} },
{ "name": "b/unstable", "version": "1.1.0-alpha" }, { "name": "b/unstable", "version": "1.1.0-alpha", "require": {"f/dependency": "1.*"} },
{ "name": "c/uptodate", "version": "1.0.0" }, { "name": "c/uptodate", "version": "1.0.0" },
{ "name": "d/removed", "version": "1.0.0" } { "name": "d/removed", "version": "1.0.0" },
{ "name": "e/newreq", "version": "1.0.0" },
{ "name": "f/dependency", "version": "1.1.0" },
{ "name": "f/dependency", "version": "1.0.0" }
] ]
} }
], ],
@ -25,9 +28,11 @@ Partial update from lock file should update everything to the state of the lock,
{ {
"packages": [ "packages": [
{ "name": "a/old", "version": "1.0.0" }, { "name": "a/old", "version": "1.0.0" },
{ "name": "b/unstable", "version": "1.1.0-alpha" }, { "name": "b/unstable", "version": "1.1.0-alpha", "require": {"f/dependency": "1.*"} },
{ "name": "c/uptodate", "version": "1.0.0" }, { "name": "c/uptodate", "version": "1.0.0" },
{ "name": "d/removed", "version": "1.0.0" } { "name": "d/removed", "version": "1.0.0" },
{ "name": "e/newreq", "version": "1.0.0" },
{ "name": "f/dependency", "version": "1.0.0" }
], ],
"packages-dev": [], "packages-dev": [],
"aliases": [], "aliases": [],
@ -43,8 +48,9 @@ Partial update from lock file should update everything to the state of the lock,
--INSTALLED-- --INSTALLED--
[ [
{ "name": "a/old", "version": "0.9.0" }, { "name": "a/old", "version": "0.9.0" },
{ "name": "b/unstable", "version": "1.1.0-alpha" }, { "name": "b/unstable", "version": "1.1.0-alpha", "require": {"f/dependency": "1.*"} },
{ "name": "c/uptodate", "version": "2.0.0" } { "name": "c/uptodate", "version": "2.0.0" },
{ "name": "f/dependency", "version": "1.0.0" }
] ]
--RUN-- --RUN--
update b/unstable update b/unstable
@ -52,8 +58,11 @@ update b/unstable
{ {
"packages": [ "packages": [
{ "name": "a/old", "version": "1.0.0", "type": "library" }, { "name": "a/old", "version": "1.0.0", "type": "library" },
{ "name": "b/unstable", "version": "1.0.0", "type": "library" }, { "name": "b/unstable", "version": "1.0.0", "type": "library", "require": {"f/dependency": "1.*"} },
{ "name": "c/uptodate", "version": "1.0.0", "type": "library" } { "name": "c/uptodate", "version": "1.0.0", "type": "library" },
{ "name": "d/removed", "version": "1.0.0", "type": "library" },
{ "name": "e/newreq", "version": "1.0.0", "type": "library" },
{ "name": "f/dependency", "version": "1.0.0", "type": "library" }
], ],
"packages-dev": [], "packages-dev": [],
"aliases": [], "aliases": [],
@ -68,3 +77,5 @@ update b/unstable
Updating b/unstable (1.1.0-alpha) to b/unstable (1.0.0) Updating b/unstable (1.1.0-alpha) to b/unstable (1.0.0)
Updating a/old (0.9.0) to a/old (1.0.0) Updating a/old (0.9.0) to a/old (1.0.0)
Updating c/uptodate (2.0.0) to c/uptodate (1.0.0) Updating c/uptodate (2.0.0) to c/uptodate (1.0.0)
Installing d/removed (1.0.0)
Installing e/newreq (1.0.0)