X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FDeb%2FVersions.pm;h=792a86373fbcbb7bfec63d1201c25b668709baaf;hb=85a0d250766684cd29cd0d3599c9a21bfdf3f33e;hp=366af76bccca359450606767630c77936c52f4ba;hpb=0e673db69e902d63ebb471926c06547e685db610;p=deb%2Fpackages.git diff --git a/lib/Deb/Versions.pm b/lib/Deb/Versions.pm index 366af76..792a863 100644 --- a/lib/Deb/Versions.pm +++ b/lib/Deb/Versions.pm @@ -1,6 +1,5 @@ # # Deb::Versions -# $Id$ # # Copyright 2003, 2004 Frank Lichtenheld # @@ -16,7 +15,7 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # =head1 NAME @@ -142,9 +141,9 @@ sub _lcmp { for ( my $i = 0; $i <= length( $v1 ); $i++ ) { my ( $n1, $n2 ) = ( ord( substr( $v1, $i, 1 ) ), ord( substr( $v2, $i, 1 ) ) ); - $n1 += 256 if $n1 < 65; # letters sort earlier than non-letters + $n1 += 256 if $n1 && $n1 < 65; # letters sort earlier than non-letters $n1 = -1 if $n1 == 126; # '~' sorts earlier than everything else - $n2 += 256 if $n2 < 65; + $n2 += 256 if $n2 && $n2 < 65; $n2 = -1 if $n2 == 126; if ( my $r = ($n1 <=> $n2) ) { return $r; @@ -154,9 +153,9 @@ sub _lcmp { } our @SUITES_SORT = qw( woody oldstable sarge stable stable-proposed-updates - etch etch-m68k testing testing-proposed-updates sid unstable - experimental warty hoary hoary-backports breezy - breezy-backports dapper ); + etch etch-m68k testing testing-proposed-updates lenny + sid unstable experimental + warty hoary breezy breezy dapper edgy feisty gutsy ); our @ARCHIVE_SORT = qw( non-US security updates volatile backports ); our @PRIORITY_SORT = qw( required important standard optional extra ); my $i = 1000; @@ -177,11 +176,11 @@ sub suites_cmp { $cmp_b = $suites_sort{$1} - $archive_sort{$2} if $s_b =~ m;^(.+?)[/-](.*)$;o; } - return ($cmp_a <=> $cmp_b); + return ($cmp_b <=> $cmp_a); } sub suites_sort { - return sort { suites_cmp( $b, $a ) } @_; + return sort { suites_cmp( $a, $b ) } @_; } sub priority_cmp {