From nobody Sun Jul 17 15:38:23 2022 X-Original-To: dev-commits-ports-main@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 4Lm8Pq5PWxz4WbKD; Sun, 17 Jul 2022 15:38:23 +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 4Lm8Pq4n0tz3n3q; Sun, 17 Jul 2022 15:38:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658072303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9w57Rrugfcs9sZL4Jc6SZeu1fuUvT1esFF4wiJku3c=; b=mTtGPW+QroX6Y+DRtNg+bUaoxfjfMS8tiOD39fia43XhreSOinhRelOuZ7rSLezMayjj8h SdYsEt8GuLrddLbMXrpKfPCdez+BNKycNXnwXVKADdMG1oNPx8+shsoHpsesivofH7RRDO 2/mAO03qrfEuRMCNexlzR1m5h+XX/SBHYgxRTldivrQHyGZRfPcEx5NW/C/MPPzQTVaJ29 WC2/BDn3NBsxnAUAEj89Zz+ow8DfIwr4WY1J7YJunKt4XPoNudOqgkMtb9huwXx9xBYqtZ tM3adWvMiAn/FI0vaDir0Bf8A19yevCc9zNOWsO9D56ukWl4E9YFJRLxE9opYw== 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 4Lm8Pq3qDjz150x; Sun, 17 Jul 2022 15:38:23 +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 26HFcNJ5053266; Sun, 17 Jul 2022 15:38:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26HFcNjF053265; Sun, 17 Jul 2022 15:38:23 GMT (envelope-from git) Date: Sun, 17 Jul 2022 15:38:23 GMT Message-Id: <202207171538.26HFcNjF053265@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: 415d07a06fc5 - main - ports-mgmt/portlint: Update to 2.19.12 List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@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: 415d07a06fc5429d9d3630166b99b33219150d02 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658072303; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=o9w57Rrugfcs9sZL4Jc6SZeu1fuUvT1esFF4wiJku3c=; b=wCV+GnEluRP2VPzuo5i/m2TS/TlpU4wSxC76cIEuSYDl/usRtMofob9GtnlCjpxDbmjicf Qd1q8ZR1ybkNveouWcyKCQxq9g3u4ra0WsgOXFHBBrTvxcWlJXuuP5fdTkxil/SEhm69Xo fmG1fYyYtEsWTwLgUM+8HXAdkSJds1W3J7Y5wq6fDRPhpwZfLoC4uwZIa0hW9VclUYQppD OUbZhm+v9y8lRqjpfP4rAm11B2LinFDi0/y65iwdtVBLFrjJjpjPOie8DNq47zBQZCFMha m8RUKbCNVp9n//uFs2bnah9UxCaZ4PSEmOSz+y6l+fWNKK22szbcvo5W4c2ykQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658072303; a=rsa-sha256; cv=none; b=ZjxlKBdy7XpVDeTll6VjKVl4rNVCcf6QB7O0AxkHs31EWzX+b485paQF+Z52cWvKdS8jER EU66tgEB5dQfyD6A3AzsCLbam88zaA4RFsALf1g9VzrKID8A087xww+4oVPcIA2DjLMwnD JnekDOsNY7ZwqWZd8x0kbtijnyoa3UTsulfrdvwbshFRfnCzUav1yCSy2Z6dprZgtm/1Kd Mb8w1bd7KtPtBjmowlwDH704SMNZsOG/1Jkcuwsv8k2r0X00tGmVb0dt42f0Svfhcl3GUa knOjoqhpK6Cji5blFD2MBexwCIDKV9iTo9jy7/xyCxmv2Y/gGKnoxhQI7oT7oQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by marcus: URL: https://cgit.FreeBSD.org/ports/commit/?id=415d07a06fc5429d9d3630166b99b33219150d02 commit 415d07a06fc5429d9d3630166b99b33219150d02 Author: Stefan Eßer AuthorDate: 2022-07-17 15:37:21 +0000 Commit: Joe Marcus Clarke CommitDate: 2022-07-17 15:37:21 +0000 ports-mgmt/portlint: Update to 2.19.12 In a discussion with members of the port managers team (tcberner, rene) the issue of conflicting package base names came up. I have offered to create portlint checks for 2 possible Makefile issues: 1) Conflicting use of ${PKGBASE} of an existing port. 2) Multiple flavors resulting in the same ${PKGBASE}. The attached patch adds checks for both possible issues: 1) Check for the existence of the new PKGBASE in the INDEX file (if present) and warn if it is used for a different ORIGIN. 2) Generate PKGBASE for all FLAVORS and check for duplicates. PR: 263807 --- ports-mgmt/portlint/Makefile | 2 +- ports-mgmt/portlint/src/portlint.pl | 42 +++++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index e14f2f36de92..68beab3bef29 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.11 +PORTVERSION= 2.19.12 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 ddeb7d290c7d..c2cd2dbb0e9d 100644 --- a/ports-mgmt/portlint/src/portlint.pl +++ b/ports-mgmt/portlint/src/portlint.pl @@ -49,7 +49,7 @@ $portdir = '.'; # version variables my $major = 2; my $minor = 19; -my $micro = 11; +my $micro = 12; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -1364,6 +1364,7 @@ sub checkmakefile { my(@mman, @pman); my(@aopt, @mopt, @opt); my($pkg_version, $versiondir, $versionfile) = ('', '', ''); + my $indexfile = ''; my $useindex = 0; my %deprecated = (); my @deplist = (); @@ -3013,10 +3014,11 @@ DIST_SUBDIR EXTRACT_ONLY $versiondir = $ENV{VERSIONDIR} // '/var/db/chkversion'; + $indexfile = "$portsdir/$makevar{INDEXFILE}"; $versionfile = "$versiondir/VERSIONS"; $useindex = !-r "$versionfile"; - $versionfile = "$portsdir/$makevar{INDEXFILE}" + $versionfile = $indexfile if $useindex; if (-r "$versionfile") { @@ -3054,6 +3056,42 @@ DIST_SUBDIR EXTRACT_ONLY close VERSIONS; } + # use INDEX (if present) to check for PKGBASE collisions + if (-r "$indexfile") { + open INDEX, "<$portsdir/$makevar{INDEXFILE}"; + while () { + my($origin, $pkgbase) = ('', ''); + chomp; + next if /^(#|$)/; + ($pkgbase, $origin) = split /\|/; + $pkgbase =~ s,-[^-]+$,,; + $origin =~ s,^.*/([^/]+/[^/]+)/?$,$1,; + if ($pkgbase eq $makevar{PKGBASE} and $origin ne $makevar{PKGORIGIN}) { + &perror("FATAL", $file, -1, "The package base name \"$makevar{PKGBASE}\" is already in use by the \"$origin\" port. ". + "Choose another PORTNAME or use a PKGNAMEPREFIX or PKGNAMESUFFIX."); + } + } + close INDEX; + } + + # verify that all flavors have distinct names + if ($makevar{FLAVORS}) { + my %PKGFLAVOR; + my @FLAVORS = split(/ /, $makevar{FLAVORS}); + my $makeenv_save = $makeenv; + for my $flavor (@FLAVORS) { + $makeenv = $makeenv_save . " FLAVOR=$flavor"; + my $pkgbase = &get_makevar("PKGBASE"); + if ($PKGFLAVOR{$pkgbase}) { + &perror("FATAL", $file, -1, "The flavors \"$PKGFLAVOR{$pkgbase}\" and \"$flavor\" both generate a package named \"$pkgbase\". ". + "Make the package names unique, e.g., with different PKGNAMEPREFIX or PKGNAMESUFFIX values for each flavor."); + } else { + $PKGFLAVOR{$pkgbase} = $flavor; + } + } + my $makeenv = $makeenv_save; + } + # if DISTFILES have only single item, it is better to avoid DISTFILES # and to use combination of DISTNAME and EXTRACT_SUFX (unless USE_GITHUB # or USE_GITLAB is set to nodefault in which case it is fine).