summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2014-02-08 10:43:26 +0000
committerMarc Espie <espie@cvs.openbsd.org>2014-02-08 10:43:26 +0000
commit4f472771dca156cd1f82c4650275d8dc416e5a7d (patch)
tree1571c8bc3ff6b8ddd1efccc31e9eaf8a9edd6226 /usr.sbin
parent6891f66acd365c3ac555837089726ad52762ab79 (diff)
fudge verbose state so that makewhatis is only verbose if pkg_add/delete -vv
or more.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm14
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm19
2 files changed, 21 insertions, 12 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 69a09ef9444..000a35c6978 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.147 2014/02/03 16:13:13 espie Exp $
+# $OpenBSD: Add.pm,v 1.148 2014/02/08 10:43:25 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -32,21 +32,25 @@ sub manpages_index
my $destdir = $state->{destdir};
require OpenBSD::Makewhatis;
+ # fudge verbose for API differences
+ my $v = $state->{v};
+ $state->{v} = $state->verbose >= 2;
while (my ($k, $v) = each %{$state->{addman}}) {
my @l = map { "$destdir$k/$_" } @$v;
if ($state->{not}) {
$state->say("Merging manpages in #1: #2",
- $destdir.$k, join(' ', @l))
- if $state->verbose >= 2;
+ $destdir.$k, join(' ', @l)) if $state->verbose;
} else {
- try {
+ eval {
OpenBSD::Makewhatis::merge($destdir.$k, \@l,
$state);
- } catchall {
+ };
+ if ($@) {
$state->errsay("Error in makewhatis: #1", $_);
};
}
}
+ $state->{v} = $v;
delete $state->{addman};
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 0cfecc13652..0b16e2db4f2 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.132 2014/02/06 16:55:01 espie Exp $
+# $OpenBSD: Delete.pm,v 1.133 2014/02/08 10:43:25 espie Exp $
#
# Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org>
#
@@ -46,20 +46,25 @@ sub manpages_unindex
my $destdir = $state->{destdir};
require OpenBSD::Makewhatis;
+ # fudge verbose for API differences
+ my $v = $state->{v};
+ $state->{v} = $state->verbose >= 2;
while (my ($k, $v) = each %{$state->{rmman}}) {
my @l = map { "$destdir$k/$_" } @$v;
if ($state->{not}) {
$state->say("Removing manpages in #1: #2",
- $destdir.$k, join(' ', @l))
- if $state->verbose >= 2;
+ $destdir.$k, join(' ', @l)) if $state->verbose;
} else {
- eval { OpenBSD::Makewhatis::remove($destdir.$k, \@l,
- $state); };
+ eval {
+ OpenBSD::Makewhatis::remove($destdir.$k, \@l,
+ $state);
+ };
if ($@) {
- $state->errsay("Error in makewhatis: #1", $@);
- }
+ $state->errsay("Error in makewhatis: #1", $_);
+ };
}
}
+ $state->{v} = $v;
delete $state->{rmman};
}