summaryrefslogtreecommitdiff
path: root/textproc/mdoclint/files
diff options
context:
space:
mode:
authorwiz <wiz>2015-12-11 14:24:35 +0000
committerwiz <wiz>2015-12-11 14:24:35 +0000
commitfc5fecd08f4cd978319cd6633e67f5b28e64a319 (patch)
tree3d66db8d76b2c248db615a6656cab221235ae7f6 /textproc/mdoclint/files
parent8a49abfc79e6375efcc4584b1b2e4040464a2547 (diff)
downloadpkgsrc-fc5fecd08f4cd978319cd6633e67f5b28e64a319.tar.gz
OpenBSD will remove man page symlinks and let man(1) find them via
a database. Adapt code for that case using a patch from Ingo Schwarze. Bump version.
Diffstat (limited to 'textproc/mdoclint/files')
-rwxr-xr-xtextproc/mdoclint/files/mdoclint20
1 files changed, 14 insertions, 6 deletions
diff --git a/textproc/mdoclint/files/mdoclint b/textproc/mdoclint/files/mdoclint
index 866ebd64672..9dcca8d2612 100755
--- a/textproc/mdoclint/files/mdoclint
+++ b/textproc/mdoclint/files/mdoclint
@@ -1,7 +1,7 @@
#!@PERL5@
#
# $OpenBSD: mdoclint,v 1.42 2014/03/18 22:36:30 miod Exp $
-# $NetBSD: mdoclint,v 1.53 2015/12/02 17:31:24 wiz Exp $
+# $NetBSD: mdoclint,v 1.54 2015/12/11 14:24:35 wiz Exp $
#
# Copyright (c) 2001-2013 Thomas Klausner
# All rights reserved.
@@ -273,11 +273,19 @@ sub verify_xref
$self->warning("Xref to itself (use .Nm instead)") if $opt_x;
}
# try to find corresponding man page
- for my $dir ("/usr/share/man",
- OPENBSD ? "/usr/X11R6/man" : "/usr/X11R7/man") {
- for my $a ("", $arch) {
- for my $page ("man$section/$a/$page.$section") {
- return 1 if -f "$dir/$page";
+ if (OPENBSD) {
+ open my $saveout, '>&', STDOUT;
+ open STDOUT, '>', '/dev/null';
+ my $irc = system 'man', '-M', '/usr/share/man:/usr/X11R6/man',
+ '-s', $section, '-f', $page;
+ open STDOUT, '>&', $saveout;
+ return 1 unless $irc;
+ } else {
+ for my $dir ('/usr/share/man', '/usr/X11R7/man') {
+ for my $a ('', $arch) {
+ for my $page ("man$section/$a/$page.$section") {
+ return 1 if -f "$dir/$page";
+ }
}
}
}