pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files - Added a bunch of variables to...
details: https://anonhg.NetBSD.org/pkgsrc/rev/a8ade45e7bb7
branches: trunk
changeset: 509637:a8ade45e7bb7
user: rillig <rillig%pkgsrc.org@localhost>
date: Sun Mar 12 16:55:51 2006 +0000
description:
- 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:
pkgtools/pkglint/files/makevars.map | 14 ++++++++++--
pkgtools/pkglint/files/pkglint.pl | 40 ++++++++++++++++++++++++++++--------
2 files changed, 42 insertions(+), 12 deletions(-)
diffs (149 lines):
diff -r 43676ea94b2a -r a8ade45e7bb7 pkgtools/pkglint/files/makevars.map
--- a/pkgtools/pkglint/files/makevars.map Sun Mar 12 16:55:37 2006 +0000
+++ b/pkgtools/pkglint/files/makevars.map Sun Mar 12 16:55:51 2006 +0000
@@ -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_CONFIG_CMDS List of ShellWord
# ^^ ShellCommand, terminated by a semicolon
DJB_CONFIG_HOME Filename
+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_MAKE_TARGETS List of Identifier
DJB_SLASHPACKAGE YesNo
DLOPEN_REQUIRE_PTHREADS YesNo
DL_AUTO_VARS Yes
@@ -185,6 +188,7 @@
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_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_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 -r 43676ea94b2a -r a8ade45e7bb7 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Sun Mar 12 16:55:37 2006 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Sun Mar 12 16:55:51 2006 +0000
@@ -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 @@
$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 @@
$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 @@
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 @@
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 @@
$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 @@
}
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 @@
$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() {
Home |
Main Index |
Thread Index |
Old Index