summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files/lintpkgsrc.pl
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2004-09-05 23:12:36 +0000
committerseb <seb@pkgsrc.org>2004-09-05 23:12:36 +0000
commite3417f07c9744ac6ccab24da4252bcc1b415261a (patch)
tree00e16ee96eaee0243a751c9fc3717c7246d15ba8 /pkgtools/pkglint/files/lintpkgsrc.pl
parent24b90e8c6b1cbcf9e3fe03076d348435750503ef (diff)
downloadpkgsrc-e3417f07c9744ac6ccab24da4252bcc1b415261a.tar.gz
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.
Diffstat (limited to 'pkgtools/pkglint/files/lintpkgsrc.pl')
-rwxr-xr-xpkgtools/pkglint/files/lintpkgsrc.pl26
1 files changed, 18 insertions, 8 deletions
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 <abs@netbsd.org>.
#
@@ -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;
}