pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/lintpkgsrc/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Wed Aug  3 20:39:27 UTC 2022

Modified Files:
        pkgsrc/pkgtools/lintpkgsrc/files: lintpkgsrc.pl
        pkgsrc/pkgtools/lintpkgsrc/files/t: pkgversion.t

Log Message:
lintpkgsrc: fix version comparison for adjacent letters

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


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
cvs rdiff -u -r1.5 -r1.6 pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
diff -u pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.48 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.49
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.48 Wed Aug  3 20:32:55 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Wed Aug  3 20:39:27 2022
@@ -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 @@ sub split_pkgversion($) {
                } 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);

Index: pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t
diff -u pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t:1.5 pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t:1.6
--- pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t:1.5 Wed Aug  3 20:32:55 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/t/pkgversion.t     Wed Aug  3 20:39:27 2022
@@ -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.4', '>=', '3.4.0.0.0
 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