Bug 260246 - ports-mgmt/portlint: Suggests adding PY_FLAVOR when PY_FLAVOR exists
Summary: ports-mgmt/portlint: Suggests adding PY_FLAVOR when PY_FLAVOR exists
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Joe Marcus Clarke
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2021-12-06 00:53 UTC by risner
Modified: 2022-02-21 19:50 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (marcus)


Attachments
Split on @ first (568 bytes, patch)
2022-01-08 04:44 UTC, Derek Schrock
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description risner 2021-12-06 00:53:20 UTC
PORTNAME=       clvm
PORTVERSION=    0.9.7
CATEGORIES=     devel python
MASTER_SITES=   CHEESESHOP
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}

MAINTAINER=     risner@stdio.com
COMMENT=        Contract Language Chialisp Virtual Machine

LICENSE=        MIT

TEST_DEPENDS=   {PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}

USES=           python:3.7-3.9

.include <bsd.port.mk>

# portlint -A
WARN: Makefile: you may want directory for dependency {PYTHON_PKGNAMEPREFIX}pytest>0 to be devel/py-pytest@${PY_FLAVOR}

I've tried every way I could to get it to not complain about this


Ig nore the FATAL issue, I trimmed down the Makefile to the smallest size I could.
Comment 1 risner 2021-12-06 00:54:58 UTC
${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR}
The original comment was missing the $ at the start.
Comment 2 risner 2021-12-06 02:39:33 UTC
Works in 2.19.8, broken in 2.19.9
Comment 3 risner 2021-12-06 02:41:02 UTC
Also seems to effect all py- ports, but doesn't have issues with php ports.
Comment 4 risner 2021-12-06 02:50:17 UTC
portlint.pl
@@ -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);

This patch to portlint.pl is responsible for the break. I tested by applying this 3 line change to 2.19.8.

root@chiapos-dev:/usr/ports/ftp/py-aioftp # portlint -A
WARN: Makefile: you may want directory for dependency pytest>0 to be devel/py-pytest@${PY_FLAVOR}
Comment 5 Derek Schrock 2022-01-08 04:44:10 UTC
Created attachment 230806 [details]
Split on @ first

s/\$\{[^}]+}//g   The g removes all ${...} in each *_DEPENDS.

${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} ->  pytest>0:devel/py-pytest@

So later when split on @ 

1186       my ($di, $fl) = split(/\@/, $l[1]);

$fl is ""

So

if ($m{'fla'} ne '${PY_FLAVOR}')

Is true.

removing the g would fix it for python ports but maybe (re)breaks something else... see 259244

Possible fix with the attached patch for 2.19.9.

Split on @ first then remove the ${...}s
Comment 6 Joe Marcus Clarke freebsd_committer freebsd_triage 2022-02-21 19:32:31 UTC
Fixed in my local git repo pending next release.
Comment 7 Joe Marcus Clarke freebsd_committer freebsd_triage 2022-02-21 19:50:06 UTC
Fixed in 2.19.10.  Thanks!