Bug 27182 - Teach portlint to recognize RUN_DEPENDS=${BUILD_DEPENDS} and the like
Summary: Teach portlint to recognize RUN_DEPENDS=${BUILD_DEPENDS} and the like
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Michael Haro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-05-07 16:30 UTC by Anton Berezin
Modified: 2002-09-14 19:57 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1001 bytes, patch)
2001-05-07 16:30 UTC, Anton Berezin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Berezin 2001-05-07 16:30:05 UTC
Quite a number of ports use a construction of a form

RUN_DEPENDS=${BUILD_DEPENDS}

This is very useful, and is better than the alternative of specifying
the same dependencies twice.

Unfortunately, portlint does not like this construct.

I think that portlint should be modified to specifically allow
such things.

How-To-Repeat: Run portlint on, for example, textproc/p5-Text-Graphics
Comment 1 Clive Lin freebsd_committer freebsd_triage 2001-05-07 17:03:12 UTC
Responsible Changed
From-To: freebsd-ports->mharo

Over to maintainer.
Comment 2 clive 2001-05-07 17:06:38 UTC
I didn't pay too much attention on these 'funny characters', but
anyway, it works fine for me :-)

On Mon, May 07, 2001 at 05:25:33PM +0200, tobez@tobez.org wrote:
> --- src/portlint.pl.orig	Mon May  7 11:52:20 2001
> +++ src/portlint.pl	Mon May  7 17:09:58 2001
> @@ -1222,12 +1222,24 @@
>  	if ($tmp =~ /(LIB_|BUILD_|RUN_|FETCH_)?DEPENDS/) {
>  		&checkearlier($file, $tmp, @varnames);
>  
> +		my %seen_depends;
> +
>  		if (!defined $ENV{'PORTSDIR'}) {
>  			$ENV{'PORTSDIR'} = $portsdir;
>  		}
>  		foreach my $i (grep(/^[A-Z_]*DEPENDS[?+]?=/, split(/\n/, $tmp))) {
>  			$i =~ s/^([A-Z_]*DEPENDS)[?+]?=[ \t]*//;
>  			$j = $1;
> +			$seen_depends{$j}++;
> +			if ($j ne 'DEPENDS' &&
> +				$i =~ /^\${([A-Z_]+DEPENDS)}\s*$/ &&
> +				$seen_depends{$1} &&
> +				$j ne $1)
> +			{
> +				print "OK: $j refers to $1, skipping checks.\n"
> +					if ($verbose);
> +				next;
> +			}
>  			print "OK: checking ports listed in $j.\n"
>  				if ($verbose);
>  			foreach my $k (split(/\s+/, $i)) {

-- 
PGP public key: http://www.cirx.org/~clive/clive.asc
     Key fingerprint = 7F9D 57A8 55C7 AA18 49B5  3820 570B 27F6 F8D2 B472
Comment 3 Michael Haro freebsd_committer freebsd_triage 2001-05-08 01:57:31 UTC
On Tue, May 08, 2001 at 01:53:24AM +0300, Maxim Sobolev wrote:
> 
> In fact portlint should use "make -V FOO" to get value of the
> variable FOO instead of direct Makefile parsing. Your patch is merely
> a hack - a right solution should be used instead.

This is one of the things that is being changed in portlint3.

Michael
Comment 4 Michael Haro freebsd_committer freebsd_triage 2001-08-28 20:03:38 UTC
State Changed
From-To: open->analyzed

This has been corrected in portlint3 (development), which I expect to have 
in the ports tree shortly. 

Thanks for pointing this out!
Comment 5 Anton Berezin freebsd_committer freebsd_triage 2001-12-07 12:24:15 UTC
On Tue, Aug 28, 2001 at 12:04:34PM -0700, mharo@FreeBSD.org wrote:
> Synopsis: Teach portlint to recognize RUN_DEPENDS=${BUILD_DEPENDS} and the like
> 
> State-Changed-From-To: open->analyzed
> State-Changed-By: mharo
> State-Changed-When: Tue Aug 28 12:03:38 PDT 2001
> State-Changed-Why: 
> This has been corrected in portlint3 (development), which I expect to have
> in the ports tree shortly.

Would not it be nice to commit some kind of a fix before portlint3 hits
the tree?  It's been a while since this PR was submitted, and the number
of such ports is growing...

=Anton.
-- 
| Anton Berezin                |      FreeBSD: The power to serve |
| catpipe Systems ApS   _ _ |_ |           http://www.FreeBSD.org |
| tobez@catpipe.net    (_(_||  |                tobez@FreeBSD.org | 
| +45 7021 0050                |         Private: tobez@tobez.org |
Comment 6 Michael Haro freebsd_committer freebsd_triage 2002-09-14 19:56:45 UTC
State Changed
From-To: analyzed->closed

patch committed