1
0
Fork 0

Fix picking of new dev packages for updates to latest source ref

pull/1015/head
Jordi Boggiano 2012-08-24 12:06:29 +02:00
parent f9f86f03ae
commit c97720c607
2 changed files with 26 additions and 7 deletions

View File

@ -247,7 +247,8 @@ class Installer
// creating repository pool
$pool = new Pool($minimumStability, $stabilityFlags);
$pool->addRepository($installedRepo, $aliases);
foreach ($this->repositoryManager->getRepositories() as $repository) {
$repositories = $this->repositoryManager->getRepositories();
foreach ($repositories as $repository) {
$pool->addRepository($repository, $aliases);
}
@ -360,6 +361,10 @@ class Installer
continue;
}
if ($package instanceof AliasPackage) {
continue;
}
// skip packages that will be updated/uninstalled
foreach ($operations as $operation) {
if (('update' === $operation->getJobType() && $operation->getInitialPackage()->equals($package))
@ -394,9 +399,13 @@ class Installer
$newPackage = null;
$matches = $pool->whatProvides($package->getName(), new VersionConstraint('=', $package->getVersion()));
foreach ($matches as $match) {
if (null === $newPackage || $newPackage->getReleaseDate() < $match->getReleaseDate()) {
$newPackage = $match;
// skip local packages
if (!in_array($match->getRepository(), $repositories, true)) {
continue;
}
$newPackage = $match;
break;
}
if ($newPackage && $newPackage->getSourceReference() !== $package->getSourceReference()) {

View File

@ -1,5 +1,5 @@
--TEST--
Update aliased package to non-aliased version
Update aliased package does not mess up the lock file
--COMPOSER--
{
"repositories": [
@ -12,12 +12,22 @@ Update aliased package to non-aliased version
"source": { "reference": "master", "type": "git", "url": "" }
}
]
},
{
"type": "package",
"package": [
{
"name": "a/a", "version": "dev-master",
"extra": { "branch-alias": { "dev-master": "1.0.x-dev" } },
"source": { "reference": "lowpriomaster", "type": "git", "url": "" }
}
]
}
],
"require": {
"a/a": "1.*"
},
"minimum-stability": "stable"
"minimum-stability": "dev"
}
--LOCK--
{
@ -27,7 +37,7 @@ Update aliased package to non-aliased version
],
"packages-dev": null,
"aliases": [],
"minimum-stability": "stable",
"minimum-stability": "dev",
"stability-flags": []
}
--INSTALLED--
@ -48,7 +58,7 @@ update
],
"packages-dev": null,
"aliases": [],
"minimum-stability": "stable",
"minimum-stability": "dev",
"stability-flags": []
}
--EXPECT--