Bugfix: nested *?+ in regexp at /usr/bin/makewhatis line 286
Submitted by: invalid opcode <coredump@nervosa.com> makewhatis.local - start makewhatis(1) only for file systems physically mounted on the system Running makewhatis from /etc/weekly for rw nfs-mounted /usr may kill your NFS server -- all clients start makewhatis at the same time! So use this wrapper instead calling makewhatis directly. Pointed out by: Bruce
This commit is contained in:
parent
d7b71c676e
commit
7d732d1e4f
@ -1,7 +1,15 @@
|
||||
MAN1= makewhatis.1
|
||||
# MAN8= makewhatis.local.8
|
||||
|
||||
libexecdir=/usr/libexec
|
||||
LINKS=${libexecdir}/makewhatis.local ${libexecdir}/catman.local
|
||||
|
||||
beforeinstall:
|
||||
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
||||
${.CURDIR}/makewhatis.perl ${DESTDIR}${BINDIR}/makewhatis
|
||||
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
||||
${.CURDIR}/makewhatis.local.sh \
|
||||
${DESTDIR}${libexecdir}/makewhatis.local
|
||||
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
35
gnu/usr.bin/man/makewhatis/makewhatis.local.sh
Normal file
35
gnu/usr.bin/man/makewhatis/makewhatis.local.sh
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# (c) Wolfram Schneider, Berlin. April 1996. Public Domain.
|
||||
#
|
||||
# makewhatis.local - start makewhatis(1) only for file systems
|
||||
# physically mounted on the system
|
||||
#
|
||||
# Running makewhatis from /etc/weekly for rw nfs-mounted /usr may kill
|
||||
# your NFS server -- all clients start makewhatis at the same time!
|
||||
# So use this wrapper instead calling makewhatis directly.
|
||||
#
|
||||
# PS: this wrapper works also for catman(1)
|
||||
#
|
||||
# $Id: makewhatis.local.sh,v 1.2 1996/04/27 12:17:01 wosch Exp $
|
||||
|
||||
PATH=/bin:/usr/bin:$PATH; export PATH
|
||||
opt= dirs= localdirs=
|
||||
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-*) opt="$opt $arg";;
|
||||
*) dirs="$dirs $arg";;
|
||||
esac
|
||||
done
|
||||
|
||||
dirs=`echo $dirs | sed 's/:/ /g'`
|
||||
case X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac
|
||||
|
||||
localdirs=`find -H $dirs -fstype local -type d -prune -print`
|
||||
|
||||
case X"$localdirs" in
|
||||
X) echo "$0: no local-mounted manual directories found: $dirs"
|
||||
exit 1;;
|
||||
*) exec `basename $0 .local` $opt $localdirs;;
|
||||
esac
|
@ -35,7 +35,7 @@
|
||||
#
|
||||
# E-Mail: Wolfram Schneider <wosch@cs.tu-berlin.de>
|
||||
#
|
||||
# $Id: makewhatis.perl,v 1.6 1995/04/01 11:43:09 joerg Exp $
|
||||
# $Id: makewhatis.perl,v 1.7 1995/09/10 13:05:52 joerg Exp $
|
||||
#
|
||||
|
||||
sub usage {
|
||||
@ -280,12 +280,14 @@ sub manpagename {
|
||||
return if $name eq $_;
|
||||
}
|
||||
|
||||
$name =~ s=\[=\\\[=g; # shit '['
|
||||
local($f) = $file;
|
||||
$f =~ s%/*[^/]+$%%;
|
||||
|
||||
foreach (split(/,\s+/, $man)) {
|
||||
s/\(.+//;
|
||||
($f = $file) =~ s/$name/$_/;
|
||||
|
||||
# a keyword exist as file
|
||||
return if -e "$f";
|
||||
return if -e "$f/$_";
|
||||
}
|
||||
|
||||
$man .= ", $name($extension)";
|
||||
|
35
usr.bin/makewhatis/makewhatis.local.sh
Normal file
35
usr.bin/makewhatis/makewhatis.local.sh
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
# (c) Wolfram Schneider, Berlin. April 1996. Public Domain.
|
||||
#
|
||||
# makewhatis.local - start makewhatis(1) only for file systems
|
||||
# physically mounted on the system
|
||||
#
|
||||
# Running makewhatis from /etc/weekly for rw nfs-mounted /usr may kill
|
||||
# your NFS server -- all clients start makewhatis at the same time!
|
||||
# So use this wrapper instead calling makewhatis directly.
|
||||
#
|
||||
# PS: this wrapper works also for catman(1)
|
||||
#
|
||||
# $Id: makewhatis.local.sh,v 1.2 1996/04/27 12:17:01 wosch Exp $
|
||||
|
||||
PATH=/bin:/usr/bin:$PATH; export PATH
|
||||
opt= dirs= localdirs=
|
||||
|
||||
for arg
|
||||
do
|
||||
case "$arg" in
|
||||
-*) opt="$opt $arg";;
|
||||
*) dirs="$dirs $arg";;
|
||||
esac
|
||||
done
|
||||
|
||||
dirs=`echo $dirs | sed 's/:/ /g'`
|
||||
case X"$dirs" in X) echo "usage: $0 [options] directories ..."; exit 1;; esac
|
||||
|
||||
localdirs=`find -H $dirs -fstype local -type d -prune -print`
|
||||
|
||||
case X"$localdirs" in
|
||||
X) echo "$0: no local-mounted manual directories found: $dirs"
|
||||
exit 1;;
|
||||
*) exec `basename $0 .local` $opt $localdirs;;
|
||||
esac
|
Loading…
Reference in New Issue
Block a user