1
0
Fork 0

Merge pull request #802 from stof/lock_sorting

Made the order of aliases deterministic in the locker
pull/808/head
Jordi Boggiano 2012-06-14 11:15:46 -07:00
commit 94791aba73
1 changed files with 11 additions and 1 deletions

View File

@ -234,7 +234,17 @@ class Locker
} }
usort($locked, function ($a, $b) { usort($locked, function ($a, $b) {
return strcmp($a['package'], $b['package']); $comparison = strcmp($a['package'], $b['package']);
if (0 !== $comparison) {
return $comparison;
}
// If it is the same package, compare the versions to make the order deterministic
$aVersion = isset($a['alias-version']) ? $a['alias-version'] : $a['version'];
$bVersion = isset($b['alias-version']) ? $b['alias-version'] : $b['version'];
return strcmp($aVersion, $bVersion);
}); });
return $locked; return $locked;