From nobody Sat Nov 13 18:22:19 2021 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 26DEE18516EE; Sat, 13 Nov 2021 18:22:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hs3hX0SpBz4RrT; Sat, 13 Nov 2021 18:22:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E4FE418394; Sat, 13 Nov 2021 18:22:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ADIMJ8K015751; Sat, 13 Nov 2021 18:22:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ADIMJQN015750; Sat, 13 Nov 2021 18:22:19 GMT (envelope-from git) Date: Sat, 13 Nov 2021 18:22:19 GMT Message-Id: <202111131822.1ADIMJQN015750@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Joe Marcus Clarke Subject: git: c8fa510269fd - main - ports-mgmt/portlint: Update to 2.19.9 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: marcus X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c8fa510269fd8739e87703632b626dc0bccfe2ce Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by marcus: URL: https://cgit.FreeBSD.org/ports/commit/?id=c8fa510269fd8739e87703632b626dc0bccfe2ce commit c8fa510269fd8739e87703632b626dc0bccfe2ce Author: Joe Marcus Clarke AuthorDate: 2021-11-13 18:19:34 +0000 Commit: Joe Marcus Clarke CommitDate: 2021-11-13 18:19:34 +0000 ports-mgmt/portlint: Update to 2.19.9 * Update CONFLICTS check to cover all variables and checks performed by bsd.port.mk [1] * Add some other allowed fully-qualified paths [2] * Don't consider variable substitution when checking DEPENDS [3] PR: 259813 [2] 259244 [3] Sybmitted by: se [1] gerald [2] Differential Revision: https://reviews.freebsd.org/D32733 [1] --- ports-mgmt/portlint/Makefile | 2 +- ports-mgmt/portlint/src/portlint.pl | 51 ++++++++++++++++++++++++++----------- 2 files changed, 37 insertions(+), 16 deletions(-) diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index 41bec3134480..3149b7c9a1cd 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -1,7 +1,7 @@ # Created by: Jun-ichiro itojun Hagino PORTNAME= portlint -PORTVERSION= 2.19.8 +PORTVERSION= 2.19.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 1c5b7da8fa7b..87777de21918 100644 --- a/ports-mgmt/portlint/src/portlint.pl +++ b/ports-mgmt/portlint/src/portlint.pl @@ -44,12 +44,12 @@ $checkmfiles = 0; $contblank = 1; $portdir = '.'; -@ALLOWED_FULL_PATHS = qw(/boot/loader.conf /compat/ /dev/null /etc/inetd.conf); +@ALLOWED_FULL_PATHS = qw(/boot/loader.conf /compat/ /dev/null /etc/fstab /etc/inetd.conf /proc); # version variables my $major = 2; my $minor = 19; -my $micro = 8; +my $micro = 9; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -154,13 +154,14 @@ chdir "$portdir" || die "$portdir: $!"; # get make vars my @varlist = qw( - PORTNAME PORTVERSION PORTREVISION PORTEPOCH PKGNAME PKGNAMEPREFIX - PKGNAMESUFFIX DISTVERSIONPREFIX DISTVERSION DISTVERSIONSUFFIX - DISTNAME DISTFILES CATEGORIES MASTERDIR MAINTAINER MASTER_SITES - WRKDIR WRKSRC NO_WRKSUBDIR SCRIPTDIR FILESDIR + PORTNAME PORTVERSION PORTREVISION PORTEPOCH PKGNAME PKGBASE + PKGNAMEPREFIX PKGNAMESUFFIX DISTVERSIONPREFIX DISTVERSION + DISTVERSIONSUFFIX DISTNAME DISTFILES CATEGORIES MASTERDIR MAINTAINER + MASTER_SITES 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_QT USE_QT5 INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION + USE_GNOME USE_PERL5 USE_QT USE_QT5 INDEXFILE PKGORIGIN + CONFLICTS CONFLICTS_BUILD CONFLICTS_INSTALL 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 @@ -1161,7 +1162,9 @@ sub check_depends_syntax { if ($k eq '') { next; } - my @l = split(':', $k); + my $tmp_depends = $k; + $tmp_depends =~ s/\$\{[^}]+}//g; + my @l = split(':', $tmp_depends); print "OK: checking dependency value for $j.\n" if ($verbose); @@ -1378,6 +1381,7 @@ sub checkmakefile { my $docsused = 0; my $optused = 0; my $desktop_entries = ''; + my $conflicts = ""; my $masterdir = $makevar{MASTERDIR}; if ($masterdir ne '' && $masterdir ne $makevar{'.CURDIR'}) { @@ -2989,14 +2993,31 @@ DIST_SUBDIR EXTRACT_ONLY $pkg_version = $makevar{PKG_VERSION}; - if ($makevar{CONFLICTS}) { + $conflicts = $makevar{CONFLICTS}; + if ($makevar{CONFLICTS_BUILD}) { + $conflicts .= " " if $conflicts; + $conflicts .= $makevar{CONFLICTS_BUILD}; + } + if ($makevar{CONFLICTS_INSTALL}) { + $conflicts .= " " if $conflicts; + $conflicts .= $makevar{CONFLICTS_INSTALL}; + } + if ($conflicts) { print "OK: checking CONFLICTS.\n" if ($verbose); - foreach my $conflict (split ' ', $makevar{CONFLICTS}) { - `$pkg_version -T '$makevar{PKGNAME}' '$conflict'`; - my $selfconflict = !$?; - if ($selfconflict) { - &perror("FATAL", "", -1, "Package conflicts with itself. ". - "You should remove \"$conflict\" from CONFLICTS."); + my %seen; + foreach my $conflict (split ' ', $conflicts) { + if (not $seen{$conflict}) { + `$pkg_version -T '$makevar{PKGBASE}' '$conflict' || $pkg_version -T '$makevar{PKGNAME}' '$conflict'`; + my $selfconflict = !$?; + if ($selfconflict) { + &perror("FATAL", "", -1, "Package conflicts with itself. ". + "You should remove \"$conflict\" from CONFLICTS."); + } elsif ($conflict =~ m/-\[0-9\]\*$/) { + &perror("WARN", $file, -1, "CONFLICTS definition \"$conflict\" ". + "ends in redundant version pattern. ". + "You should remove \"-[0-9]*\" from that pattern."); + } + $seen{$conflict} = 1; } } }