summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint/files
diff options
context:
space:
mode:
authorrillig <rillig>2005-05-31 20:44:02 +0000
committerrillig <rillig>2005-05-31 20:44:02 +0000
commit9a3080132d68a3e6de9e1ae26636edfdc067edab (patch)
treed66982c0df8b1b1097bf0ab3ca20c36003defb8e /pkgtools/pkglint/files
parente7bddf454c554d61c08f2b9b62dfad9d6540ec59 (diff)
downloadpkgsrc-9a3080132d68a3e6de9e1ae26636edfdc067edab.tar.gz
Removed the -N command line option, which had been deprecated before.
Also removed -Cnewpkg. Instead, the warnings for new packages are only emitted if the files have not yet been committed to CVS.
Diffstat (limited to 'pkgtools/pkglint/files')
-rw-r--r--pkgtools/pkglint/files/pkglint.08
-rw-r--r--pkgtools/pkglint/files/pkglint.113
-rw-r--r--pkgtools/pkglint/files/pkglint.pl34
3 files changed, 24 insertions, 31 deletions
diff --git a/pkgtools/pkglint/files/pkglint.0 b/pkgtools/pkglint/files/pkglint.0
index 47258db2882..fb4bc46b93c 100644
--- a/pkgtools/pkglint/files/pkglint.0
+++ b/pkgtools/pkglint/files/pkglint.0
@@ -32,11 +32,6 @@ DDEESSCCRRIIPPTTIIOONN
files that are slurped in via .include directives. This flag
is mainly for debugging.
- --NN New package flag. Adds several checks specific to newly sub-
- mitted packages. If you are willing to submit the directory
- to be checked as a new package, use this option. This option
- is deprecated. Use --CC_n_e_w_p_k_g instead.
-
--qq|----qquuiieett Don't print the errors and warnings summary before terminat-
ing.
@@ -65,9 +60,6 @@ DDEESSCCRRIIPPTTIIOONN
[no-]extra Check remaining files in the package directory.
- [no-]newpkg
- Enable special checks for uncommitted packages.
-
[no-]patches
Check the pkgsrc specific patch files.
diff --git a/pkgtools/pkglint/files/pkglint.1 b/pkgtools/pkglint/files/pkglint.1
index 657e0d66b5d..fdb36b27524 100644
--- a/pkgtools/pkglint/files/pkglint.1
+++ b/pkgtools/pkglint/files/pkglint.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: pkglint.1,v 1.12 2005/05/22 22:53:13 rillig Exp $
+.\" $NetBSD: pkglint.1,v 1.13 2005/05/31 20:44:02 rillig Exp $
.\" From FreeBSD: portlint.1,v 1.8 1997/11/25 14:53:14 itojun Exp
.\"
.\" Copyright (c) 1997 by Jun-ichiro Itoh <itojun@itojun.org>.
@@ -52,15 +52,6 @@ Show the summary of command line options, then exit.
Show the Makefile that is constructed by including all the files that
are slurped in via .include directives.
This flag is mainly for debugging.
-.It Fl N
-New package flag.
-Adds several checks specific to newly submitted packages.
-If you are willing to submit the directory to be checked as a new package,
-use this option.
-This option is deprecated.
-Use
-.Fl C Ns Ar newpkg
-instead.
.It Fl q Ns | Ns Fl -quiet
Don't print the errors and warnings summary before terminating.
.It Fl v Ns | Ns Fl -verbose
@@ -87,8 +78,6 @@ Check PLIST files.
Check the distinfo file.
.It [no-]extra
Check remaining files in the package directory.
-.It [no-]newpkg
-Enable special checks for uncommitted packages.
.It [no-]patches
Check the pkgsrc specific patch files.
.El
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 560a2b11fae..4dbc26ec4a6 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -11,7 +11,7 @@
# Freely redistributable. Absolutely no warranty.
#
# From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.188 2005/05/26 07:07:00 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.189 2005/05/31 20:44:02 rillig Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by:
@@ -37,7 +37,7 @@ BEGIN {
use Exporter;
use vars qw(@ISA @EXPORT_OK);
@ISA = qw(Exporter);
- @EXPORT_OK = qw(false true print_table);
+ @EXPORT_OK = qw(false print_table true);
}
use constant false => 0;
@@ -289,7 +289,6 @@ my (%options) = (
"-p" => "warn about use of \$(VAR) instead of \${VAR}",
"-q" => "don't print a summary line when finishing",
"-I" => "dump the Makefile after parsing",
- "-N" => "assume a new (still uncommitted) package",
"-B#" => "allow # contiguous blank lines in Makefiles",
"-C{check,...}" => "enable or disable specific checks",
"-W{warn,...}" => "enable or disable specific warnings",
@@ -304,7 +303,6 @@ my $opt_check_bl3 = true;
my $opt_check_MESSAGE = true;
my $opt_check_patches = true;
my $opt_check_PLIST = true;
-my $opt_check_newpkg = false;
my (%checks) = (
"distinfo" => [\$opt_check_distinfo, "check distinfo file"],
"bl3" => [\$opt_check_bl3, "check buildlink3 files"],
@@ -312,17 +310,16 @@ my (%checks) = (
"MESSAGE" => [\$opt_check_MESSAGE, "check MESSAGE files"],
"patches" => [\$opt_check_patches, "check patches"],
"PLIST" => [\$opt_check_PLIST, "check PLIST files"],
- "newpkg" => [\$opt_check_newpkg, "special checks for uncommitted packages"],
);
my $opt_warn_absname = true;
my $opt_warn_directcmd = true;
my $opt_warn_exec = true;
-my $opt_warn_vague = true;
my $opt_warn_order = true;
my $opt_warn_paren = true;
my $opt_warn_sort = true;
my $opt_warn_types = true;
+my $opt_warn_vague = true;
my $opt_warn_workdir = true;
my (%warnings) = (
"absname" => [\$opt_warn_absname, "warn about use of absolute file names"],
@@ -481,7 +478,6 @@ sub parse_command_line() {
parse_multioption($val, \%checks);
},
"help|h" => sub { help(*STDOUT, 0, 1); },
- "newpackage|N" => \$opt_check_newpkg,
"verbose|v" => sub { PkgLint::Logging::set_verbose(true); },
"version|V" => sub { print("$conf_distver\n"); exit(0); },
"contblank|B=i" => \$opt_contblank,
@@ -694,6 +690,23 @@ sub check_package() {
return true;
} # check_package
+sub is_committed($) {
+ my ($fname) = @_;
+ my ($basename, $entries);
+
+ $basename = basename($fname);
+ $entries = load_file(dirname($fname) . "/CVS/Entries");
+ if (!$entries) {
+ return false;
+ }
+ foreach my $entry (@{$entries}) {
+ if ($entry->text =~ qr"^/\Q${basename}\E/") {
+ return true;
+ }
+ }
+ return false;
+}
+
#
# Subroutines common to all checking routines
#
@@ -987,7 +1000,7 @@ sub checkfile_buildlink3_mk($) {
sub checkperms($) {
my ($file) = @_;
- if ($opt_warn_exec && -f $file && -x $file) {
+ if ($opt_warn_exec && -f $file && -x $file && !is_committed($file)) {
log_warning($file, NO_LINE_NUMBER, "Should not be executable.");
}
return true;
@@ -1504,9 +1517,8 @@ sub checkfile_Makefile($) {
$tmp = $sections[$idx++];
if ($tmp =~ /#(\s+)\$$conf_rcsidstr([^\$]*)\$/) {
if ($2 ne '') {
- if ($opt_check_newpkg) {
- $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "For a new package, make \$$conf_rcsidstr\$ tag in comment ".
- "section empty, to make CVS happy.");
+ if (!is_committed($fname)) {
+ $opt_warn_vague && log_warning(NO_FILE, NO_LINE_NUMBER, "\"\$$conf_rcsidstr\$\" expected.");
}
}
}