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: cleanup: replace...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/60af577b19a7
branches:  trunk
changeset: 382518:60af577b19a7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jul 30 09:32:05 2022 +0000

description:
lintpkgsrc: cleanup: replace regular expressions with string comparison

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diffs (36 lines):

diff -r 172a7a7bacee -r 60af577b19a7 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jul 30 09:23:19 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jul 30 09:32:05 2022 +0000
@@ -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 @@
        # 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 =~ /^\.$/) {
-                       push(@temp, 0);
-               } elsif ($elem =~ /^_$/) {
+               } elsif ($elem eq "pl" || $elem eq "." || $elem eq "_") {
                        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