diff options
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/UpdateSet.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm index 9b701a782ce..19b44016c46 100644 --- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm +++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: UpdateSet.pm,v 1.17 2009/11/11 11:13:16 espie Exp $ +# $OpenBSD: UpdateSet.pm,v 1.18 2009/11/11 11:17:11 espie Exp $ # # Copyright (c) 2007 Marc Espie <espie@openbsd.org> # @@ -75,6 +75,7 @@ sub init { my $self = shift; $self->{l} = OpenBSD::Log->new; + $self->{progressmeter} = bless {}, "OpenBSD::StubProgress"; } sub log @@ -87,6 +88,12 @@ sub log } } +sub print +{ + my $self = shift; + $self->progress->print(@_); +} + sub system { my $self = shift; @@ -106,8 +113,6 @@ sub setup_progressmeter if (!$opt_x && !$self->{beverbose}) { require OpenBSD::ProgressMeter; $self->{progressmeter} = OpenBSD::ProgressMeter->new; - } else { - $self->{progressmeter} = bless {}, "OpenBSD::StubProgress"; } } @@ -127,7 +132,7 @@ sub choose_location { my ($state, $name, $list) = @_; if (@$list == 0) { - $state->progress->print("Can't find $name\n"); + $state->print("Can't find $name\n"); return undef; } elsif (@$list == 1) { return $list->[0]; @@ -142,7 +147,7 @@ sub choose_location my $result = OpenBSD::Interactive::ask_list("Ambiguous: choose package for $name", 1, sort keys %h); return $h{$result}; } else { - $state->progress->print("Ambiguous: $name could be ", + $state->print("Ambiguous: $name could be ", join(' ', keys %h), "\n"); return undef; } |