Skip to content

Commit

Permalink
[backend] adapt maintenance hack in package sorting to take multibuil…
Browse files Browse the repository at this point in the history
…d into account

We use the incident number at the end of the package name to sort
maintenance projects.  This did not work for multibuild builds, as
they have a trailing ":flavor" at the end.
  • Loading branch information
mlschroe committed Dec 11, 2018
1 parent f0e7fce commit ebf229f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/backend/BSSched/ProjPacks.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1403,25 +1403,33 @@ sub orderpackids {
my @back;
my $kind = $proj->{'kind'} || '';
for (@packids) {
my $mbflavor = '';
if ($_ eq '_volatile') {
push @back, $_;
} elsif (/^(.*)\.(\d+)$/) {
next;
}
if (/(?<!^_product)(?<!^_patchinfo):./) {
/^(.*):(.*?)$/; # split into base name and flavor
$_ = $1;
$mbflavor = ":$2";
}
if (/^(.*)\.(\d+)$/) {
# we ignore the name for maintenance release projects and sort only
# by the incident number
if ($kind eq 'maintenance_release') {
push @s, [ $_, '', $2];
push @s, [ "$_$mbflavor", '', $2];
} else {
push @s, [ $_, $1, $2];
push @s, [ "$_$mbflavor", "$1$mbflavor", $2];
}
} elsif (/^(.*)\.imported_.*?(\d+)$/) {
# code11 import hack...
if ($kind eq 'maintenance_release') {
push @s, [ $_, '', $2 - 1000000];
push @s, [ "$_$mbflavor", '', $2 - 1000000];
} else {
push @s, [ $_, $1, $2 - 1000000];
push @s, [ "$_$mbflavor", "$1$mbflavor", $2 - 1000000];
}
} else {
push @s, [ $_, $_, 99999999 ];
push @s, [ "$_$mbflavor", "$_$mbflavor", 99999999 ];
}
}
@packids = map {$_->[0]} sort { $a->[1] cmp $b->[1] || $b->[2] <=> $a->[2] || $a->[0] cmp $b->[0] } @s;
Expand Down

0 comments on commit ebf229f

Please sign in to comment.