diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2011-07-17 13:16:16 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2011-07-17 13:16:16 +0000 |
commit | d2b5eb189db4c0fe74b2fc71de9189f187e18919 (patch) | |
tree | fc6d95760623b972a022f6f39eeaeb30784c7149 /usr.sbin/pkg_add/OpenBSD/AddDelete.pm | |
parent | da552a4d406853717fa96a9fc756c8478734e3f8 (diff) |
unify the main loop some more: add and delete do more or less the
same processing.
start making process_set similar as well
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/AddDelete.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index f8a58762ab5..3883ad6dd09 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.50 2011/07/14 11:31:20 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.51 2011/07/17 13:16:15 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org> # @@ -105,6 +105,26 @@ sub parse_and_run return $state->{bad} != 0; } +# nothing to do +sub tweak_list +{ +} + +sub process_setlist +{ + my ($self, $state) = @_; + $state->tracker->todo(@{$state->{setlist}}); + # this is the actual very small loop that processes all sets + while (my $set = shift @{$state->{setlist}}) { + $state->status->what->set($set); + $set = $set->real_set; + next if $set->{finished}; + $state->progress->set_header('Checking packages'); + unshift(@{$state->{setlist}}, $self->process_set($set, $state)); + $self->tweak_list($state); + } +} + package OpenBSD::SharedItemsRecorder; sub new { |