pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Removed the -N command line opt...
details: https://anonhg.NetBSD.org/pkgsrc/rev/e266e09085ed
branches: trunk
changeset: 494903:e266e09085ed
user: rillig <rillig%pkgsrc.org@localhost>
date: Tue May 31 20:44:02 2005 +0000
description:
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:
pkgtools/pkglint/files/pkglint.0 | 8 --------
pkgtools/pkglint/files/pkglint.1 | 13 +------------
pkgtools/pkglint/files/pkglint.pl | 34 +++++++++++++++++++++++-----------
3 files changed, 24 insertions(+), 31 deletions(-)
diffs (168 lines):
diff -r c421f86494ef -r e266e09085ed pkgtools/pkglint/files/pkglint.0
--- a/pkgtools/pkglint/files/pkglint.0 Tue May 31 20:01:00 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.0 Tue May 31 20:44:02 2005 +0000
@@ -32,11 +32,6 @@
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 @@
[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 -r c421f86494ef -r e266e09085ed pkgtools/pkglint/files/pkglint.1
--- a/pkgtools/pkglint/files/pkglint.1 Tue May 31 20:01:00 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.1 Tue May 31 20:44:02 2005 +0000
@@ -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@localhost>.
@@ -52,15 +52,6 @@
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 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 -r c421f86494ef -r e266e09085ed pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue May 31 20:01:00 2005 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue May 31 20:44:02 2005 +0000
@@ -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 @@
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 @@
"-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_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 @@
"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 @@
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 @@
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 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 @@
$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.");
}
}
}
Home |
Main Index |
Thread Index |
Old Index