Changeset View
Changeset View
Standalone View
Standalone View
head/ports-mgmt/portlint/src/portlint.pl
Show First 20 Lines • Show All 1,784 Lines • ▼ Show 20 Lines | sub checkmakefile { | ||||
if ($whole =~ /\n([\w\d]+)_CMAKE_ARGS/) { | if ($whole =~ /\n([\w\d]+)_CMAKE_ARGS/) { | ||||
my $lineno = &linenumber($`); | my $lineno = &linenumber($`); | ||||
&perror("WARN", $file, $lineno, "Use $1_CMAKE_ON or $1_CMAKE_OFF instead ". | &perror("WARN", $file, $lineno, "Use $1_CMAKE_ON or $1_CMAKE_OFF instead ". | ||||
"of $1_CMAKE_ARGS. The former macros will automatically update ". | "of $1_CMAKE_ARGS. The former macros will automatically update ". | ||||
"CMAKE_ARGS."); | "CMAKE_ARGS."); | ||||
} | } | ||||
# | # | ||||
# while file: check that CMAKE_BOOL just has words | # whole file: check that CMAKE_BOOL just has words | ||||
# | # | ||||
print "OK: checking that *_CMAKE_BOOL only contains words.\n" if ($verbose); | print "OK: checking that *_CMAKE_BOOL only contains words.\n" if ($verbose); | ||||
if ($whole =~ /\n([\w\d]+)_CMAKE_BOOL[?+:]?=([^\n]+)\n/) { | if ($whole =~ /\n([\w\d]+)_CMAKE_BOOL[?+:]?=([^\n]+)\n/) { | ||||
my $lineno = &linenumber($`); | my $lineno = &linenumber($`); | ||||
my $o = $1; | my $o = $1; | ||||
if ($2 =~ /-D/) { | if ($2 =~ /-D/) { | ||||
&perror("FATAL", $file, $lineno, "Only bare words can be used for ". | &perror("FATAL", $file, $lineno, "Only bare words can be used for ". | ||||
"${o}_CMAKE_BOOL. The -D flag will be added automatically."); | "${o}_CMAKE_BOOL. The -D flag will be added automatically."); | ||||
} | |||||
} | |||||
print "OK: checking that *CMAKE* co-occurs with *USES+=cmake.\n" if ($verbose); | |||||
while ($whole =~ /\n([\w\d]+_)?CMAKE_(ARGS|BOOL|BOOL_ON|BOOL_OFF|OFF|ON)\b/g) { | |||||
my $lineno = &linenumber($`); | |||||
my $o = $1; | |||||
my $found_cmake = 0; | |||||
unless ($makevar{USES} =~ /\b(cmake\b|cmake:)/) { | |||||
$o = "" unless ($o); | |||||
&perror("FATAL", $file, $lineno, "${o}CMAKE_$2 is set without USES+=cmake"); | |||||
} | } | ||||
} | } | ||||
# | # | ||||
# whole file: NO_CHECKSUM | # whole file: NO_CHECKSUM | ||||
# | # | ||||
# XXX Don't compress newlines since it messes up line number calculation. | # XXX Don't compress newlines since it messes up line number calculation. | ||||
#$whole =~ s/\n#[^\n]*/\n/g; | #$whole =~ s/\n#[^\n]*/\n/g; | ||||
#$whole =~ s/\n\n+/\n/g; | #$whole =~ s/\n\n+/\n/g; | ||||
print "OK: checking NO_CHECKSUM.\n" if ($verbose); | print "OK: checking NO_CHECKSUM.\n" if ($verbose); | ||||
if ($whole =~ /\nNO_CHECKSUM/) { | if ($whole =~ /\nNO_CHECKSUM/) { | ||||
▲ Show 20 Lines • Show All 2,033 Lines • Show Last 20 Lines |