1
0
Fork 0

Make sure the abandoned state is copied over even if the packages are installed already

pull/5238/head
Jordi Boggiano 2016-04-22 23:41:15 +01:00
parent 6c94cb89d1
commit ac75680b1e
2 changed files with 49 additions and 0 deletions

View File

@ -1090,6 +1090,10 @@ class Installer
$newSourceUrl = $newPackage->getSourceUrl();
$this->updatePackageUrl($package, $newSourceUrl, $newPackage->getSourceType(), $newPackage->getSourceReference(), $newPackage->getDistUrl());
if ($package instanceof CompletePackage && $newPackage instanceof CompletePackage) {
$package->setAbandoned($newPackage->getReplacementPackage() ?: $newPackage->isAbandoned());
}
}
}
}

View File

@ -0,0 +1,45 @@
--TEST--
Update updates the outdated state of packages
--COMPOSER--
{
"repositories": [
{
"type": "package",
"package": [
{
"name": "a/a", "version": "1.0.0", "abandoned": "replacement"
}
]
}
],
"require": {
"a/a": "1.0.0"
}
}
--INSTALLED--
[
{
"name": "a/a", "version": "1.0.0"
}
]
--EXPECT-LOCK--
{
"packages": [
{
"name": "a/a", "version": "1.0.0",
"type": "library",
"abandoned": "replacement"
}
],
"packages-dev": [],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": []
}
--RUN--
update
--EXPECT--