From owner-svn-ports-all@freebsd.org Fri May 11 21:33:56 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C81CFCEAA5; Fri, 11 May 2018 21:33:56 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46D6C771BD; Fri, 11 May 2018 21:33:56 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 269CC1527F; Fri, 11 May 2018 21:33:56 +0000 (UTC) (envelope-from marcus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4BLXuPQ083290; Fri, 11 May 2018 21:33:56 GMT (envelope-from marcus@FreeBSD.org) Received: (from marcus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4BLXtJV083287; Fri, 11 May 2018 21:33:55 GMT (envelope-from marcus@FreeBSD.org) Message-Id: <201805112133.w4BLXtJV083287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcus set sender to marcus@FreeBSD.org using -f From: Joe Marcus Clarke Date: Fri, 11 May 2018 21:33:55 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r469697 - in head/ports-mgmt/portlint: . src X-SVN-Group: ports-head X-SVN-Commit-Author: marcus X-SVN-Commit-Paths: in head/ports-mgmt/portlint: . src X-SVN-Commit-Revision: 469697 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2018 21:33:56 -0000 Author: marcus Date: Fri May 11 21:33:55 2018 New Revision: 469697 URL: https://svnweb.freebsd.org/changeset/ports/469697 Log: Update to 2.18.0. Enough has happened that it's time for a minor bump. * Fix the check for duplicate SHEBANG_LANG values [1] * Check to make sure patch files end with newlines [2] * Allow flavored *_DEPENDS in the DEPENDS section [3] * Check that kde:4 OR kde:5 is defined with USE_KDE [4] * Add a check to make sure pkg-descr is at least a certain number of lines [5] * Fix a couple of typos [6] [7] * Allow for any *_DEPENDS item in the DEPENDS section and fix a bug in the dependency syntax checking [8] * Add a check to make sure Python dependencies include a FLAVOR [9] PR: 226709 [1] 226109 [2] 226581 [3] 227255 [5] 227729 [6] 227878 [7] 227556 [8] 225654 [9] Submitted by: tcberner [4] 0mp [5][6][7] Differential Revision: D13723 [4] Modified: head/ports-mgmt/portlint/Makefile head/ports-mgmt/portlint/pkg-descr head/ports-mgmt/portlint/src/portlint.pl Modified: head/ports-mgmt/portlint/Makefile ============================================================================== --- head/ports-mgmt/portlint/Makefile Fri May 11 21:08:06 2018 (r469696) +++ head/ports-mgmt/portlint/Makefile Fri May 11 21:33:55 2018 (r469697) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= portlint -PORTVERSION= 2.17.16 +PORTVERSION= 2.18.0 CATEGORIES= ports-mgmt MASTER_SITES= # none DISTFILES= # none Modified: head/ports-mgmt/portlint/pkg-descr ============================================================================== --- head/ports-mgmt/portlint/pkg-descr Fri May 11 21:08:06 2018 (r469696) +++ head/ports-mgmt/portlint/pkg-descr Fri May 11 21:33:55 2018 (r469697) @@ -1,2 +1,6 @@ -portlint makes a small set of sanity checks for port directory. Check out -portlint(1) for more details. +portlint tries to verify the content of a port directory with a small set of +sanity checks. The purpose of portlint can be separated into two parts: (1) to +let the submitters easily polish their own port directory, and (2) to decrease +the labor of the committers. + +Check out portlint(1) for more details. Modified: head/ports-mgmt/portlint/src/portlint.pl ============================================================================== --- head/ports-mgmt/portlint/src/portlint.pl Fri May 11 21:08:06 2018 (r469696) +++ head/ports-mgmt/portlint/src/portlint.pl Fri May 11 21:33:55 2018 (r469697) @@ -15,7 +15,7 @@ # was removed. # # $FreeBSD$ -# $MCom: portlint/portlint.pl,v 1.449 2018/02/18 21:02:27 jclarke Exp $ +# $MCom: portlint/portlint.pl,v 1.459 2018/05/11 21:26:56 jclarke Exp $ # use strict; @@ -49,8 +49,8 @@ $portdir = '.'; # version variables my $major = 2; -my $minor = 17; -my $micro = 16; +my $minor = 18; +my $micro = 0; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -159,7 +159,8 @@ my @varlist = qw( 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 + DEVELOPER SUB_FILES SHEBANG_LANG MASTER_SITES_SUBDIRS FLAVORS + USE_PYTHON ); my %makevar; @@ -466,8 +467,13 @@ sub checkdescr { my($file) = @_; my(%maxchars) = ($makevar{DESCR}, 80); my(%maxlines) = ($makevar{DESCR}, 24); - my(%errmsg) = ($makevar{DESCR}, "exceeds $maxlines{$makevar{DESCR}} ". + my(%minlines) = ($makevar{DESCR}, 3); + my(%toolongerrmsg) = ($makevar{DESCR}, + "exceeds $maxlines{$makevar{DESCR}} ". "lines, make it shorter if possible."); + my(%tooshorterrmsg) = ($makevar{DESCR}, + "contains less than $minlines{$makevar{DESCR}} ". + "lines, make it longer if possible."); my($longlines, $linecnt, $tmp) = (0, 0, ""); open(IN, "< $file") || return 0; @@ -499,8 +505,11 @@ sub checkdescr { $longlines++ if ($maxchars{$file} < length); } if ($linecnt > $maxlines{$file}) { - &perror("WARN", $file, -1, "$errmsg{$file}". + &perror("WARN", $file, -1, "$toolongerrmsg{$file}". "(currently $linecnt lines)"); + } elsif ($linecnt < $minlines{$file}) { + &perror("WARN", $file, -1, "$tooshorterrmsg{$file}". + "(currently $linecnt ".($linecnt > 1 ? "lines" : "line").")"); } else { print "OK: $file: has $linecnt lines.\n" if ($verbose); } @@ -834,7 +843,7 @@ sub checkplist { "DOCSDIR-safe (that is, a user can override DOCSDIR ". "when building this port and the port will still work ". "correctly) consider using DOCSDIR macro; if you are ". - "unsure if this this port is DOCSDIR-safe, then ignore ". + "unsure if this port is DOCSDIR-safe, then ignore ". "this warning"); $sharedocused++; } elsif ($_ =~ /^(\%\%PORTDOCS\%\%)?\%\%DOCSDIR\%\%/) { @@ -1037,7 +1046,7 @@ sub checkpatch { "``make makepatch'' when you need to [re-]generate a ". "patch to ensure proper patch format."); } - last; + # last; } } @@ -1055,6 +1064,11 @@ sub checkpatch { "from source files."); } + if ($whole !~ /\n$/s) { + &perror("FATAL", $file, -1, "patch does not end with a newline, and the commit check ". + "hook will fail."); + } + close(IN); } @@ -1079,13 +1093,17 @@ sub check_depends_syntax { next; } print "OK: checking ports listed in $j.\n" if ($verbose); - foreach my $k (split(/\s+/, $i)) { + my @ks = split(/\s+/, $i); + while (@ks) { + my $k = shift @ks; if ($k =~ /^#/) { last; } my $ok = $k; if ($k =~ /^\$\{(\w+)\}$/) { $k = get_makevar($1); + push @ks, split(/\s+/, $k); + next; } if ($k eq '') { next; @@ -1109,7 +1127,9 @@ sub check_depends_syntax { } my %m = (); $m{'dep'} = $l[0]; - $m{'dir'} = (split(/\@/, $l[1]))[0]; + my ($di, $fl) = split(/\@/, $l[1]); + $m{'dir'} = $di; + $m{'fla'} = $fl // ''; $m{'tgt'} = $l[2] // ''; my %depmvars = (); foreach my $dv ($m{'dep'}, $m{'dir'}, $m{'tgt'}) { @@ -1125,6 +1145,24 @@ sub check_depends_syntax { } } + # check Python flavor + my $bdir = basename($m{'dir'}); + if ($bdir =~ /^py-/) { + if (!defined($makevar{USE_PYTHON}) || + $makevar{USE_PYTHON} eq 'noflavors' || + $makevar{USE_PYTHON} eq '') { + if ($m{'fla'} ne '${PY_FLAVOR}') { + &perror("FATAL", $file, -1, "directory for dependency ". + "$m{'dep'} must be $m{'dir'}:\@\${PY_FLAVOR}"); + } + } else { + if ($m{'fla'} ne '${FLAVOR}') { + &perror("FATAL", $file, -1, "directory for dependency ". + "$m{'dep'} must be $m{'dir'}:\@\${FLAVOR}"); + } + } + } + # check JAVALIBDIR if ($m{'dep'} =~ m|share/java/classes|) { &perror("FATAL", $file, -1, "you should use \${JAVALIBDIR} ". @@ -1995,7 +2033,7 @@ xargs xmkmf $cmdnames{'env'} = '${SETENV}'; $cmdnames{'gunzip'} = '${GUNZIP_CMD}'; $cmdnames{'gzip'} = '${GZIP_CMD}'; - $cmdnames{'install'} = '${INSTALL_foobaa}'; + $cmdnames{'install'} = '${INSTALL_foobar}'; $cmdnames{'python'} = '${PYTHON_CMD}'; $cmdnames{'sdl-config'} = '${SDL_CONFIG}'; $cmdnames{'strip'} = '${STRIP_CMD}'; @@ -2227,10 +2265,10 @@ xargs xmkmf # whole file: USE_KDE check # if ($whole =~ /^USE_KDE[?:]?=\s*(.*)$/m) { - if ($makevar{USES} !~ /\bkde:5/) { + if ($makevar{USES} !~ /\bkde:[45]/) { my $lineno = &linenumber($`); &perror("WARN", $file, $lineno, "USE_KDE is defined without ". - "defining USES=kde:5"); + "defining USES=kde:[45]"); } } @@ -2341,10 +2379,17 @@ xargs xmkmf # # whole file: check for redundant SHEBANG_LANGs # - if ($whole =~ /\nSHEBANG_LANG[?+]?=\s*([^\s#]*).*\n/) { - my @shebang_langs = split(/\s+/, $1 // ''); + if ($whole =~ /^SHEBANG_LANG[?+]?=\s*(.*)$/m) { + my $sh_lang = $1; + my @shebang_langs = split(/\s+/, $makevar{SHEBANG_LANG} // ''); + my %sh_seen = (); foreach my $shebang_lang (@shebang_langs) { - if ($makevar{SHEBANG_LANG} =~ /\b$shebang_lang\b/) { + if ($sh_seen{$shebang_lang}) { + $sh_seen{$shebang_lang}++; + } else { + $sh_seen{$shebang_lang} = 1; + } + if ($sh_seen{$shebang_lang} > 1 && $sh_lang =~ /\b$shebang_lang\b/) { &perror("WARN", $file, -1, "$shebang_lang is already included in ". "SHEBANG_LANG. You should remove this from $file."); } @@ -3123,8 +3168,16 @@ TEST_DEPENDS FETCH_DEPENDS DEPENDS_TARGET check_depends_syntax($tmp, $file); foreach my $i (@linestocheck) { + foreach my $flavor (split(/\s+/, $makevar{FLAVORS} // '')) { + $tmp =~ s/${flavor}_$i[?+:]?=[^\n]+\n//g; + } $tmp =~ s/$i[?+:]?=[^\n]+\n//g; } + + # Remove any other *_DEPENDS lines as people may + # use a macro for common depends as described in + # section 5.9.2 of the Porter's Handbook. + $tmp =~ s/.+_DEPENDS[?+:]?=[^\n]+\n//g; &checkextra($tmp, '*_DEPENDS', $file);