From nobody Wed Sep 07 17:24:44 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 4MN8JX4yKSz4bhVw; Wed, 7 Sep 2022 17:24:44 +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 4MN8JX4S4pz45gh; Wed, 7 Sep 2022 17:24:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662571484; 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=exkAk3XtTH0xKFoLc6zNYbUQqSzOFbEqSDrWllgOBTA=; b=FejHzbs8EU76E3aHiu+JrIPGXW4sEpApFzAxKZjwqMfLdbvilbJs8tb9L2jbGYJeV87+J/ xnTjzZ1vE7CFBqPcm/EBDwBFehRqujufCN0UeZJ3IVcNkj87+ySm+PG5IS/JYnkpzB6nMd jNQoG8Y7rE2fA9dWIigC1+d2EmAlhqMh2ofQ++/OJmlS8dMmfmLfnqtEAypGmckdz63X+X V02VGrFRc/gsM8q31ZCtRyjdX3uBA48hBoXaoK2mPmwkshh2gG6v2xop2enRnHSD6LSMa5 3yEpfF3XnKpUVjL5zGYZcirN3pKETEirzkrk9tb1H9wAdsPC91704zw5vtYh9g== 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 4MN8JX3TwNzbjM; Wed, 7 Sep 2022 17:24:44 +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 287HOisZ091402; Wed, 7 Sep 2022 17:24:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 287HOi5J091401; Wed, 7 Sep 2022 17:24:44 GMT (envelope-from git) Date: Wed, 7 Sep 2022 17:24:44 GMT Message-Id: <202209071724.287HOi5J091401@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: 9800743f0178 - main - ports-mgmt/portlint: Update to 2.19.13 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: 9800743f0178a43313a7248f7ef2bcabfacef23d Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662571484; 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=exkAk3XtTH0xKFoLc6zNYbUQqSzOFbEqSDrWllgOBTA=; b=onBVKOsjbMdH0FpcgmCRgNRbmqB+61P29fVjaRTSX/0gryqFCZHWdyJTFHB/UsuOhgwLYM MZVEc7X+0XTglMP2CmAdd158lRlhdpsaZLNyiXUID1gFjemhVfJRVFTI5xuq7tK81mlYSh h0wEGzKqyC1tT1435Ay7RjyBJqR6w9w812FaqBd8EUYvqxgh0MEAYOMg5hzQlUW8P9Pu1W mnSw5BLM4Wxulhy4LQjE7Ds3ZdsmBGVVebk6HI0CGSwxwB1NyFSqdtyEkdS5+Qy46nNi2N dsNysu7r5/kCwyH7cfHx5bA4VKLJZ8Kk11NiXG8UUKMTuFm+VPT2mInRaegIpw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662571484; a=rsa-sha256; cv=none; b=uDF2+J2G925/mOZ0dGNOeywY6V4yN/YDMe7i3G4RFwGhYY53zNrqkMiH9ErDX/uaedNSeQ WC46pYnrcovgKNmBNntW6zdOhlYJ3nXb/QSKMGqCg6gt3L3+2a0qcTHHEpJabk8ZZZZXqg YIJp6mjnG1CJlonuSlJxCsHn3JWyAvIohwoJxuTjVXbi0s0O5eItMct+BNkoBzrQgfG8OV wd7IbFAW4/wrhb9KIUWLmCJCqODUzAK6vhj0gkfaYYT1gFc29ov7fC7+/eLaTY25J7axKO 6a99AdpTvvFrKEPcM8E7WNWDpkwV0BI2KyzIWJyD5o8JPZQphCM2ivMPcGMsdw== 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=9800743f0178a43313a7248f7ef2bcabfacef23d commit 9800743f0178a43313a7248f7ef2bcabfacef23d Author: Joe Marcus Clarke AuthorDate: 2022-09-07 17:21:52 +0000 Commit: Joe Marcus Clarke CommitDate: 2022-09-07 17:24:21 +0000 ports-mgmt/portlint: Update to 2.19.13 * Allow for a plus ('+') in other places in a PORTVERSION [1] * Check for .dkestop file installation [2] * Support the new Makefile WWW macro [3] PR: 265364 [1] 265551 [2] 266068 [3] Submitted by: Robert Clausecker [1] se [3] --- ports-mgmt/portlint/Makefile | 2 +- ports-mgmt/portlint/src/portlint.pl | 71 +++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 20 deletions(-) diff --git a/ports-mgmt/portlint/Makefile b/ports-mgmt/portlint/Makefile index 9a51dce38102..7337cb80195f 100644 --- a/ports-mgmt/portlint/Makefile +++ b/ports-mgmt/portlint/Makefile @@ -1,5 +1,5 @@ PORTNAME= portlint -PORTVERSION= 2.19.12 +PORTVERSION= 2.19.13 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 c2cd2dbb0e9d..d7fa42fbd4e7 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 = 12; +my $micro = 13; # default setting - for FreeBSD my $portsdir = '/usr/ports'; @@ -158,7 +158,7 @@ my @varlist = qw( 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 + PKGDIR COMMENT WWW 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 CONFLICTS_BUILD CONFLICTS_INSTALL PKG_VERSION @@ -490,7 +490,7 @@ sub checkdescr { my($file) = @_; my(%maxchars) = ($makevar{DESCR}, 80); my(%maxlines) = ($makevar{DESCR}, 24); - my(%minlines) = ($makevar{DESCR}, 3); + my(%minlines) = ($makevar{DESCR}, 2); my(%toolongerrmsg) = ($makevar{DESCR}, "exceeds $maxlines{$makevar{DESCR}} ". "lines, make it shorter if possible."); @@ -515,10 +515,10 @@ sub checkdescr { } if (/^WWW:(\s+)(\S*)/) { my $wwwurl = $2; - if ($1 ne ' ') { - &perror("WARN", $file, -1, "use WWW: with a single space, ". - "then $wwwurl"); - } + &perror("WARN", $file, -1, "the URL of the project website has been ". + "moved into the Makefile. ". + "Remove the WWW: line from this file and add \"WWW=$wwwurl\"". + "to the Makefile immediately below the COMMENT line."); if ($wwwurl !~ m|^https?://|) { &perror("WARN", $file, -1, "WWW URL, $wwwurl should begin ". "with \"http://\" or \"https://\"."); @@ -821,6 +821,11 @@ sub checkplist { "for more details)"); } + if ($_ =~ m|\.desktop$| && $makevar{USES} !~ /\bdesktop-file-utils\b/) { + &perror("FATAL", $file, $., "this port installs .desktop files. ". + "Please add `desktop-file-utils` to USES."); + } + if ($_ =~ m|^(%%([^%]+)%%)?.*\.mo$| && $makevar{USES} !~ /\bgettext\b/) { my $show_nls_warn = 1; if ($2) { @@ -1569,6 +1574,10 @@ sub checkmakefile { &perror("FATAL", "", -1, "PLIST_FILES: files cannot contain ". "%%FOO%% variables. Use make variables and logic instead"); } + if ($plist_file =~ m|\.desktop$| && $makevar{USES} !~ /\bdesktop-file-utils\b/) { + &perror("FATAL", "", -1, "PLIST_FILES: this port installs .desktop files. ". + "please add `desktop-file-utils` to USES."); + } } } @@ -2171,6 +2180,7 @@ xargs xmkmf && $curline !~ /^NO_PACKAGE(.)?=[^\n]+$i/m && $curline !~ /^NO_CDROM(.)?=[^\n]+$i/m && $curline !~ /^MAINTAINER(.)?=[^\n]+$i/m + && $curline !~ /^WWW(.)?=[^\n]+$i/m && $curline !~ /^CATEGORIES(.)?=[^\n]+$i/m && $curline !~ /^(\w+)?USES(.)?=[^\n]+$i/m && $curline !~ /^WX_COMPS(.)?=[^\n]+$i/m @@ -2205,6 +2215,7 @@ xargs xmkmf && $lm !~ /^NO_PACKAGE(.)?=[^\n]+($i\d*)/m && $lm !~ /^NO_CDROM(.)?=[^\n]+($i\d*)/m && $lm !~ /^MAINTAINER(.)?=[^\n]+($i\d*)/m + && $lm !~ /^WWW(.)?=[^\n]+($i\d*)/m && $lm !~ /^CATEGORIES(.)?=[^\n]+($i\d*)/m && $lm !~ /^USES(.)?=[^\n]+$i/m && $lm !~ /^[A-Z0-9_]+_DESC=[^\n]+($i\d*)/m @@ -2677,15 +2688,16 @@ EOF &perror("WARN", $file, -1, "Version required is no longer needed in the comment section."); } - # - # for the rest of the checks, comment lines are not important. - # - for ($i = 0; $i < scalar(@sections); $i++) { - $sections[$i] = "\n" . $sections[$i]; - $sections[$i] =~ s/\n#[^\n]*//g; - $sections[$i] =~ s/\n\n+/\n/g; - $sections[$i] =~ s/^\n//; - } + } + + # + # for the rest of the checks, comment lines are not important. + # + for ($i = 0; $i < scalar(@sections); $i++) { + $sections[$i] = "\n" . $sections[$i]; + $sections[$i] =~ s/\n#[^\n]*//g; + $sections[$i] =~ s/\n\n+/\n/g; + $sections[$i] =~ s/^\n//; } # @@ -2972,7 +2984,7 @@ DIST_SUBDIR EXTRACT_ONLY &perror("FATAL", $file, -1, "either PORTVERSION or DISTVERSION must be specified"); } if ($portversion =~ /^pl[0-9]*$/ - || $portversion =~ /^[0-9]*[A-Za-z]?[0-9]*(\.[0-9]*[A-Za-z]?[0-9+]*)*$/) { + || $portversion =~ /^[0-9]*[A-Za-z]?[0-9]*([.+][0-9]*[A-Za-z]?[0-9+]*)*$/) { print "OK: PORTVERSION \"$portversion\" looks fine.\n" if ($verbose); } elsif ($portversion =~ /^[^\-]*\$[{\(].+[\)}][^\-]*$/) { &perror("WARN", $file, -1, "using variable, \"$portversion\", as version ". @@ -3176,7 +3188,7 @@ PATCH_SITES PATCHFILES PATCH_DIST_STRIP &checkearlier($file, $tmp, @varnames); &checkorder('MAINTAINER', $tmp, $file, qw( -MAINTAINER COMMENT +MAINTAINER COMMENT WWW )); $tmp = "\n" . $tmp; @@ -3226,10 +3238,31 @@ MAINTAINER COMMENT } } + # check WWW + if ($tmp !~ /\nWWW.?=\s*(\S+)/) { + &perror("WARN", $file, -1, "WWW should exist and immediately follow COMMENT.") unless ($makevar{WWW} ne ''); + } + + # check for correctness + { + my $wwwurl = $1 // $makevar{WWW}; + if ($wwwurl and $wwwurl !~ m|^https?://|) { + &perror("WARN", $file, -1, "WWW URL, $wwwurl should begin with \"http://\" or \"https://\"."); + } + if ($wwwurl =~ m|search.cpan.org|) { + if ($wwwurl =~ m|^http.?://search.cpan.org/~|) { + &perror("WARN", $file, -1, "consider changing WWW URL to https://search.cpan.org/dist/$makevar{PORTNAME}/"); + } + if ($wwwurl =~ m,/$,) { + &perror("WARN", $file, -1, "end WWW CPAN URL with a \"/\""); + } + } + } + $idx++; push(@varnames, qw( -MAINTAINER COMMENT +MAINTAINER COMMENT WWW )); #