diff options
author | marcus <marcus@FreeBSD.org> | 2014-01-05 13:52:23 +0800 |
---|---|---|
committer | marcus <marcus@FreeBSD.org> | 2014-01-05 13:52:23 +0800 |
commit | dd7ba14df6310d5500b90b22f2960a478c6e0a02 (patch) | |
tree | 8060551f24742f7f4fbab9d993c2ce72658d4dc7 /ports-mgmt/portlint | |
parent | b3a8540f5fb40431230d5f60c8d450caab4d7ded (diff) | |
download | freebsd-ports-gnome-dd7ba14df6310d5500b90b22f2960a478c6e0a02.tar.gz freebsd-ports-gnome-dd7ba14df6310d5500b90b22f2960a478c6e0a02.tar.zst freebsd-ports-gnome-dd7ba14df6310d5500b90b22f2960a478c6e0a02.zip |
Update to 2.14.9.
* Correct some unitialized problems that pop up with certain ports
* Replace USE_DOS2UNIX with USES=dos2unix
* Do not check for direct use of commands in OPTIONS descriptions
Reported by: Hardy Schumacher <hardy.schumacher@gmx.de>
Diffstat (limited to 'ports-mgmt/portlint')
-rw-r--r-- | ports-mgmt/portlint/Makefile | 2 | ||||
-rw-r--r-- | ports-mgmt/portlint/src/portlint.pl | 55 |
2 files changed, 38 insertions, 19 deletions
diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index 1e20aafb443a..add956dcd2fc 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= portlint -PORTVERSION= 2.14.8 +PORTVERSION= 2.14.9 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 3bbd1f8fa6d9..c22d291f2b0a 100644 --- a/ports-mgmt/portlint/src/portlint.pl +++ b/ports-mgmt/portlint/src/portlint.pl @@ -17,7 +17,7 @@ # OpenBSD and NetBSD will be accepted. # # $FreeBSD$ -# $MCom: portlint/portlint.pl,v 1.302 2013/12/29 05:26:49 marcus Exp $ +# $MCom: portlint/portlint.pl,v 1.305 2014/01/05 05:50:13 marcus Exp $ # use strict; @@ -52,7 +52,7 @@ $portdir = '.'; # version variables my $major = 2; my $minor = 14; -my $micro = 8; +my $micro = 9; sub l { '[{(]'; } sub r { '[)}]'; } @@ -207,6 +207,7 @@ my @varlist = qw( my %makevar; my $i = 0; for (split(/\n/, get_makevar(@varlist))) { + $_ =~ s/\0//; print "OK: makevar: $varlist[$i] = $_\n" if ($verbose); $makevar{$varlist[$i]} = $_; $i++; @@ -1082,7 +1083,7 @@ sub checkpatch { if ($whole =~ /
/) { my $lineno = &linenumber($`); &perror("WARN", $file, $lineno, "patch contains ^M characters. ". - "Consider defining USE_DOS2UNIX to remove DOS line endings ". + "Consider defining USES=dos2unix to remove DOS line endings ". "from source files."); } @@ -1755,10 +1756,14 @@ sub checkmakefile { my $edate; if (($edate) = ($whole =~ m/\nEXPIRATION_DATE\??=[ \t]*([^\n]*)\n/)) { my $lineno = &linenumber($`); - if ($edate ne strftime("%Y-%m-%d", 0, 0, 0, - substr($edate, 8, 2), - substr($edate, 5, 2) - 1, - substr($edate, 0, 4) - 1900)) { + my $ndate = $edate; + if ($ndate eq '' || length $ndate < 10) { + $ndate = '0000-00-00'; + } + if ($ndate ne strftime("%Y-%m-%d", 0, 0, 0, + substr($ndate, 8, 2), + substr($ndate, 5, 2) - 1, + substr($ndate, 0, 4) - 1900)) { &perror("FATAL", $file, $lineno, "EXPIRATION_DATE ($edate) is ". "either not in YYYY-MM-DD format or it is not a valid ". "date."); @@ -1896,7 +1901,7 @@ ruby sed sh sort sysctl touch tr which xargs xmkmf my $curline = $1; my $dte_test = $curline; $dte_test =~ s/^\s+//g; - if ($desktop_entries =~ /$dte_test$/) { + if ($desktop_entries =~ /\Q$dte_test\E$/) { next; } my $lineno = &linenumber($`); @@ -1913,6 +1918,7 @@ ruby sed sh sort sysctl touch tr which xargs xmkmf && $curline !~ /^WX_COMPS(.)?=[^\n]+$i/m && $curline !~ /^ONLY_FOR_ARCHS_REASON(.)?=[^\n]+$i/m && $curline !~ /^NOT_FOR_ARCHS_REASON(.)?=[^\n]+$i/m + && $curline !~ /^[A-Z0-9_]+_DESC=[^\n]+$i/m && $curline !~ /^\s*#.+$/m && $curline !~ /\-\-$i/m && $curline !~ /^COMMENT(.)?=[^\n]+$i/m) { @@ -2154,8 +2160,7 @@ ruby sed sh sort sysctl touch tr which xargs xmkmf # whole file: check for --build, --mandir, and --infodir # when GNU_CONFIGURE # - if (exists $makevar{GNU_CONFIGURE} && - $makevar{GNU_CONFIGURE} ne '' && + if ($makevar{GNU_CONFIGURE} ne '' && $makevar{CONFIGURE_ARGS} =~ /--(build|(man|info)dir)/) { &perror("WARN", $file, -1, "--build, --mandir, and --infodir ". "are not needed in CONFIGURE_ARGS as they are already set in ". @@ -2200,7 +2205,7 @@ ruby sed sh sort sysctl touch tr which xargs xmkmf "CFLAGS+=... instead"); } - if (defined($cxxflags) && $cflags !~ /\$\{CXXFLAGS/) { + if (defined($cxxflags) && $cxxflags !~ /\$\{CXXFLAGS/) { &perror("FATAL", $file, -1, "CXXFLAGS are clobbered in ". "CONFIGURE_ENV. Alter CXXFLAGS in the Makefile with ". "CXXFLAGS+=... instead"); @@ -2800,7 +2805,7 @@ DISTFILES EXTRACT_ONLY # print "OK: checking second section of $file (PATCH*: optional).\n" if ($verbose); - $tmp = $sections[$idx]; + $tmp = $sections[$idx] // ''; if ($tmp =~ /(PATCH_SITES|PATCH_SITE_SUBDIR|PATCHFILES|PATCH_DIST_STRIP)/) { &checkearlier($file, $tmp, @varnames); @@ -2836,7 +2841,7 @@ PATCH_SITES PATCHFILES PATCH_DIST_STRIP # print "OK: checking third section of $file (MAINTAINER).\n" if ($verbose); - $tmp = $sections[$idx]; + $tmp = $sections[$idx] // ''; &checkearlier($file, $tmp, @varnames); &checkorder('MAINTAINER', $tmp, $file, qw( @@ -2940,7 +2945,7 @@ MAINTAINER COMMENT # print "OK: checking fifth section of $file (*_DEPENDS).\n" if ($verbose); - $tmp = $sections[$idx]; + $tmp = $sections[$idx] // ''; # Check for direct assignment of BUILD_DEPENDS to RUN_DEPENDS. if ($tmp =~ /\nRUN_DEPENDS=[ \t]*\${BUILD_DEPENDS}/) { @@ -3228,7 +3233,7 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET if ($i ne '' && ! -f "files/$i.in") { &perror("FATAL", $file, -1, "$i listed in USE_RC_SUBR, ". "but files/$i.in is missing."); - } elsif ($i eq '' && $mvar ne '') { + } elsif ($i eq '' && $mvar && $mvar ne '') { &perror("WARN", $file, -1, "possible undefined make variable ". "$mvar used as the value for USE_RC_SUBR."); } @@ -3297,6 +3302,9 @@ sub checkorder { my(@items, $i, $j, $k, $invalidorder); print "OK: checking the order of $section section.\n" if ($verbose); + if (!defined($str)) { + $str = ''; + } @items = (); foreach my $i (split("\n", $str)) { @@ -3354,6 +3362,10 @@ sub checkearlier { my($file, $str, @varnames) = @_; my($i); + if (!defined($str)) { + $str = ''; + } + print "OK: checking items that has to appear earlier.\n" if ($verbose); foreach my $i (@varnames) { if ($str =~ /\n$i\??=/) { @@ -3448,6 +3460,8 @@ sub get_makevar { $result = `$cmd`; chomp $result; + $result =~ s/\n\n/\n\0\n/g; + return $result; } @@ -3458,6 +3472,8 @@ sub get_makevar_raw { $result = `$cmd`; chomp $result; + $result =~ s/\n\n/\n\0\n/g; + return $result; } @@ -3470,9 +3486,12 @@ sub is_predefined { $site_re =~ s,$subdir_re,/(.*)/,; if ($url =~ /$site_re/) { - &perror("WARN", $file, -1, "how about using ". - "\"\${MASTER_SITE_$predefined{$site}}\" with ". - "\"MASTER_SITE_SUBDIR=$1\", instead of \"$url\"?"); + my $pe = "how about using \"\${MASTER_SITE_$predefined{$site}}\" "; + if ($1) { + $pe .= "with \"MASTER_SITE_SUBDIR=$1\", "; + } + $pe .= "instead of \"$url\"?"; + &perror("WARN", $file, -1, $pe); return &TRUE; } } |