diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2018-12-13 12:48:54 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2018-12-13 12:48:54 +0000 |
commit | d8ee6ba176a0caa93122ecb6e582ef16a8f3a85f (patch) | |
tree | 81b554f8a7d8545ac96085dc769857499e2ee12c | |
parent | 0fa8e821432dd6cc1d2501a630d98df5a1aaa801 (diff) |
split the status display in two, so that I can explicitly show I'm
not extracting files, but skipping tied entries, which still takes
time for texlive.
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 3 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PkgAdd.pm | 50 |
2 files changed, 32 insertions, 21 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index b3ddc97cb44..5ccd91e607b 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.178 2018/12/10 19:19:04 espie Exp $ +# $OpenBSD: Add.pm,v 1.179 2018/12/13 12:48:53 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -126,6 +126,7 @@ sub perform_extraction my $p = $state->progress->new_sizer($handle->{plist}, $state); while (my $file = $state->{archive}->next) { if (keys %$wanted == 0) { + $state->tweak_header("skipping"); for my $e (values %$tied) { $e->tie($state); $p->advance($e); diff --git a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm index 8db6ab2b95b..e59b39907c0 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgAdd.pm @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgAdd.pm,v 1.106 2018/12/12 14:14:06 espie Exp $ +# $OpenBSD: PkgAdd.pm,v 1.107 2018/12/13 12:48:53 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie <espie@openbsd.org> # @@ -201,6 +201,31 @@ OpenBSD::Auto::cache(tracker, return OpenBSD::Tracker->new; }); +sub tweak_header +{ + my ($state, $info) = @_; + my $header = $state->{setheader}; + + if (defined $info) { + $header.=" ($info)"; + } + + if (!$state->progress->set_header($header)) { + return unless $state->verbose; + if (!defined $info) { + $header = "Adding $header"; + } + if (defined $state->{lastheader} && + $header eq $state->{lastheader}) { + return; + } + $state->{lastheader} = $header; + $state->print("#1", $header); + $state->print("(pretending) ") if $state->{not}; + $state->print("\n"); + } +} + package OpenBSD::ConflictCache; our @ISA = (qw(OpenBSD::Cloner)); sub new @@ -246,24 +271,10 @@ sub setup_header } else { $header .= $set->print; } - if (defined $info) { - $header.=" ($info)"; - } - if (!$state->progress->set_header($header)) { - return unless $state->verbose; - if (!defined $info) { - $header = "Adding $header"; - } - if (defined $state->{lastheader} && - $header eq $state->{lastheader}) { - return; - } - $state->{lastheader} = $header; - $state->print("#1", $header); - $state->print("(pretending) ") if $state->{not}; - $state->print("\n"); - } + $state->{setheader} = $header; + + $state->tweak_header($info); } my $checked = {}; @@ -768,8 +779,7 @@ sub really_add $set->setup_header($state, $handle, "extracting"); try { - OpenBSD::Add::perform_extraction($handle, - $state); + OpenBSD::Add::perform_extraction($handle, $state); } catchall { unless ($state->{interrupted}) { $state->errsay($_); |