diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2018-07-11 16:53:15 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2018-07-11 16:53:15 +0000 |
commit | 28309fd859f5f624aadc0e2d5a7b27a99ed13b6b (patch) | |
tree | 1ed4427af2f06def208bf4eb27c7389876413d32 /usr.sbin/pkg_add | |
parent | 7db2ae1cf017a49328622d81b0956e4b433460bd (diff) |
"running tags"
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index 18846933123..ecd95aee559 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.82 2018/07/10 10:37:59 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.83 2018/07/11 16:53:14 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org> # @@ -53,6 +53,20 @@ sub do_the_main_work return $dielater; } +sub handle_end_tags +{ + my ($self, $state) = @_; + return if !defined $state->{tags}{atend}; + $state->progress->for_list("Running tags", + [keys %{$state->{tags}{atend}}], + sub { + my $k = shift; + return if $state->{tags}{deleted}{$k}; + return if $state->{tags}{superseded}{$k}; + $state->{tags}{atend}{$k}->run_tag($state); + }); +} + sub framework { my ($self, $state) = @_; @@ -63,13 +77,7 @@ sub framework $self->process_parameters($state); my $dielater = $self->do_the_main_work($state); # cleanup various things - if (defined $state->{tags}{atend}) { - while (my ($k, $d) = each %{$state->{tags}{atend}}) { - next if $state->{tags}{deleted}{$k}; - next if $state->{tags}{superseded}{$k}; - $d->run_tag($state); - } - } + $self->handle_end_tags($state); $state->{recorder}->cleanup($state); $state->ldconfig->ensure; OpenBSD::PackingElement->finish($state); |