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 Aug 13 09:33:43 UTC 2022

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

Log Message:
lintpkgsrc: cleanup: reduce line noise


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 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.81 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.82
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.81 Fri Aug 12 22:45:14 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Sat Aug 13 09:33:43 2022
@@ -1,6 +1,6 @@
 #!@PERL5@
 
-# $NetBSD: lintpkgsrc.pl,v 1.81 2022/08/12 22:45:14 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.82 2022/08/13 09:33:43 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -540,7 +540,7 @@ sub parse_makefile_vars($file, $cwd = un
                #
                if (m#^ \. \s* if(|def|ndef) \s+ (.*) #x) {
                        my $type = $1;
-                       if ($if_false[$#if_false]) {
+                       if ($if_false[-1]) {
                                push @if_false, 2;
 
                        } elsif ($type eq '') {
@@ -557,23 +557,23 @@ sub parse_makefile_vars($file, $cwd = un
                        debug("$file: .if$type (! @if_false)\n");
 
                } elsif (m#^ \. \s* elif \s+ (.*)#x && @if_false) {
-                       if ($if_false[$#if_false] == 0) {
-                               $if_false[$#if_false] = 2;
-                       } elsif ($if_false[$#if_false] == 1
+                       if ($if_false[-1] == 0) {
+                               $if_false[-1] = 2;
+                       } elsif ($if_false[-1] == 1
                            && !parse_eval_make_false($1, \%vars)) {
-                               $if_false[$#if_false] = 0;
+                               $if_false[-1] = 0;
                        }
                        debug("$file: .elif (! @if_false)\n");
 
                } elsif (m#^ \. \s* else \b #x && @if_false) {
-                       $if_false[$#if_false] = $if_false[$#if_false] == 1 ? 0 : 1;
+                       $if_false[-1] = $if_false[-1] == 1 ? 0 : 1;
                        debug("$file: .else (! @if_false)\n");
 
                } elsif (m#^\. \s* endif \b #x) {
                        pop(@if_false);
                        debug("$file: .endif (! @if_false)\n");
 
-               } elsif ($if_false[$#if_false]) {
+               } elsif ($if_false[-1]) {
                        # Skip branches whose condition evaluated to false.
 
                } elsif (m#^\. \s* include \s+ "([^"]+)" #x) {



Home | Main Index | Thread Index | Old Index