summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-08-06 14:33:03 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-08-06 14:33:03 +0000
commit28914beef7207fbea9bc164aab7199bc063e5f93 (patch)
treed9e3ae2f9efe7dc3275ca33e1a7de2dc46fee7d8 /usr.sbin
parent248072f6b59e45e0cdfd1b7384c46d7ae6257839 (diff)
protect makewhatis calls inside eval.
failing makewhatis should be a warning at best.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/pkg_add7
-rw-r--r--usr.sbin/pkg_add/pkg_delete7
2 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 40a6aee4ddf..a91e2dd7027 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.45 2004/08/06 12:21:11 espie Exp $
+# $OpenBSD: pkg_add,v 1.46 2004/08/06 14:33:02 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -521,7 +521,10 @@ sub manpages_index
while (my ($k, $v) = each %{$plist->{state}->{mandirs}}) {
my @l = map { $destdir.$_ } @$v;
- OpenBSD::Makewhatis::merge($destdir.$k, \@l);
+ eval { OpenBSD::Makewhatis::merge($destdir.$k, \@l); };
+ if ($@) {
+ print STDERR "Error in makewhatis: $@\n";
+ }
}
}
diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete
index db2dc801567..bcdb7aaf7e2 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.35 2004/08/06 12:21:11 espie Exp $
+# $OpenBSD: pkg_delete,v 1.36 2004/08/06 14:33:02 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -359,7 +359,10 @@ sub manpages_unindex
while (my ($k, $v) = each %{$plist->{state}->{mandirs}}) {
my @l = map { $destdir.$_ } @$v;
- OpenBSD::Makewhatis::remove($destdir.$k, \@l);
+ eval { OpenBSD::Makewhatis::remove($destdir.$k, \@l); };
+ if ($@) {
+ print STDERR "Error in makewhatis: $@\n";
+ }
}
}