summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2012-01-05 23:03:58 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2012-01-05 23:03:58 +0000
commitba86746ddf8593b1c5909676d1fe0114743a1b54 (patch)
tree0bdf57dee1a6fd2724572cf1630f473115ec152e /usr.sbin/pkg_add/OpenBSD
parent6b5e3370d7e1a753f35756c08d9accf79e908854 (diff)
Enable the new apropos(1), whatis(1), and makewhatis(8).
Unlink the old apropos(1), whatis(1), and makewhatis(8) from the build. Call the new tools from pkg_create(1) and pkg_add(1). "Please enable it now." deraadt@
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm11
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm10
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Paths.pm3
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PkgCreate.pm15
4 files changed, 11 insertions, 28 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 03116760dd2..aa9c45222df 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.127 2011/12/03 16:15:05 espie Exp $
+# $OpenBSD: Add.pm,v 1.128 2012/01/05 23:03:57 schwarze Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -30,7 +30,6 @@ sub manpages_index
my ($state) = @_;
return unless defined $state->{mandirs};
my $destdir = $state->{destdir};
- require OpenBSD::Makewhatis;
while (my ($k, $v) = each %{$state->{mandirs}}) {
my @l = map { $destdir.$_ } @$v;
@@ -39,12 +38,8 @@ sub manpages_index
$destdir.$k, join(' ', @l))
if $state->verbose >= 2;
} else {
- try {
- OpenBSD::Makewhatis::merge($destdir.$k, \@l,
- $state);
- } catchall {
- $state->errsay("Error in makewhatis: #1", $_);
- };
+ $state->vsystem(OpenBSD::Paths->makewhatis,
+ '-d', $destdir.$k, '--', @l);
}
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 1c7ca316ed1..36035b69524 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.117 2011/09/17 15:33:56 schwarze Exp $
+# $OpenBSD: Delete.pm,v 1.118 2012/01/05 23:03:57 schwarze Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -44,7 +44,6 @@ sub manpages_unindex
my ($state) = @_;
return unless defined $state->{mandirs};
my $destdir = $state->{destdir};
- require OpenBSD::Makewhatis;
while (my ($k, $v) = each %{$state->{mandirs}}) {
my @l = map { $destdir.$_ } @$v;
@@ -53,11 +52,8 @@ sub manpages_unindex
$destdir.$k, join(' ', @l))
if $state->verbose >= 2;
} 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);
}
}
undef $state->{mandirs};
diff --git a/usr.sbin/pkg_add/OpenBSD/Paths.pm b/usr.sbin/pkg_add/OpenBSD/Paths.pm
index 4c68b71af5d..9ca0a3e2ffd 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.17 2010/12/24 09:04:14 espie Exp $
+# $OpenBSD: Paths.pm,v 1.18 2012/01/05 23:03:57 schwarze Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -47,6 +47,7 @@ sub mount() { '/sbin/mount' }
sub df() { '/bin/df' }
sub ssh() { '/usr/bin/ssh' }
sub make() { '/usr/bin/make' }
+sub makewhatis() { '/usr/libexec/makewhatis' }
sub mklocatedb() { '/usr/libexec/locate.mklocatedb' }
sub hostname() { '/bin/hostname' }
sub sudo() { '/usr/bin/sudo' }
diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm
index 0792a11fbe7..56ebaadc53f 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.53 2011/11/16 11:41:38 espie Exp $
+# $OpenBSD: PkgCreate.pm,v 1.54 2012/01/05 23:03:57 schwarze Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -1106,17 +1106,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}) {