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:           Sat Jul 30 09:32:05 UTC 2022

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

Log Message:
lintpkgsrc: cleanup: replace regular expressions with string comparison


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl

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.32 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.33
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.32 Sat Jul 30 09:23:19 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Sat Jul 30 09:32:05 2022
@@ -1,6 +1,6 @@
 #!@PERL5@
 
-# $NetBSD: lintpkgsrc.pl,v 1.32 2022/07/30 09:23:19 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.33 2022/07/30 09:32:05 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -307,19 +307,15 @@ sub convert_to_standard_pkgversion(@) {
        # See pkg_install/lib/dewey.c.
        # 'nb' has already been handled when we are here.
        foreach $elem (@_) {
-               if ($elem =~ /\d+/) {
+               if ($elem =~ /\d/) {
                        push(@temp, $elem);
-               } elsif ($elem =~ /^pl$/ or $elem =~ /^\.$/) {
+               } elsif ($elem eq "pl" || $elem eq "." || $elem eq "_") {
                        push(@temp, 0);
-               } elsif ($elem =~ /^_$/) {
-                       push(@temp, 0);
-               } elsif ($elem =~ /^pre$/) {
-                       push(@temp, -1);
-               } elsif ($elem =~ /^rc$/) {
+               } elsif ($elem eq "pre" || $elem eq "rc") {
                        push(@temp, -1);
-               } elsif ($elem =~ /^beta$/) {
+               } elsif ($elem eq "beta") {
                        push(@temp, -2);
-               } elsif ($elem =~ /^alpha$/) {
+               } elsif ($elem eq "alpha") {
                        push(@temp, -3);
                } else {
                        push(@temp, 0);



Home | Main Index | Thread Index | Old Index