From: espie Date: Sun, 4 Jan 2015 14:20:04 +0000 (+0000) Subject: tweak the ntogo messages slightly so that they work better in all situations X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2d4feb812b565b1b778765a2cf6af3912f10017f;p=openbsd tweak the ntogo messages slightly so that they work better in all situations --- diff --git a/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm index 670728fc265..99724c92866 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddCreateDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddCreateDelete.pm,v 1.28 2015/01/04 14:10:20 espie Exp $ +# $OpenBSD: AddCreateDelete.pm,v 1.29 2015/01/04 14:20:04 espie Exp $ # # Copyright (c) 2007-2014 Marc Espie # @@ -142,7 +142,9 @@ sub ntogo_string { my ($self, $offset) = @_; - return $self->ntodo($offset // 0); + return $self->{wantntogo} ? + $self->f(" (#1)", $self->ntodo($offset // 0)) : + $self->f(""); } OpenBSD::Auto::cache(signer_list, diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index 17ad476f23e..e2b80f5d86a 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.70 2015/01/04 14:10:20 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.71 2015/01/04 14:20:04 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie # @@ -447,7 +447,7 @@ sub print $object = "Parameters"; } - $state->say($what." #1 (#2)", $object, $state->ntogo_string); + $state->say($what." #1#2", $object, $state->ntogo_string); if ($state->defines('carp')) { require Carp; Carp::cluck("currently here"); diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm index 3819b7e889e..655959b5230 100644 --- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm +++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Term.pm,v 1.29 2014/12/22 14:24:56 espie Exp $ +# $OpenBSD: Term.pm,v 1.30 2015/01/04 14:20:04 espie Exp $ # # Copyright (c) 2004-2007 Marc Espie # @@ -46,7 +46,7 @@ our @ISA = qw(OpenBSD::ProgressMeter); sub ntogo { my ($self, $state, $offset) = @_; - return $state->ntogo_string($offset); + return $state->ntodo($offset // 0); } sub compute_count diff --git a/usr.sbin/pkg_add/OpenBSD/Update.pm b/usr.sbin/pkg_add/OpenBSD/Update.pm index 6ece7144e9f..79e9ef85c4a 100644 --- a/usr.sbin/pkg_add/OpenBSD/Update.pm +++ b/usr.sbin/pkg_add/OpenBSD/Update.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: Update.pm,v 1.161 2014/02/02 15:22:36 espie Exp $ +# $OpenBSD: Update.pm,v 1.162 2015/01/04 14:20:04 espie Exp $ # # Copyright (c) 2004-2014 Marc Espie # @@ -72,9 +72,7 @@ sub progress_message { my ($self, $state, @r) = @_; my $msg = $state->f(@r); - if ($state->{wantntogo}) { - $msg .= " (".$state->ntogo.")"; - } + $msg .= $state->ntogo_string; $state->progress->message($msg); $state->say($msg) if $state->verbose >= 2; } @@ -209,8 +207,9 @@ sub process_handle } return undef; } - $state->say("Update candidates: #1 -> #2 (#3)", $pkgname, - join(' ', map {$_->name} @$l), $state->ntogo) if $state->verbose; + $state->say("Update candidates: #1 -> #2#3", $pkgname, + join(' ', map {$_->name} @$l), $state->ntogo_string) + if $state->verbose; my $r = $state->choose_location($pkgname, $l); if (defined $r) {