diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-11-11 12:42:18 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-11-11 12:42:18 +0000 |
commit | a8e1a00f090236076a541f74902e8d296a30b37c (patch) | |
tree | e3ac7a483d95a121de1969e76688c796b808b7cf | |
parent | dac9950a04ceb5cf20ea409d31c27659111aebb2 (diff) |
fix setup_header in -vx !-r case: show we are adding a package, and don't
show it twice.
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 00d47a07185..bbfb40cc5da 100644 --- a/usr.sbin/pkg_add/pkg_add +++ b/usr.sbin/pkg_add/pkg_add @@ -1,7 +1,7 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_add,v 1.379 2009/11/11 12:32:03 espie Exp $ +# $OpenBSD: pkg_add,v 1.380 2009/11/11 12:42:17 espie Exp $ # # Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org> # @@ -125,7 +125,7 @@ use OpenBSD::Error; sub setup_header { my ($set, $state, $handle, $info) = @_; - + my $header = $state->deptree_header($set); if (defined $handle) { $header .= $handle->pkgname; @@ -137,7 +137,14 @@ sub setup_header } if (!$state->progress->set_header($header)) { - $info //= 'add'; + if (!defined $info) { + $header = "Adding $header"; + } + if (defined $state->{lastheader} && + $header eq $state->{lastheader}) { + return; + } + $state->{lastheader} = $header; print $header; print "(pretending) " if $state->{not}; if ($state->{do_faked}) { |