1
0
Fork 0

Made the order of aliases deterministic in the locker

pull/802/head
Christophe Coevoet 2012-06-14 18:59:53 +02:00
parent 4c75a2db01
commit 398a3ac0dc
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;