diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-08-06 12:21:12 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-08-06 12:21:12 +0000 |
commit | 6c1be8b130d21514db574383672fd9d67bf010fe (patch) | |
tree | 9a5b593897630c8fffbde57d7430bf5f22767ee1 /usr.sbin/pkg_add | |
parent | 1f84ea29234d077d429098269548eda8a647264a (diff) |
use OpenBSD::Makewhatis, avoid forking extra makewhatis.
Note: requires you to update makewhatis to work.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 8 | ||||
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete | 8 |
2 files changed, 10 insertions, 6 deletions
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 <espie@openbsd.org> # @@ -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 <espie@openbsd.org> # @@ -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); } } |