From: Raphael Hertzog Date: Mon, 15 Oct 2007 10:23:56 +0000 (+0200) Subject: Dpkg::Version: fix compare_versions to handle properly the ">=" case X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d95ae2826970e6401b18ac959abf8891e88b93b1;p=dpkg Dpkg::Version: fix compare_versions to handle properly the ">=" case --- diff --git a/ChangeLog b/ChangeLog index 23664525..a1792c19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-15 Raphael Hertzog + + * scripts/Dpkg/Version.pm: fix compare_versions to handle properly + the >= cases (it was improperly handled like >> due to a bad regexp). + 2007-10-14 Raphael Hertzog * scripts/Dpkg/Version.pm: mark compare_versions as exportable. diff --git a/scripts/Dpkg/Version.pm b/scripts/Dpkg/Version.pm index b44dade7..406f707a 100644 --- a/scripts/Dpkg/Version.pm +++ b/scripts/Dpkg/Version.pm @@ -177,7 +177,7 @@ sub compare_versions ($$$) my $rel = $_[1]; my $res = vercmp($_[0], $_[2]); - if ($rel eq 'gt' or $rel =~ />?>/) { + if ($rel eq 'gt' or $rel eq ">" or $rel eq ">>") { return $res > 0; } elsif ($rel eq 'ge' or $rel eq '>=') { return $res >= 0; @@ -185,7 +185,7 @@ sub compare_versions ($$$) return $res == 0; } elsif ($rel eq 'le' or $rel eq '<=') { return $res <= 0; - } elsif ($rel eq 'lt' or $rel =~ /