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: reduce ...
details: https://anonhg.NetBSD.org/pkgsrc/rev/62206c9cd660
branches: trunk
changeset: 383147:62206c9cd660
user: rillig <rillig%pkgsrc.org@localhost>
date: Sat Aug 13 09:33:43 2022 +0000
description:
lintpkgsrc: cleanup: reduce line noise
diffstat:
pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diffs (50 lines):
diff -r c7abc4ba227e -r 62206c9cd660 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Sat Aug 13 09:11:12 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl Sat Aug 13 09:33:43 2022 +0000
@@ -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 @@
#
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 @@
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