pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint Update to version 3.90. Lintpkgsrc pa...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1170544f6d8d
branches:  trunk
changeset: 480318:1170544f6d8d
user:      seb <seb%pkgsrc.org@localhost>
date:      Sun Sep 05 23:12:36 2004 +0000

description:
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:

 pkgtools/pkglint/Makefile            |   4 ++--
 pkgtools/pkglint/files/lintpkgsrc.pl |  26 ++++++++++++++++++--------
 2 files changed, 20 insertions(+), 10 deletions(-)

diffs (68 lines):

diff -r 24bd887da50f -r 1170544f6d8d pkgtools/pkglint/Makefile
--- a/pkgtools/pkglint/Makefile Sun Sep 05 21:19:44 2004 +0000
+++ b/pkgtools/pkglint/Makefile Sun Sep 05 23:12:36 2004 +0000
@@ -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 -r 24bd887da50f -r 1170544f6d8d pkgtools/pkglint/files/lintpkgsrc.pl
--- a/pkgtools/pkglint/files/lintpkgsrc.pl      Sun Sep 05 21:19:44 2004 +0000
+++ b/pkgtools/pkglint/files/lintpkgsrc.pl      Sun Sep 05 23:12:36 2004 +0000
@@ -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@localhost>.
 #
@@ -372,6 +372,12 @@
        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 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;
     }



Home | Main Index | Thread Index | Old Index