From fe1d0e18e5f58c0a3d1c59941e736928b154aea7 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sun, 16 Jul 2006 21:22:56 +0000 Subject: Bug 344661: Cannot upgrade PostgreSQL installations anymore - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Install/Requirements.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index 790739554..e8f27c503 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -149,8 +149,14 @@ sub have_vers { # This is taken straight from Sort::Versions 1.5, which is not included # with perl by default. sub vers_cmp { - my @A = ($_[0] =~ /([-.]|\d+|[^-.\d]+)/g); - my @B = ($_[1] =~ /([-.]|\d+|[^-.\d]+)/g); + my ($a, $b) = @_; + + # Remove leading zeroes - Bug 344661 + $a =~ s/^0*(.*)/$1/; + $b =~ s/^0*(.*)/$1/; + + my @A = ($a =~ /([-.]|\d+|[^-.\d]+)/g); + my @B = ($b =~ /([-.]|\d+|[^-.\d]+)/g); my ($A, $B); while (@A and @B) { -- cgit v1.2.3-24-g4f1b