Warn about unknown libraries. Bump version to 1.19.

This commit is contained in:
wiz 2013-03-06 21:26:45 +00:00
parent d032b0cc2f
commit 9102af90b3
3 changed files with 75 additions and 12 deletions

View file

@ -1,6 +1,6 @@
# $NetBSD: Makefile,v 1.25 2013/01/01 01:42:08 jnemeth Exp $
# $NetBSD: Makefile,v 1.26 2013/03/06 21:26:45 wiz Exp $
DISTNAME= mdoclint-1.18
DISTNAME= mdoclint-1.19
CATEGORIES= textproc
MASTER_SITES= # none
DISTFILES= # none

View file

@ -1,9 +1,9 @@
#!@PERL5@
#
# $OpenBSD: mdoclint,v 1.14 2009/04/13 12:40:05 espie Exp $
# $NetBSD: mdoclint,v 1.21 2013/01/01 01:42:08 jnemeth Exp $
# $NetBSD: mdoclint,v 1.22 2013/03/06 21:26:45 wiz Exp $
#
# Copyright (c) 2001-2012 Thomas Klausner
# Copyright (c) 2001-2013 Thomas Klausner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@ -42,7 +42,8 @@ use constant {
};
use vars qw(
$opt_A $opt_a $opt_D $opt_d $opt_e $opt_F $opt_f $opt_H $opt_h $opt_m
$opt_A $opt_a $opt_D $opt_d $opt_e $opt_F $opt_f $opt_H $opt_h $opt_l
$opt_m
$opt_n $opt_O $opt_o $opt_P $opt_p $opt_r $opt_S $opt_s $opt_v $opt_w
$opt_X $opt_x
);
@ -50,7 +51,7 @@ use vars qw(
my $arch=`uname -m`;
chomp($arch);
my $options="AaDdeFfHhmnOoPprSsvwXx";
my $options="AaDdeFfHhlmnOoPprSsvwXx";
sub usage
{
@ -68,6 +69,7 @@ usage: mdoclint [-$options] file ...
-f warn about possible incorrect .Fn syntax
-H warn about characters that produce problems in HTML output
-h display this help text
-l warn about unknown libraries
-m warn about man pages that are not in mdoc(7) format
-n warn about .Nd's ending in '.'
-O warn about unsorted .It arguments
@ -93,6 +95,59 @@ my %short = (
"Open" => ".Ox"
);
my %libraries = (
"libarchive" => 1,
"libarm" => 1,
"libarm32" => 1,
"libbluetooth" => 1,
"libc" => 1,
"libcdk" => 1,
"libcompat" => 1,
"libcrypt" => 1,
"libcurses" => 1,
"libdm" => 1,
"libedit" => 1,
"libelf" => 1,
"libevent" => 1,
"libexecinfo" => 1,
"libfetch" => 1,
"libform" => 1,
"libi386" => 1,
"libintl" => 1,
"libipsec" => 1,
"libiscsi" => 1,
"libisns" => 1,
"libkvm" => 1,
"libm" => 1,
"libm68k" => 1,
"libmagic" => 1,
"libmenu" => 1,
"libnetpgp" => 1,
"libossaudio" => 1,
"libpam" => 1,
"libpcap" => 1,
"libpci" => 1,
"libperfuse" => 1,
"libpmc" => 1,
"libposix" => 1,
"libppath" => 1,
"libprop" => 1,
"libpthread" => 1,
"libpuffs" => 1,
"libquota" => 1,
"librefuse" => 1,
"libresolv" => 1,
"librt" => 1,
"libsaslc" => 1,
"libssp" => 1,
"libtermcap" => 1,
"libterminfo" => 1,
"libusbhid" => 1,
"libutil" => 1,
"libx86_64" => 1,
"libz" => 1
);
# constants to build
my %sections;
my $arches_re;
@ -206,13 +261,14 @@ sub handle_options
# default to all warnings if no flag is set
unless ($opt_A or $opt_a or $opt_D or $opt_d or $opt_e
or $opt_f or $opt_H or $opt_m or $opt_n or $opt_O
or $opt_f or $opt_H or $opt_l
or $opt_m or $opt_n or $opt_O
or $opt_o or $opt_P or $opt_p or $opt_r
or $opt_S or $opt_s or $opt_X or $opt_x) {
$opt_A = $opt_a = $opt_D = $opt_d = $opt_f = $opt_m =
$opt_n = $opt_O = $opt_o = $opt_P = $opt_p = $opt_r = $opt_S =
$opt_s = $opt_X = $opt_x = 1;
$opt_e = 1 if NETBSD;
$opt_e = $opt_l = 1 if NETBSD;
}
}
@ -461,6 +517,11 @@ sub process_line
$s->warning("`.Bx $1' found -- use $short{$1} instead")
if $opt_X;
}
if (/^\.Lb\s+(\S+)/o) {
if (not $libraries{$1}) {
$s->warning("Unknown library `$1' used as Lb argument") if $opt_l;
}
}
if (/^\.Os\s+(.+)/o) {
$s->warning(".Os used with argument `$1'") if $opt_o;
}

View file

@ -1,7 +1,7 @@
.\" $OpenBSD: mdoclint.1,v 1.7 2009/04/13 19:06:38 jmc Exp $
.\" $NetBSD: mdoclint.1,v 1.6 2012/02/22 15:31:35 wiz Exp $
.\" $NetBSD: mdoclint.1,v 1.7 2013/03/06 21:26:45 wiz Exp $
.\"
.\" Copyright (c) 2001-2011 Thomas Klausner
.\" Copyright (c) 2001-2013 Thomas Klausner
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@ -25,7 +25,7 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd September 26, 2011
.Dd March 6, 2013
.Dt MDOCLINT 1
.Os
.Sh NAME
@ -33,7 +33,7 @@
.Nd man page verifier
.Sh SYNOPSIS
.Nm
.Op Fl AaDdeFfHhmnOoPprSsvwXx
.Op Fl AaDdeFfHhlmnOoPprSsvwXx
.Ar
.Sh DESCRIPTION
.Nm
@ -90,6 +90,8 @@ This option is off by default,
as these characters no longer pose any problems.
.It Fl h
Display usage.
.It Fl l
Warn about unknown libraries used as arguments to Lb.
.It Fl m
Warn if man page is not in
.Xr mdoc 7