X-Git-Url: https://git.deb.at/?p=deb%2Fpackages.git;a=blobdiff_plain;f=lib%2FDeb%2FVersions.pm;h=4f3b3207b0d8130d92706e181daf62884574000a;hp=984cbfb0b5ddb1775f2cc05055db9d2e6b38ab67;hb=bcfcaa38f5df98ccff82e7ec1b9473b92b850c17;hpb=422bc26cd78a51deceb45dbdc242e5fecf079e45 diff --git a/lib/Deb/Versions.pm b/lib/Deb/Versions.pm index 984cbfb..4f3b320 100644 --- a/lib/Deb/Versions.pm +++ b/lib/Deb/Versions.pm @@ -157,9 +157,11 @@ our @SUITES_SORT = qw( woody oldstable sarge stable stable-proposed-updates etch testing testing-proposed-updates sid unstable experimental warty hoary hoary-backports breezy breezy-backports dapper ); -our @ARCHIVE_SORT = qw( security updates volatile backports ); +our @ARCHIVE_SORT = qw( non-US security updates volatile backports ); +our @PRIORITY_SORT = qw( required important standard optional extra ); my $i = 1000; our %suites_sort = map { $_ => ($i-=10) } @SUITES_SORT; +our %priority_sort = map { $_ => $i-- } @PRIORITY_SORT; $i = 0; our %archive_sort = map { $_ => $i++ } @ARCHIVE_SORT; @@ -182,6 +184,14 @@ sub suites_sort { return sort { suites_cmp( $b, $a ) } @_; } +sub priority_cmp { + return ($priority_sort{$_[0]} <=> $priority_sort{$_[1]}); +} + +sub priority_sort { + return sort { priority_cmp( $b, $a ) } @_; +} + 1; __END__