mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
ci/eval: support "10.rebuild-${kernel}: 1" labels
This should restore the old behavior of ofborg
This commit is contained in:
@@ -182,36 +182,45 @@ rec {
|
||||
Turns
|
||||
{
|
||||
linux = 56;
|
||||
darwin = 8;
|
||||
darwin = 1;
|
||||
}
|
||||
into
|
||||
[
|
||||
"10.rebuild-darwin: 1"
|
||||
"10.rebuild-darwin: 1-10"
|
||||
"10.rebuild-linux: 11-100"
|
||||
]
|
||||
*/
|
||||
getLabels = lib.mapAttrsToList (
|
||||
kernel: rebuildCount:
|
||||
let
|
||||
number =
|
||||
if rebuildCount == 0 then
|
||||
"0"
|
||||
else if rebuildCount <= 10 then
|
||||
"1-10"
|
||||
else if rebuildCount <= 100 then
|
||||
"11-100"
|
||||
else if rebuildCount <= 500 then
|
||||
"101-500"
|
||||
else if rebuildCount <= 1000 then
|
||||
"501-1000"
|
||||
else if rebuildCount <= 2500 then
|
||||
"1001-2500"
|
||||
else if rebuildCount <= 5000 then
|
||||
"2501-5000"
|
||||
else
|
||||
"5001+";
|
||||
|
||||
in
|
||||
"10.rebuild-${kernel}: ${number}"
|
||||
);
|
||||
getLabels =
|
||||
rebuildCountByKernel:
|
||||
lib.concatLists (
|
||||
lib.mapAttrsToList (
|
||||
kernel: rebuildCount:
|
||||
let
|
||||
numbers =
|
||||
if rebuildCount == 0 then
|
||||
[ "0" ]
|
||||
else if rebuildCount == 1 then
|
||||
[
|
||||
"1"
|
||||
"1-10"
|
||||
]
|
||||
else if rebuildCount <= 10 then
|
||||
[ "1-10" ]
|
||||
else if rebuildCount <= 100 then
|
||||
[ "11-100" ]
|
||||
else if rebuildCount <= 500 then
|
||||
[ "101-500" ]
|
||||
else if rebuildCount <= 1000 then
|
||||
[ "501-1000" ]
|
||||
else if rebuildCount <= 2500 then
|
||||
[ "1001-2500" ]
|
||||
else if rebuildCount <= 5000 then
|
||||
[ "2501-5000" ]
|
||||
else
|
||||
[ "5001+" ];
|
||||
in
|
||||
lib.forEach numbers (number: "10.rebuild-${kernel}: ${number}")
|
||||
) rebuildCountByKernel
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user