Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2001 17:25:33 +0200 (CEST)
From:      tobez@tobez.org
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        mharo@freebsd.org, clive@CirX.ORG
Subject:   ports/27182: Teach portlint to recognize RUN_DEPENDS=${BUILD_DEPENDS} and the like
Message-ID:  <200105071525.f47FPX166024@creat.td.rh.dk>

next in thread | raw e-mail | index | archive | help

>Number:         27182
>Category:       ports
>Synopsis:       Teach portlint to recognize RUN_DEPENDS=${BUILD_DEPENDS} and the like
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 07 08:30:05 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Anton Berezin
>Release:        FreeBSD 4.3-STABLE i386
>Organization:
>Environment:
>Description:
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
>Fix:

--- 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)) {
--- Makefile.orig	Mon May  7 17:14:18 2001
+++ Makefile	Mon May  7 17:14:39 2001
@@ -8,7 +8,7 @@
 #
 
 PORTNAME=	portlint
-PORTVERSION=	2.3.2
+PORTVERSION=	2.3.3
 CATEGORIES=	devel
 MASTER_SITES=	# none
 DISTFILES=	# none
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200105071525.f47FPX166024>