diff options
author | Joe Marcus Clarke <marcus@FreeBSD.org> | 2018-09-16 17:51:43 +0000 |
---|---|---|
committer | Joe Marcus Clarke <marcus@FreeBSD.org> | 2018-09-16 17:51:43 +0000 |
commit | f6a09b8a5a2080c36fe842cfc9722936ebbe32c5 (patch) | |
tree | f06efaeff4374fde3a9a3b409837287d500dd105 /ports-mgmt | |
parent | 37a182cb4cfb9c41187bb0ac883202448c8587f4 (diff) | |
download | ports-f6a09b8a5a2080c36fe842cfc9722936ebbe32c5.tar.gz ports-f6a09b8a5a2080c36fe842cfc9722936ebbe32c5.zip |
Notes
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/portlint/Makefile | 2 | ||||
-rw-r--r-- | ports-mgmt/portlint/src/portlint.pl | 90 |
2 files changed, 81 insertions, 11 deletions
diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index 527162b3ee9f..77a6013bb71e 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= portlint -PORTVERSION= 2.18.3 +PORTVERSION= 2.18.4 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 f466fe68c48f..8638ed246685 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.467 2018/06/24 16:07:04 jclarke Exp $ +# $MCom: portlint/portlint.pl,v 1.473 2018/09/16 17:48:44 jclarke Exp $ # use strict; @@ -50,7 +50,7 @@ $portdir = '.'; # version variables my $major = 2; my $minor = 18; -my $micro = 3; +my $micro = 4; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -153,14 +153,14 @@ my @varlist = qw( WRKDIR WRKSRC NO_WRKSUBDIR SCRIPTDIR FILESDIR PKGDIR COMMENT DESCR PLIST PKGCATEGORY PKGINSTALL PKGDEINSTALL PKGREQ PKGMESSAGE DISTINFO_FILE .CURDIR USE_LDCONFIG USE_AUTOTOOLS - USE_GNOME USE_PERL5 USE_QT5 INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION + USE_GNOME USE_PERL5 USE_QT USE_QT5 INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PLIST_FILES PLIST_DIRS PORTDOCS PORTEXAMPLES OPTIONS_DEFINE OPTIONS_RADIO OPTIONS_SINGLE OPTIONS_MULTI OPTIONS_GROUP OPTIONS_SUB INSTALLS_OMF USE_RC_SUBR USES DIST_SUBDIR ALLFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS GNU_CONFIGURE CONFIGURE_ARGS MASTER_SITE_SUBDIR LICENSE LICENSE_COMB NO_STAGE DEVELOPER SUB_FILES SHEBANG_LANG MASTER_SITES_SUBDIRS FLAVORS - USE_PYTHON + USE_PYTHON LICENSE_PERMS ); my %makevar; @@ -1713,7 +1713,7 @@ sub checkmakefile { # skip global options next if ($i eq 'DOCS' or $i eq 'NLS' or $i eq 'EXAMPLES' or $i eq 'IPV6' or $i eq 'X11' or $i eq 'DEBUG'); if (!grep(/^$i$/, (@mopt, @popt))) { - if ($whole !~ /\n${i}_($m)(_\w+)?(.)?=[^\n]+/) { + if ($whole !~ /\n${i}_($m)(_\w+)?(.)?=[^\n]+/ and $whole !~ /\n[-\w]+-${i}-(on|off):\n/) { if (!$slaveport) { &perror("WARN", $file, -1, "$i is listed in ". "OPTIONS_DEFINE, but no PORT_OPTIONS:M$i appears."); @@ -3101,6 +3101,21 @@ MAINTAINER COMMENT &perror("FATAL", $file, -1, "LICENSE_COMB contains invalid value '$1' - must be one of 'single', 'dual', 'multi'"); } + # Check for proper license file usage + if ($tmp =~ /\nLICENSE_FILE_([^\s=]+)([\s=])/) { + my $lfn = $1; + my $nchar = $2; + if ($lfn ne $makevar{LICENSE}) { + &perror("FATAL", $file, -1, "license specified is $makevar{LICENSE}, ". + "but LICENSE_FILE specified is for $lfn."); + } + + if ($lfn =~ /\+$/ && $nchar eq '=') { + &perror("WARN", $file, -1, "if license ends with a '+', make sure ". + "LICENSE_FILE_$lfn is followed by a space before the '='."); + } + } + $idx++; push(@varnames, qw( @@ -3184,8 +3199,55 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET push(@varnames, @linestocheck); &checkearlier($file, $tmp, @varnames); + # section 8: FLAVORS/FLAVOR(optional) + # + print "OK: check eighth section of $file (FLAVORS: optional).\n" + if ($verbose); + $tmp = $sections[$idx] // ''; + + if ($tmp =~ /(FLAVORS|FLAVOR)/) { + &checkearlier($file, $tmp, @varnames); + + $idx++; + } + + push(@varnames, qw( + FLAVORS FLAVOR + )); + + # section 9: USES/USE_x(optional) + # + print "OK: check ninth section of $file (USES: optional).\n" + if ($verbose); + $tmp = $sections[$idx] // ''; + + if ($tmp =~ /(USES|USE_)/) { + &checkearlier($file, $tmp, @varnames); + + foreach my $line (split(/(USE(?:S[?+]|[_\w\d]+)?=[^\n]+\n)/, $tmp)) { + if ($line =~ /USES[?+]?=[^\n]+\n/) { + print "OK: seen USES.\n" if ($verbose); + $tmp =~ s/USES[?+]?=[^\n]+\n//; + next; + } + if ($line =~ /USE([_\w\d]+)=[^\n]+\n/) { + print "OK: seen USE$1.\n" if ($verbose); + $tmp =~ s/USE([_\w\d]+)=[^\n]+\n//; + next; + } + } + + &checkextra($tmp, 'USES/USE_x', $file); + + $idx++; + } + + push(@varnames, qw( + USES + )); + # - # Makefile 7: check the rest of file + # Makefile 10: check the rest of file # print "OK: checking the rest of the $file.\n" if ($verbose); $tmp = join("\n\n", @sections[$idx .. scalar(@sections)-1]); @@ -3253,9 +3315,16 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET # check RESTRICTED/NO_CDROM/NO_PACKAGE print "OK: checking RESTRICTED/NO_CDROM/NO_PACKAGE.\n" if ($verbose); - if ($committer && $tmp =~ /\n(RESTRICTED|NO_CDROM|NO_PACKAGE)[+?]?=/) { - &perror("WARN", $file, -1, "\"$1\" found. do not forget to update ". - "ports/LEGAL."); + my $lps = $makevar{LICENSE_PERMS} // ''; + if ($committer && ($tmp =~ /\n(RESTRICTED|NO_CDROM|NO_PACKAGE)[+?]?=/ || + $lps =~ /\bno-\b/)) { + &perror("WARN", $file, -1, "Restrictive licensing found. ". + "Do not forget to update ports/LEGAL."); + } + + if ($tmp =~ /\nNO_PACKAGE[+?]?=/) { + &perror("WARN", $file, -1, "NO_PACKAGE is obsolete. It should be ". + "replaced with \"LICENSE_PERMS=no-pkg-mirror\""); } # check NO_STAGE @@ -3302,6 +3371,7 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET "you do not need $1."); } + # check direct use of important make targets. if ($tmp =~ /\n(fetch|extract|patch|configure|build|install):/) { &perror("FATAL", $file, -1, "direct redefinition of make target \"$1\" ". @@ -3691,7 +3761,7 @@ sub urlcheck { # GNOME wants INSTALL_ICONS, but Qt-based applications, including KDE, don't. # Be pessimistic: everything needs it unless we know it doesn't. sub needs_installs_icons { - return $makevar{USE_QT5} eq '' + return $makevar{USE_QT5} eq '' && $makevar{USE_QT} eq '' } sub TRUE {1;} |