diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2020-05-31 15:17:24 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2020-05-31 15:17:24 +0000 |
commit | 664cf492156399e4a1383e4bd9198b79a737f83c (patch) | |
tree | 93a468b6b9e8b99fcd34f9fa5c57ca48a9423312 /ports-mgmt/portlint | |
parent | ce350f8931bfd515c8e93f3e3debcd3a7a949fa3 (diff) | |
download | ports-664cf492156399e4a1383e4bd9198b79a737f83c.tar.gz ports-664cf492156399e4a1383e4bd9198b79a737f83c.zip |
Notes
Diffstat (limited to 'ports-mgmt/portlint')
-rw-r--r-- | ports-mgmt/portlint/Makefile | 3 | ||||
-rw-r--r-- | ports-mgmt/portlint/src/portlint.pl | 31 |
2 files changed, 25 insertions, 9 deletions
diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index 817d123802fe..38c7f7864fd3 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -2,8 +2,7 @@ # $FreeBSD$ PORTNAME= portlint -PORTVERSION= 2.19.1 -PORTREVISION= 1 +PORTVERSION= 2.19.2 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none diff --git a/ports-mgmt/portlint/src/portlint.pl b/ports-mgmt/portlint/src/portlint.pl index 9580f527e5f9..05336f32f6a2 100644 --- a/ports-mgmt/portlint/src/portlint.pl +++ b/ports-mgmt/portlint/src/portlint.pl @@ -15,7 +15,7 @@ # was removed. # # $FreeBSD$ -# $MCom: portlint/portlint.pl,v 1.512 2020/05/30 23:14:06 jclarke Exp $ +# $MCom: portlint/portlint.pl,v 1.515 2020/05/31 15:15:06 jclarke Exp $ # use strict; @@ -50,7 +50,7 @@ $portdir = '.'; # version variables my $major = 2; my $minor = 19; -my $micro = 1; +my $micro = 2; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -1972,7 +1972,7 @@ sub checkmakefile { ); print "OK: checking to see if certain macros are sorted.\n" if ($verbose); foreach my $sorted_macro (@macros_to_sort) { - while ($whole =~ /\n$sorted_macro.?=\s*([^#]+)(#.*)?\n/g) { + while ($whole =~ /\n$sorted_macro.?=\s*([^#\n]+)(#.*)?\n/g) { my $lineno = &linenumber($`); my $srex = $1; $srex =~ s/\s+$//; @@ -3831,11 +3831,19 @@ sub get_makevar { $result = `$cmd`; chomp $result; - $result =~ s/\n\n/\n\0\n/g; + # This bit of magic is interesting and repeated in the get_make* functions. + # It will ensure that all empty values for macros are replaced with a '\0' character + # to preserve their "place in line" for future parsing. This is only needed when passing + # multiple variables to these functions. + no warnings 'uninitialized'; + $result =~ s/(?:^|(?<=\n))(?=\n|$)/$1\0$3/g; if (${^CHILD_ERROR_NATIVE} != 0) { die "\nFATAL ERROR: make(1) died with status ${^CHILD_ERROR_NATIVE} and returned '$result'"; } + # If the final value is just a '\0' strip it out. + $result =~ s/^\0$//; + return $result; } @@ -3846,11 +3854,14 @@ sub get_makevar_shallow { $result = `$cmd`; chomp $result; - $result =~ s/\n\n/\n\0\n/g; + no warnings 'uninitialized'; + $result =~ s/(?:^|(?<=\n))(?=\n|$)/$1\0$3/g; if (${^CHILD_ERROR_NATIVE} != 0) { die "\nFATAL ERROR: make(1) died with status ${^CHILD_ERROR_NATIVE} and returned '$result'"; } + $result =~ s/^\0$//; + return $result; } @@ -3861,11 +3872,14 @@ sub get_makevar_raw { $result = `$cmd`; chomp $result; - $result =~ s/\n\n/\n\0\n/g; + no warnings 'uninitialized'; + $result =~ s/(?:^|(?<=\n))(?=\n|$)/$1\0$3/g; if (${^CHILD_ERROR_NATIVE} != 0) { die "\nFATAL ERROR: make(1) died with status ${^CHILD_ERROR_NATIVE} and returned '$result'"; } + $result =~ s/^\0$//; + return $result; } @@ -3877,11 +3891,14 @@ sub get_makeconf_var { $result =`$cmd`; chomp $result; - $result =~ s/\n\n/\n\0\n/g; + no warnings 'uninitialized'; + $result =~ s/(?:^|(?<=\n))(?=\n|$)/$1\0$3/g; if (${^CHILD_ERROR_NATIVE} != 0) { die "\nFATAL ERROR: make(1) died with status ${^CHILD_ERROR_NATIVE} and returned '$result'"; } + $result =~ s/^\0$//; + return $result; } |