From c0feee31c06a888d2160b793934eaf29be54b5a4 Mon Sep 17 00:00:00 2001 From: seb Date: Sun, 5 Sep 2004 23:12:36 +0000 Subject: Update to version 3.90. Lintpkgsrc package version comparison bug fix. When comparing two version numbers vector the shorter one needs to be extended with 0. Cf. src/usr.sbin/pkg_install/lib/str.c:vtest(). Previously lintpkgsrc considered that 'png-1.2.6', which version vector is [1,0,2,0,6], is "less" than 'png-1.2.6rc1', which version vector is [1,0,2,0,6,-1,1]. No wonder lintpksrc -V considered the package png-1.2.6 being vulnerable wrt the 'png<1.2.6rc1' entry in pkg-vulnerabilities files. While here teach lintpkgsrc about the 'alpha' and 'beta' version elements. --- pkgtools/pkglint/Makefile | 4 ++-- pkgtools/pkglint/files/lintpkgsrc.pl | 26 ++++++++++++++++++-------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 5a2bbe028ef..c6191a63e52 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.202 2004/08/24 15:18:29 wiz Exp $ +# $NetBSD: Makefile,v 1.203 2004/09/05 23:12:36 seb Exp $ # -DISTNAME= pkglint-3.89 +DISTNAME= pkglint-3.90 CATEGORIES= pkgtools devel MASTER_SITES= # empty DISTFILES= # empty diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index 25b78a06b62..f8794a5462d 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!@PERL@ -# $NetBSD: lintpkgsrc.pl,v 1.92 2004/07/01 20:14:58 abs Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.93 2004/09/05 23:12:37 seb Exp $ # Written by David Brownlee . # @@ -372,6 +372,12 @@ sub convert_to_standard_dewey elsif ($elem =~ /^rc$/) { push(@temp, -1); } + elsif ($elem =~ /^beta$/) { + push(@temp, -2); + } + elsif ($elem =~ /^alpha$/) { + push(@temp, -3); + } else { push(@temp, 0); push(@temp, ord($elem)-ord("a")+1); @@ -383,19 +389,23 @@ sub convert_to_standard_dewey sub deweycmp_extract { my($match, $val) = @_; - my($cmp, @matchlist, @vallist); + my($cmp, @matchlist, @vallist,$i, $len); @matchlist = convert_to_standard_dewey(split(/(\D+)/, lc($match))); @vallist = convert_to_standard_dewey(split(/(\D+)/, lc($val))); $cmp = 0; - while( ! $cmp && (@matchlist || @vallist)) + $i =0; + if ($#matchlist > $#vallist) + { $len = $#matchlist; } + else + { $len = $#vallist; } + while( ! $cmp && ($i++ <= $len)) { if (!@matchlist) - { $cmp = -1; } - elsif (!@vallist) - { $cmp = 1; } - else - { $cmp = (shift @matchlist <=> shift @vallist) } + { push(@matchlist, 0); } + if (!@vallist) + { push(@vallist, 0); } + $cmp = (shift @matchlist <=> shift @vallist); } $cmp; } -- cgit v1.2.3