X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FDeb%2FVersions.pm;h=dbd5ba85c816bd018cfcd5846f150f8b328ccc9a;hb=91edc66c5f872b41114dc61bdefc6d89c205a183;hp=4e0d99bc1f18ce009383d5b0beeeced49d8e04af;hpb=08f111d6668d5278a64d304fbc3bae6be86e6a94;p=deb%2Fpackages.git diff --git a/lib/Deb/Versions.pm b/lib/Deb/Versions.pm index 4e0d99b..dbd5ba8 100644 --- a/lib/Deb/Versions.pm +++ b/lib/Deb/Versions.pm @@ -66,7 +66,7 @@ use strict; use Exporter; our @ISA = qw( Exporter ); -our @EXPORT = qw( version_cmp version_sort ); +our @EXPORT = qw( version_cmp version_sort suites_cmp suites_sort ); our $VERSION = v1.0.0; @@ -152,6 +152,22 @@ sub _lcmp { return length( $v1 ) <=> length( $v2 ); } +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 ); +my $i = 100; +our %suites_sort = map { $_ => $i-- } @SUITES_SORT; + +sub suites_cmp { + return ($suites_sort{$_[0]} <=> $suites_sort{$_[1]}); +} + +sub suites_sort { + return sort { suites_cmp( $b, $a ) } @_; +} + + 1; __END__