summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2012-01-16 08:42:39 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2012-01-16 08:42:39 +0000
commit1a3f93b1d4b616d0b6c07d9f6c9fd75dcacbc94d (patch)
tree1587f978ddba00406e4601468bf403df20d68046 /usr.sbin/pkg_add
parent81623f027f52045f8e009861921bdc48d230c7f0 (diff)
Backout activation of the new apropos(1)/whatis(1)/makewhatis(8).
In its current state, it causes too much slowdown, in particular during system builds, and there are other regressions. That cannot be fixed quickly while it's enabled. Problems pointed out by espie@, backout requested by deraadt@, diff "looks good" to espie@.
Diffstat (limited to 'usr.sbin/pkg_add')
-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, 28 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index aa9c45222df..8c790f7cdd7 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.128 2012/01/05 23:03:57 schwarze Exp $
+# $OpenBSD: Add.pm,v 1.129 2012/01/16 08:42:38 schwarze Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -30,6 +30,7 @@ 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;
@@ -38,8 +39,12 @@ sub manpages_index
$destdir.$k, join(' ', @l))
if $state->verbose >= 2;
} else {
- $state->vsystem(OpenBSD::Paths->makewhatis,
- '-d', $destdir.$k, '--', @l);
+ try {
+ OpenBSD::Makewhatis::merge($destdir.$k, \@l,
+ $state);
+ } catchall {
+ $state->errsay("Error in makewhatis: #1", $_);
+ };
}
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 36035b69524..5c9536c868a 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.118 2012/01/05 23:03:57 schwarze Exp $
+# $OpenBSD: Delete.pm,v 1.119 2012/01/16 08:42:38 schwarze Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -44,6 +44,7 @@ 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;
@@ -52,8 +53,11 @@ sub manpages_unindex
$destdir.$k, join(' ', @l))
if $state->verbose >= 2;
} else {
- $state->vsystem(OpenBSD::Paths->makewhatis,
- '-u', $destdir.$k, '--', @l);
+ eval { OpenBSD::Makewhatis::remove($destdir.$k, \@l,
+ $state); };
+ if ($@) {
+ $state->errsay("Error in makewhatis: #1", $@);
+ }
}
}
undef $state->{mandirs};
diff --git a/usr.sbin/pkg_add/OpenBSD/Paths.pm b/usr.sbin/pkg_add/OpenBSD/Paths.pm
index 78d5c660fed..00a9cac9931 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.20 2012/01/09 01:59:08 schwarze Exp $
+# $OpenBSD: Paths.pm,v 1.21 2012/01/16 08:42:38 schwarze Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -47,7 +47,6 @@ 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 56ebaadc53f..71a2b43b542 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.54 2012/01/05 23:03:57 schwarze Exp $
+# $OpenBSD: PkgCreate.pm,v 1.55 2012/01/16 08:42:38 schwarze Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -1106,8 +1106,17 @@ sub finish_manpages
my ($self, $state, $plist) = @_;
$plist->grab_manpages($state);
if (defined $state->{manpages}) {
- $state->system(OpenBSD::Paths->makewhatis, '-t', '--',
- @{$state->{manpages}});
+ $state->{v} ++;
+
+ require OpenBSD::Makewhatis;
+
+ try {
+ OpenBSD::Makewhatis::scan_manpages($state->{manpages},
+ $state);
+ } catchall {
+ $state->errsay("Error in makewhatis: #1", $_);
+ };
+ $state->{v} --;
}
if (defined $state->{mandir}) {