Browse Source

Avoid a bogus error on ports that append to DISTFILES.

PR:	268681
Joe Clarke 5 months ago
parent
commit
724a01f6ab
1 changed files with 5 additions and 4 deletions
  1. 5 4
      portlint.pl

+ 5 - 4
portlint.pl

@@ -1348,7 +1348,7 @@ sub checkmakefile {
 	my $tmp;
 	my $bogusdistfiles = 0;
 	my @varnames = ();
-	my($portname, $portversion, $distfiles, $distversionprefix, $distversion, $distversionsuffix, $distname, $extractsufx) = ('') x 8;
+	my($portname, $portversion, $distfiles, $all_distfiles, $distversionprefix, $distversion, $distversionsuffix, $distname, $extractsufx) = ('') x 9;
 	my $masterport = 0;
 	my $slaveport = 0;
 	my $use_gnome_hack = 0;
@@ -2891,7 +2891,8 @@ DIST_SUBDIR EXTRACT_ONLY
 	}
 
 	# check DISTFILES and related items.
-	$distfiles = $1 if ($tmp =~ /\nDISTFILES[+?]?=[ \t]*([^\n]+)\n/);
+	$distfiles = $1 if ($tmp =~ /\nDISTFILES[?]?=[ \t]*([^\n]+)\n/);
+	$all_distfiles = $1 if ($tmp =~ /\nDISTFILES[+?]?=[ \t]*([^\n]+)\n/);
 	$portname = $makevar{PORTNAME};
 	$portversion = $makevar{PORTVERSION};
 	$distversionprefix = $makevar{DISTVERSIONPREFIX};
@@ -2903,7 +2904,7 @@ DIST_SUBDIR EXTRACT_ONLY
 	# check bogus EXTRACT_SUFX.
 	if ($extractsufx ne '') {
 		print "OK: seen EXTRACT_SUFX, checking value.\n" if ($verbose);
-		if ($distfiles ne '') {
+		if ($all_distfiles ne '') {
 			&perror("WARN", $file, -1, "no need to define EXTRACT_SUFX if ".
 				"DISTFILES is defined.");
 		}
@@ -3107,7 +3108,7 @@ DIST_SUBDIR EXTRACT_ONLY
 			$bogusdistfiles++;
 			print "OK: seen DISTFILES with single item, checking value.\n"
 				if ($verbose);
-			&perror("WARN", $file, -1, "use of DISTFILES with single file ".
+			&perror("WARN", $file, -1, "use of DISTFILES with single file is ".
 				"discouraged. distribution filename should be set by ".
 				"DISTNAME and EXTRACT_SUFX.");
 			if ($distfiles eq (($distname ne '') ? $distname : "$portname-$portversion") . $extractsufx) {