diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-10-20 11:38:58 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-10-20 11:38:58 +0000 |
commit | 753cfc8bee662a22457b788e94fcd04822e15eae (patch) | |
tree | 62971fd31614bdf1c6f0cb73930254a7719aac94 /usr.sbin/pkg_add/pkg_delete | |
parent | 569658ff76d67fd708530f954a5e180bfba2d664 (diff) |
basic framework for delayed messages.
Diffstat (limited to 'usr.sbin/pkg_add/pkg_delete')
-rw-r--r-- | usr.sbin/pkg_add/pkg_delete | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete index 8c02032548b..2d4bf4bd013 100644 --- a/usr.sbin/pkg_add/pkg_delete +++ b/usr.sbin/pkg_add/pkg_delete @@ -1,6 +1,6 @@ #!/usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: pkg_delete,v 1.60 2004/10/19 09:43:40 espie Exp $ +# $OpenBSD: pkg_delete,v 1.61 2004/10/20 11:38:57 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -415,7 +415,7 @@ sub cleanup { my ($self, $state) = @_; my $fullname = $state->{destdir}.$self->fullname(); - print "You may wish to remove ", $fullname, " from man.conf\n"; + $state->print("You may wish to remove ", $fullname, " from man.conf\n"); unlink("$fullname/whatis.db"); } @@ -637,7 +637,7 @@ if ($< && !$forced{nonroot}) { my %done; my $removed; -my $state = {}; +my $state = new OpenBSD::Error; $state->{not} = $opt_n; $state->{quick} = $opt_q; $state->{verbose} = $opt_v >= 2; @@ -742,6 +742,7 @@ eval { print $opt_n ? "Pretending to delete " : "Deleting ", "$pkgname\n"; } + $state->set_pkgname($pkgname); $state->{pkgname_tolog} = $pkgname; delete_package($pkgname, $state); delete_installed($pkgname); @@ -769,6 +770,7 @@ my $logname = OpenBSD::Logger::logname(); if (defined $logname) { print "Problems logged as $logname\n"; } +$state->delayed_output(); if ($dielater) { die $dielater; } |