From b58effd07c82139725eb68590a1fc4032424c1d9 Mon Sep 17 00:00:00 2001 From: schwarze Date: Fri, 18 Apr 2014 10:00:48 +0000 Subject: [PATCH] Switch to the new makewhatis(8)/apropos(1)/whatis(1) combo. "commit the switch now" espie@ "go for it" deraadt@ See the apropos(1) manual for a description of what's new. On machines where you want the full functionality, run "sudo makewhatis" and put "MAKEWHATISARGS=' '" into weekly.local(8). Otherwise, when upgrading via source, run "sudo makewhatis -Q". --- etc/weekly | 4 ++-- libexec/Makefile | 4 ++-- share/man/Makefile | 4 ++-- share/man/man8/daily.8 | 10 ++++++++-- usr.bin/Makefile | 6 +++--- usr.bin/mandoc/Makefile | 9 +++++++-- usr.sbin/pkg_add/OpenBSD/Add.pm | 12 +++--------- usr.sbin/pkg_add/OpenBSD/Delete.pm | 12 +++--------- usr.sbin/pkg_add/OpenBSD/Paths.pm | 3 ++- usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 15 +++------------ 10 files changed, 35 insertions(+), 44 deletions(-) diff --git a/etc/weekly b/etc/weekly index 9e5585aa8a4..97d09adce58 100644 --- a/etc/weekly +++ b/etc/weekly @@ -1,5 +1,5 @@ # -# $OpenBSD: weekly,v 1.25 2011/07/07 23:09:46 guenther Exp $ +# $OpenBSD: weekly,v 1.26 2014/04/18 10:00:48 schwarze Exp $ # # For local additions, create the file /etc/weekly.local. # To get section headers, use the function next_part in weekly.local. @@ -63,7 +63,7 @@ if [ -f /var/db/locate.database ]; then fi next_part "Rebuilding whatis databases:" -/usr/libexec/makewhatis +/usr/sbin/makewhatis ${MAKEWHATISARGS:--Q} next_part "Doing login accounting:" [ "X$LOGINACCOUNTING" = X1 ] && { diff --git a/libexec/Makefile b/libexec/Makefile index cd92fca2f17..1949c40ba38 100644 --- a/libexec/Makefile +++ b/libexec/Makefile @@ -1,12 +1,12 @@ # from: @(#)Makefile 5.7 (Berkeley) 4/1/91 -# $OpenBSD: Makefile,v 1.57 2014/03/24 13:55:59 deraadt Exp $ +# $OpenBSD: Makefile,v 1.58 2014/04/18 10:00:48 schwarze Exp $ .include SUBDIR= comsat fingerd ftpd getty ld.so lockspool login_chpass \ login_lchpass login_passwd login_radius login_reject \ login_skey login_tis login_token login_yubikey mail.local \ - makewhatis rpc.rquotad rpc.rstatd rpc.rusersd rpc.rwalld \ + rpc.rquotad rpc.rstatd rpc.rusersd rpc.rwalld \ rshd security spamd spamd-setup spamlogd talkd .if (${YP:L} == "yes") diff --git a/share/man/Makefile b/share/man/Makefile index d0e2f3b6089..a768d60ee3c 100644 --- a/share/man/Makefile +++ b/share/man/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2012/01/16 08:42:38 schwarze Exp $ +# $OpenBSD: Makefile,v 1.10 2014/04/18 10:00:48 schwarze Exp $ # from: @(#)Makefile 5.9 (Berkeley) 7/1/91 SUBDIR= man1 man3 man4 man5 man6 man7 man8 man9 @@ -8,6 +8,6 @@ afterinstall: ${DESTDIR}/usr/share/man/COPYRIGHT makedb: - /usr/libexec/makewhatis -v ${DESTDIR}/usr/share/man + /usr/sbin/makewhatis -Qv ${DESTDIR}/usr/share/man .include diff --git a/share/man/man8/daily.8 b/share/man/man8/daily.8 index ce94af34ea1..c06b75ea716 100644 --- a/share/man/man8/daily.8 +++ b/share/man/man8/daily.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: daily.8,v 1.18 2011/04/18 23:58:45 schwarze Exp $ +.\" $OpenBSD: daily.8,v 1.19 2014/04/18 10:00:48 schwarze Exp $ .\" .\" Copyright (c) 2003 Jason McIntyre .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: April 18 2011 $ +.Dd $Mdocdate: April 18 2014 $ .Dt DAILY 8 .Os .Sh NAME @@ -235,6 +235,12 @@ The following variables can be set in If set to 1, run .Xr ac 8 to report login accounting. +.It Ev MAKEWHATISARGS +If set to a string containing at least one character (even a blank), +use that string as the arguments to +.Xr makewhatis 8 . +If unset or empty, use the default argument +.Fl Q . .El .Sh FILES .Bl -tag -width "/var/cron/tabs/root" -compact diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 61503ff8071..dc2a3175cb7 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -1,8 +1,8 @@ -# $OpenBSD: Makefile,v 1.137 2014/03/25 21:02:59 millert Exp $ +# $OpenBSD: Makefile,v 1.138 2014/04/18 10:00:48 schwarze Exp $ .include -SUBDIR= apply apropos arch asa at aucat audioctl awk banner \ +SUBDIR= apply arch asa at aucat audioctl awk banner \ basename bc bdes bgplg \ biff cal calendar cap_mkdb cdio chpass cmp col colrm \ column comm compress cpp crontab csplit ctags cu cut \ @@ -27,7 +27,7 @@ SUBDIR= apply apropos arch asa at aucat audioctl awk banner \ tmux top touch tput tr true tset tsort tty usbhidaction usbhidctl \ ul uname unexpand unifdef uniq units \ unvis users uudecode uuencode vacation vi vis vmstat w wall wc \ - what whatis which who whois write x99token xargs xinstall \ + what which who whois write x99token xargs xinstall \ xstr yacc yes .if (${YP:L} == "yes") diff --git a/usr.bin/mandoc/Makefile b/usr.bin/mandoc/Makefile index df0da28cdab..68cfecc754e 100644 --- a/usr.bin/mandoc/Makefile +++ b/usr.bin/mandoc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.75 2014/03/21 22:17:01 schwarze Exp $ +# $OpenBSD: Makefile,v 1.76 2014/04/18 10:00:48 schwarze Exp $ .include @@ -20,6 +20,11 @@ SRCS+= manpath.c mandocdb.c mansearch_const.c mansearch.c apropos.c PROG= mandoc -MAN= mandoc.1 +LINKS = ${BINDIR}/mandoc ${BINDIR}/apropos \ + ${BINDIR}/mandoc ${BINDIR}/whatis \ + ${BINDIR}/mandoc /usr/sbin/makewhatis \ + ${BINDIR}/mandoc /usr/libexec/makewhatis + +MAN = apropos.1 mandoc.1 whatis.1 makewhatis.8 .include diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index c5b284c1104..68b391fa55a 100644 --- a/usr.sbin/pkg_add/OpenBSD/Add.pm +++ b/usr.sbin/pkg_add/OpenBSD/Add.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Add.pm,v 1.150 2014/03/18 18:53:29 espie Exp $ +# $OpenBSD: Add.pm,v 1.151 2014/04/18 10:00:48 schwarze Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -30,7 +30,6 @@ sub manpages_index my ($state) = @_; return unless defined $state->{addman}; my $destdir = $state->{destdir}; - require OpenBSD::Makewhatis; # fudge verbose for API differences my $v = $state->{v}; @@ -41,13 +40,8 @@ sub manpages_index $state->say("Merging manpages in #1: #2", $destdir.$k, join(' ', @l)) if $state->verbose; } else { - eval { - OpenBSD::Makewhatis::merge($destdir.$k, \@l, - $state); - }; - if ($@) { - $state->errsay("Error in makewhatis: #1", $_); - }; + $state->vsystem(OpenBSD::Paths->makewhatis, + '-d', $destdir.$k, '--', @l); } } $state->{v} = $v; diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index 764281cbbf5..2e97089094d 100644 --- a/usr.sbin/pkg_add/OpenBSD/Delete.pm +++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Delete.pm,v 1.134 2014/03/18 18:53:29 espie Exp $ +# $OpenBSD: Delete.pm,v 1.135 2014/04/18 10:00:48 schwarze Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -44,7 +44,6 @@ sub manpages_unindex my ($state) = @_; return unless defined $state->{rmman}; my $destdir = $state->{destdir}; - require OpenBSD::Makewhatis; # fudge verbose for API differences my $v = $state->{v}; @@ -55,13 +54,8 @@ sub manpages_unindex $state->say("Removing manpages in #1: #2", $destdir.$k, join(' ', @l)) if $state->verbose; } else { - eval { - OpenBSD::Makewhatis::remove($destdir.$k, \@l, - $state); - }; - if ($@) { - $state->errsay("Error in makewhatis: #1", $_); - }; + $state->vsystem(OpenBSD::Paths->makewhatis, + '-u', $destdir.$k, '--', @l); } } $state->{v} = $v; diff --git a/usr.sbin/pkg_add/OpenBSD/Paths.pm b/usr.sbin/pkg_add/OpenBSD/Paths.pm index da38e163d72..987fa383af3 100644 --- a/usr.sbin/pkg_add/OpenBSD/Paths.pm +++ b/usr.sbin/pkg_add/OpenBSD/Paths.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Paths.pm,v 1.27 2014/01/17 10:54:14 espie Exp $ +# $OpenBSD: Paths.pm,v 1.28 2014/04/18 10:00:48 schwarze Exp $ # # Copyright (c) 2007-2014 Marc Espie # @@ -44,6 +44,7 @@ sub arch() { '/usr/bin/arch' } sub uname() { '/usr/bin/uname' } sub userdel() { '/usr/sbin/userdel' } sub groupdel() { '/usr/sbin/groupdel' } +sub makewhatis() { '/usr/sbin/makewhatis' } sub mknod() { '/sbin/mknod' } sub mount() { '/sbin/mount' } sub df() { '/bin/df' } diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index e3516da0eb8..8323baea297 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCreate.pm,v 1.104 2014/03/18 20:56:30 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.105 2014/04/18 10:00:48 schwarze Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -1283,17 +1283,8 @@ sub finish_manpages my ($self, $state, $plist) = @_; $plist->grab_manpages($state); if (defined $state->{manpages}) { - $state->{v} ++; - - require OpenBSD::Makewhatis; - - try { - OpenBSD::Makewhatis::scan_manpages($state->{manpages}, - $state); - } catchall { - $state->errsay("Error in makewhatis: #1", $_); - }; - $state->{v} --; + $state->system(OpenBSD::Paths->makewhatis, '-t', '--', + @{$state->{manpages}}); } if (defined $state->{mandir}) { -- 2.20.1