diff options
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Delete.pm | 4 | ||||
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm | 19 |
2 files changed, 20 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm index 8ba03dfb0e7..3171a025982 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.19 2004/12/21 18:12:05 espie Exp $ +# $OpenBSD: Delete.pm,v 1.20 2004/12/29 14:10:27 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -81,6 +81,7 @@ sub remove_packing_info sub delete_package { my ($pkgname, $state) = @_; + OpenBSD::ProgressMeter::message("reading plist"); my $plist = OpenBSD::PackingList->from_installation($pkgname) or Fatal "Bad package"; if (!defined $plist->pkgname()) { @@ -310,6 +311,7 @@ sub delete $state->print("File $realname is not a file\n"); return; } + if (!defined $orig->{md5}) { $state->print("Couldn't delete $realname (no md5)\n"); return; diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm index b98d4e2021f..68152be9817 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.4 2004/12/29 01:11:13 espie Exp $ +# $OpenBSD: ProgressMeter.pm,v 1.5 2004/12/29 14:10:27 espie Exp $ # # Copyright (c) 2004 Marc Espie <espie@openbsd.org> # @@ -85,10 +85,25 @@ sub set_header return $isatty; } +sub message +{ + return unless $isatty; + my $message = shift; + my $d; + if ($playfield) { + $d = "$header|".substr($message, 0, $playfield); + } else { + $d = $header; + } + return if $d eq $lastdisplay; + $lastdisplay=$d; + print STDERR $d, "\r"; +} + sub show { - my ($current, $total) = @_; return unless $isatty; + my ($current, $total) = @_; my $d; if ($playfield) { |