pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/lintpkgsrc/files lintpkgsrc: fix version comp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/93f322556705
branches:  trunk
changeset: 382724:93f322556705
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Aug 03 20:39:27 2022 +0000

description:
lintpkgsrc: fix version comparison for adjacent letters

Previously, lintpkgsrc treated the version numbers 1.0aa and 1.0ab the
same, contrary to pkg_install.

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl  |  10 +++++++---
 pkgtools/lintpkgsrc/files/t/pkgversion.t |   3 ++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diffs (40 lines):

diff -r b3d284d3505f -r 93f322556705 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Wed Aug 03 20:32:55 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Wed Aug 03 20:39:27 2022 +0000
@@ -1,6 +1,6 @@
 #!@PERL5@
 
-# $NetBSD: lintpkgsrc.pl,v 1.48 2022/08/03 20:32:55 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.49 2022/08/03 20:39:27 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -315,8 +315,12 @@
                } elsif ($elem eq "alpha") {
                        push(@temp, -3);
                } else {
-                       push(@temp, 0);
-                       push(@temp, ord($elem) - ord("a") + 1);
+                       foreach my $ch (split(//, $elem)) {
+                               if ('a' le $ch && $ch le 'z') {
+                                       push(@temp, 0);
+                                       push(@temp, ord($ch) - ord('a') + 10);
+                               }
+                       }
                }
        }
        push(@temp, $nb);
diff -r b3d284d3505f -r 93f322556705 pkgtools/lintpkgsrc/files/t/pkgversion.t
--- a/pkgtools/lintpkgsrc/files/t/pkgversion.t  Wed Aug 03 20:32:55 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/t/pkgversion.t  Wed Aug 03 20:39:27 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: pkgversion.t,v 1.5 2022/08/03 20:32:55 rillig Exp $
+# $NetBSD: pkgversion.t,v 1.6 2022/08/03 20:39:27 rillig Exp $
 
 use strict;
 use warnings;
@@ -14,3 +14,4 @@
 ok(pkgversioncmp('3.4nb13', '>=', '3.4'), 1);
 ok(pkgversioncmp('3.4nb13', '<', '3.4'), '');
 ok(pkgversioncmp('3.4nb13', '>', '3.4nb5'), 1);
+ok(pkgversioncmp('1.1ab', '>', '1.1aa'), 1);



Home | Main Index | Thread Index | Old Index