summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2012-07-10 10:27:23 +0000
committerwiz <wiz@pkgsrc.org>2012-07-10 10:27:23 +0000
commit851fa1bab8ba023ab8d86cdd27ea302474ee7da4 (patch)
tree66ac2a2c622dad05cb15ff9467e0031bce8af438 /pkgtools
parentdafeaa64057b42be5fd4fc9f1c5025f7ed394d70 (diff)
downloadpkgsrc-851fa1bab8ba023ab8d86cdd27ea302474ee7da4.tar.gz
Warn about space before colon in dependency line instead of FATALing out.
Addresses part of PR 46570 by David Holland.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 2a3b6ab5632..3f233b675f5 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.838 2012/07/10 09:39:27 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.839 2012/07/10 10:27:23 wiz Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -1337,7 +1337,7 @@ use constant regex_gnu_configure_volatile_vars
=> qr"^(?:.*_)?(?:CFLAGS||CPPFLAGS|CXXFLAGS|FFLAGS|LDFLAGS|LIBS)$";
use constant regex_mk_comment => qr"^ *\s*#(.*)$";
use constant regex_mk_cond => qr"^\.(\s*)(if|ifdef|ifndef|else|elif|endif|for|endfor|undef)(?:\s+([^\s#][^#]*?))?\s*(?:#.*)?$";
-use constant regex_mk_dependency=> qr"^([^\s:]+(?:\s*[^\s:]+)*):\s*([^#]*?)(?:\s*#.*)?$";
+use constant regex_mk_dependency=> qr"^([^\s:]+(?:\s*[^\s:]+)*)(\s*):\s*([^#]*?)(?:\s*#.*)?$";
use constant regex_mk_include => qr"^\.\s*(s?include)\s+\"([^\"]+)\"\s*(?:#.*)?$";
use constant regex_mk_sysinclude=> qr"^\.\s*s?include\s+<([^>]+)>\s*(?:#.*)?$";
use constant regex_mk_shellvaruse => qr"(?:^|[^\$])\$\$\{?(\w+)\}?"; # XXX: not perfect
@@ -3227,11 +3227,12 @@ sub parseline_mk($) {
defined($comment) and $line->set("comment", $comment);
} elsif ($text =~ regex_mk_dependency) {
- my ($targets, $sources, $comment) = ($1, $2, $3);
+ my ($targets, $whitespace, $sources, $comment) = ($1, $2, $3, $4);
$line->set("is_dependency", true);
$line->set("targets", $targets);
$line->set("sources", $sources);
+ $line->log_warning("Space before colon in dependency line: " . $line->to_string()) if ($whitespace);
defined($comment) and $line->set("comment", $comment);
} elsif ($text =~ regex_rcs_conflict) {
@@ -6292,7 +6293,7 @@ sub checklines_mk($) {
}
} elsif ($text =~ regex_mk_dependency) {
- my ($targets, $dependencies) = ($1, $2);
+ my ($targets, $whitespace, $dependencies, $comment) = ($1, $2, $3, $4);
$opt_debug_misc and $line->log_debug("targets=${targets}, dependencies=${dependencies}");
$mkctx_target = $targets;