From 6c1be8b130d21514db574383672fd9d67bf010fe Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Fri, 6 Aug 2004 12:21:12 +0000 Subject: use OpenBSD::Makewhatis, avoid forking extra makewhatis. Note: requires you to update makewhatis to work. --- usr.sbin/pkg_add/pkg_add | 8 +++++--- usr.sbin/pkg_add/pkg_delete | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'usr.sbin/pkg_add') diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index a1ed538aabc..40a6aee4ddf 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.44 2004/08/06 11:36:25 espie Exp $ +# $OpenBSD: pkg_add,v 1.45 2004/08/06 12:21:11 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie # @@ -517,9 +517,11 @@ sub manpages_index { my ($plist, $destdir) = @_; return unless defined $plist->{state}->{mandirs}; + require OpenBSD::Makewhatis; + while (my ($k, $v) = each %{$plist->{state}->{mandirs}}) { - system("/usr/libexec/makewhatis", "-d", $destdir.$k, - map { $destdir.$_ } @$v); + my @l = map { $destdir.$_ } @$v; + OpenBSD::Makewhatis::merge($destdir.$k, \@l); } } diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete index 48c24d0847e..db2dc801567 100644 --- a/usr.sbin/pkg_add/pkg_delete +++ b/usr.sbin/pkg_add/pkg_delete @@ -1,6 +1,6 @@ #!/usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_delete,v 1.34 2004/08/06 10:23:45 espie Exp $ +# $OpenBSD: pkg_delete,v 1.35 2004/08/06 12:21:11 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie # @@ -355,9 +355,11 @@ sub manpages_unindex { my ($plist, $destdir) = @_; return unless defined $plist->{state}->{mandirs}; + require OpenBSD::Makewhatis; + while (my ($k, $v) = each %{$plist->{state}->{mandirs}}) { - system("/usr/libexec/makewhatis", "-u", $destdir.$k, - map { $destdir.$_ } @$v); + my @l = map { $destdir.$_ } @$v; + OpenBSD::Makewhatis::remove($destdir.$k, \@l); } } -- cgit v1.2.3