diff options
author | rillig <rillig> | 2006-03-12 16:55:51 +0000 |
---|---|---|
committer | rillig <rillig> | 2006-03-12 16:55:51 +0000 |
commit | ce64d1da0eb26c1eb79fb70eb5513ca481981cc9 (patch) | |
tree | c1a161cccb4b4d95ed98c561a9c24a42d79c7733 /pkgtools | |
parent | 269b204f0d1f984ca1fee188de428e17f221f8dd (diff) | |
download | pkgsrc-ce64d1da0eb26c1eb79fb70eb5513ca481981cc9.tar.gz |
- Added a bunch of variables to makevars.map.
- Removed the specialized spell checker for NO_*_ON_*, since the generic
one catches these quite well.
- SITES_* is deprecated in favor of SITES.*.
- Don't warn if variable alignment is done with exactly one space
character, since this is common when one line from a group has an
overly lengthy variable.
- Added support for checking whether the number of leading lines of context
matches the number of trailing lines of context in patch files of the
unified diff format. The MacOS X patch utility cannot handle these. As
there are quite a number of false positives here (especially when the
hunk is applied at the end of a file), this warning only shows up in
--debug mode.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/makevars.map | 14 | ||||
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 40 |
2 files changed, 42 insertions, 12 deletions
diff --git a/pkgtools/pkglint/files/makevars.map b/pkgtools/pkglint/files/makevars.map index 840478c1d8e..d1236bf48ee 100644 --- a/pkgtools/pkglint/files/makevars.map +++ b/pkgtools/pkglint/files/makevars.map @@ -1,4 +1,4 @@ -# $NetBSD: makevars.map,v 1.75 2006/03/12 13:34:53 rillig Exp $ +# $NetBSD: makevars.map,v 1.76 2006/03/12 16:55:51 rillig Exp $ # # This file contains the guessed type of some variables, according to @@ -131,8 +131,11 @@ DJB_BUILD_TARGETS List of Identifier DJB_CONFIG_CMDS List of ShellWord # ^^ ShellCommand, terminated by a semicolon DJB_CONFIG_HOME Filename -DJB_RESTRICTED YesNo +DJB_CONFIG_HOME Filename +DJB_BUILD_TARGETS List of Identifier +DJB_INSTALL_TARGETS List of Identifier DJB_MAKE_TARGETS List of Identifier +DJB_RESTRICTED YesNo DJB_SLASHPACKAGE YesNo DLOPEN_REQUIRE_PTHREADS YesNo DL_AUTO_VARS Yes @@ -185,6 +188,7 @@ GNU_CONFIGURE_PREFIX Pathname HAS_CONFIGURE Yes HOMEPAGE URL INCOMPAT_CURSES List of PlatformTriple +INCOMPAT_ICONV List of PlatformTriple INFO_DIR Pathname # ^^ relative to PREFIX INFO_FILES List of Pathmask @@ -294,9 +298,12 @@ PAM_DEFAULT Userdefined PAM_TYPE Readonly PATCHDIR RelativePkgPath PATCHFILES List of Filename +PATCH_ARGS List of ShellWord PATCH_DIST_ARGS List of ShellWord -PATCH_DIST_STRIP List of ShellWord +PATCH_DIST_CAT ShellCommand +PATCH_DIST_STRIP ShellWord PATCH_SITES List of URL +PATCH_STRIP ShellWord PERL5_PACKLIST Perl5Packlist PGSQL_VERSIONS_ACCEPTED List of { 73 74 80 } PGSQL_VERSION_DEFAULT Userdefined @@ -368,6 +375,7 @@ REQD_FILES List+ of Pathname REQD_FILES_MODE { 0644 0640 0600 0400 } RESTRICTED Message SCRIPTS_ENV List+ of ShellWord +SHLIB_HANDLING { YES NO no } SPECIAL_PERMS List of ShellWord SHLIBTOOL_OVERRIDE List+ of Pathmask SITES List of URL diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 51d2cd6208d..388aa8c2424 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -1,5 +1,5 @@ #! @PERL@ -# $NetBSD: pkglint.pl,v 1.548 2006/03/12 13:34:53 rillig Exp $ +# $NetBSD: pkglint.pl,v 1.549 2006/03/12 16:55:51 rillig Exp $ # # pkglint - static analyzer and checker for pkgsrc packages @@ -3537,13 +3537,6 @@ sub checkline_mk_varassign($$$$$) { $line->log_warning("Please use \"# empty\", \"# none\" or \"yes\" instead of \"# defined\"."); } - if ($varname =~ qr"^NO_(.*)_ON_(.*)$") { - my ($what, $where) = ($1, $2); - if (($what ne "SRC" && $what ne "BIN") || ($where ne "FTP" && $where ne "CDROM")) { - $line->log_error("Misspelled variable: Valid names are USE_{BIN,SRC}_ON_{FTP,CDROM}."); - } - } - if ($value =~ qr"\$\{(PKGNAME|PKGVERSION)[:\}]") { my ($pkgvarname) = ($1); if ($varname =~ qr"^PKG_.*_REASON$") { @@ -3559,6 +3552,10 @@ sub checkline_mk_varassign($$$$$) { $line->log_warning("Definition of ${varname} is deprecated. ".get_deprecated_map()->{$varname}); } + if ($varname =~ qr"^SITES_") { + $line->log_warning("SITES_* is deprecated. Please use SITES.* instead."); + } + if ($value =~ qr"^[^=]\@comment") { $line->log_warning("Please don't use \@comment in ${varname}."); $line->explain( @@ -3761,7 +3758,7 @@ sub checklines_mk($) { my ($varname, $op, $value, $comment) = ($1, $2, $3, $4); my $space1 = substr($text, $+[1], $-[2] - $+[1]); my $align = substr($text, $+[2], $-[3] - $+[2]); - if ($align !~ qr"^\t*$") { + if ($align !~ qr"^(\t*|[ ])$") { $opt_warn_space && $line->log_note("Alignment of variable values should be done with tabs, not spaces."); my $prefix = "${varname}${space1}${op}"; my $aligned_len = tablen("${prefix}${align}"); @@ -4260,6 +4257,7 @@ sub checkfile_patch($) { my ($strings); my ($state, $redostate, $nextstate, $dellines, $addlines, $hunks); my ($seen_comment, $current_fname, $patched_files); + my ($leading_context_lines, $trailing_context_lines, $context_scanning_leading); # Abbreviations used: # style: [c] = context diff, [u] = unified diff @@ -4360,6 +4358,22 @@ sub checkfile_patch($) { $line->log_error("Expected ${dellines} more lines to be deleted."); } } else { + if (defined($context_scanning_leading)) { + if ($deldelta != 0 && $adddelta != 0) { + if ($context_scanning_leading) { + $leading_context_lines++; + } else { + $trailing_context_lines++; + } + } else { + if ($context_scanning_leading) { + $context_scanning_leading = false; + } else { + $trailing_context_lines = 0; + } + } + } + if ($deldelta != 0) { $dellines -= $deldelta; } @@ -4368,6 +4382,11 @@ sub checkfile_patch($) { } if (!((defined($dellines) && $dellines > 0) || (defined($addlines) && $addlines > 0))) { + if (defined($context_scanning_leading)) { + if ($leading_context_lines != $trailing_context_lines) { + $opt_debug and $line->log_warning("The hunk that ends here does not have as many leading (${leading_context_lines}) as trailing (${trailing_context_lines}) lines of context."); + } + } $nextstate = $newstate; } } @@ -4485,6 +4504,9 @@ sub checkfile_patch($) { $line->explain("The MacOS X patch utility cannot handle these."); } $hunks++; + $context_scanning_leading = (($m->has(1) && $m->text(1) ne "1") ? true : undef); + $leading_context_lines = 0; + $trailing_context_lines = 0; }], [PST_UL, re_patch_uld, PST_UL, sub() { $check_hunk_line->(1, 0, PST_UH); }], [PST_UL, re_patch_ula, PST_UL, sub() { |