From: espie Date: Mon, 18 May 2015 10:41:19 +0000 (+0000) Subject: simplify progressmeter calls to visit_and: we retrieve the state from the X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=23b5e034ddab1b49e3c879b6038b3f89b0c924f2;p=openbsd simplify progressmeter calls to visit_and: we retrieve the state from the progressmeter object --- diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index a2ab99d5954..a9fc006043c 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.165 2015/03/29 09:42:58 espie Exp $ +# $OpenBSD: Add.pm,v 1.166 2015/05/18 10:41:19 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -101,7 +101,7 @@ sub perform_installation my ($handle, $state) = @_; $state->{partial} = $handle->{partial}; - $state->progress->visit_with_size($handle->{plist}, 'install', $state); + $state->progress->visit_with_size($handle->{plist}, 'install'); if ($handle->{location}{early_close}) { $handle->{location}->close_now; } else { diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index 62a1098bede..84dc069fefe 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.142 2014/11/30 15:53:26 espie Exp $ +# $OpenBSD: Delete.pm,v 1.143 2015/05/18 10:41:19 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -142,7 +142,7 @@ sub delete_plist if (!$state->{size_only}) { $plist->register_manpage($state, 'rmman'); manpages_unindex($state); - $state->progress->visit_with_size($plist, 'delete', $state); + $state->progress->visit_with_size($plist, 'delete'); } unregister_dependencies($plist, $state); diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index 82f11983eb9..cf48e51eec4 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.115 2015/05/18 10:37:12 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.116 2015/05/18 10:41:20 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -1257,7 +1257,7 @@ sub make_plist_with_sum { my ($self, $state, $plist) = @_; my $p2 = OpenBSD::PackingList->new; - $state->progress->visit_with_count($plist, 'makesum_plist', $state, $p2); + $state->progress->visit_with_count($plist, 'makesum_plist', $p2); $p2->set_infodir($plist->infodir); return $p2; } @@ -1499,7 +1499,7 @@ sub parse_and_run $self->check_dependencies($plist, $state); $state->set_status("checksumming"); if ($regen_package) { - $state->progress->visit_with_count($plist, 'verify_checksum', $state); + $state->progress->visit_with_count($plist, 'verify_checksum'); } else { $plist = $self->make_plist_with_sum($state, $plist); } diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm index 241f4f234d9..6265ab94778 100644 --- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm +++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: ProgressMeter.pm,v 1.46 2015/05/18 10:25:10 espie Exp $ +# $OpenBSD: ProgressMeter.pm,v 1.47 2015/05/18 10:41:20 espie Exp $ # # Copyright (c) 2010 Marc Espie # @@ -104,7 +104,7 @@ sub ntogo sub visit_with_size { my ($progress, $plist, $method, @r) = @_; - $plist->$method(@r); + $plist->$method($progress->{state}, @r); } sub visit_with_count diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter/Term.pm index d0ded47b69f..39b8838d1bd 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.31 2015/05/18 10:25:10 espie Exp $ +# $OpenBSD: Term.pm,v 1.32 2015/05/18 10:41:20 espie Exp $ # # Copyright (c) 2004-2007 Marc Espie # @@ -60,7 +60,7 @@ sub compute_count sub visit_with_size { - my ($progress, $plist, $method, $state, @r) = @_; + my ($progress, $plist, $method, @r) = @_; my $p = $progress->new_sizer($plist); $plist->size_and($p, $method, $progress->{state}, @r); } @@ -77,7 +77,7 @@ sub visit_with_count my $count = 0; $progress->show($count, $plist->{total}); $plist->count_and($progress, \$count, $plist->{total}, - $method, @r); + $method, $progress->{state}, @r); } package OpenBSD::ProgressMeter::Term;