Procházet zdrojové kódy

Thoroughly check for an OPTION description.

PR:		244480
jclarke před 4 roky
rodič
revize
9d88f82024
1 změnil soubory, kde provedl 8 přidání a 4 odebrání
  1. 8 4
      portlint.pl

+ 8 - 4
portlint.pl

@@ -127,7 +127,7 @@ $portdir = $ARGV[0] ? $ARGV[0] : '.';
 if (defined $ENV{'PORTSDIR'}) {
 	$portsdir = $ENV{PORTSDIR};
 } else {
-	my $mconf_portsdir = get_makeconf_var('PORTSDIR');
+	my $mconf_portsdir = &get_makeconf_var('PORTSDIR');
 	if ($mconf_portsdir ne '') {
 		$portsdir = $mconf_portsdir;
 	}
@@ -1777,12 +1777,16 @@ sub checkmakefile {
 		}
 	}
 
+	my %seen_opts = ();
 	foreach my $i ((@opt, @aopt, @aropt)) {
 		# skip global options
 		next if ($i eq 'DOCS' or $i eq 'NLS' or $i eq 'EXAMPLES' or $i eq 'IPV6' or $i eq 'X11' or $i eq 'DEBUG');
-		my $odescr = &get_makevar("${i}_DESC");
-		if (!$odescr) {
-			&perror("FATAL", $file, -1, "OPTION $i does not have a description (${i}_DESC).");
+		if (!$seen_opts{$i}) {
+			$seen_opts{$i}++;
+			my $odescr = &get_makevar("${i}_DESC");
+			if ($odescr eq "" && $whole !~ /^${i}_DESC.?=/m) {
+				&perror("FATAL", $file, -1, "OPTION $i does not have a description (${i}_DESC).");
+			}
 		}
 		if (!grep(/^$i$/, (@mopt, @popt))) {
 			if ($whole !~ /\n${i}_($m)(_\w+)?(.)?=[^\n]+/ and $whole !~ /\n[-\w]+-${i}-(on|off):\n/) {