From 75562fa202d4938247adad25f7b2df015067c656 Mon Sep 17 00:00:00 2001 From: rillig Date: Mon, 30 Jan 2006 01:26:04 +0000 Subject: - Added a hack to be able to parse nested make(1) variables like ${TOOL.${t}}. They just extend up to, but not including the next space or quote character. - log_debug() is used for printing debugging info, not log_error(). - Even if NO_CHECKSUM is set, distinfo files may exist if the package has patches. Noted by salo. --- pkgtools/pkglint/files/pkglint.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 7edf243374e..aea9b0545c7 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.496 2006/01/29 01:29:38 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.497 2006/01/30 01:26:04 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -1236,6 +1236,7 @@ my $regex_shellword = qr"\s*( | \$\$\{[0-9A-Z_a-z]+\} # shell variable in braces | \$\$\( # POSIX-style backticks replacement | [^\(\)'\"\\\s;&\|<>\#\`\$] # non-special character + | \$\{[^\s\"'`]+ # HACK: nested make(1) variables )+ | ;;? | &&? | \|\|? | \( | \) | <>? | \#.*)"sx; my $regex_varname = qr"[-*+.0-9A-Z_a-z{}\[]+"; @@ -2229,7 +2230,7 @@ sub checkline_mk_shellword($$$) { $state = SWST_PLAIN; while ($rest ne "") { - $opt_debug and $line->log_error("[checkline_mk_shellword] " . statename->[$state] . " ${rest}"); + $opt_debug and $line->log_debug("[checkline_mk_shellword] " . statename->[$state] . " ${rest}"); # make variables have the same syntax, no matter in which # state we are currently. @@ -3706,7 +3707,7 @@ sub checkfile_package_Makefile($$$) { log_warning($fname, NO_LINE_NUMBER, "Neither PLIST nor PLIST.common exist, and PLIST_SRC and NO_PKG_REGISTER are unset. Are you sure PLIST handling is ok?"); } - if (exists($makevar->{"NO_CHECKSUM"})) { + if (exists($makevar->{"NO_CHECKSUM"}) && is_emptydir("${current_dir}/${patchdir}")) { if (-f "${current_dir}/${distinfo_file}") { log_warning("${current_dir}/${distinfo_file}", NO_LINE_NUMBER, "This file should not exist if NO_CHECKSUM is set."); } -- cgit v1.2.3