summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-28 21:28:01 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-28 21:28:01 +0000
commit432ca01d60d5ea7a97399fa6447e05cf6c002313 (patch)
tree0d6053a79a1c0812cbb34d891e99cc6096c8f150 /usr.sbin/pkg_add/OpenBSD
parent95ae64cbbace5589606e508b7c980e367406b078 (diff)
erase Requiring entirely while deleting, to avoid further issues.
if size_only, don't even pretend to delete the list (ways faster, no checksum checks)
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm21
1 files changed, 12 insertions, 9 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index 456c15e1d45..f66b5176a8d 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.94 2009/12/20 22:38:45 espie Exp $
+# $OpenBSD: Delete.pm,v 1.95 2009/12/28 21:28:00 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -124,8 +124,9 @@ sub unregister_dependencies
my ($plist, $state) = @_;
my $pkgname = $plist->pkgname;
+ my $l = OpenBSD::Requiring->new($pkgname);
- for my $name (OpenBSD::Requiring->new($pkgname)->list) {
+ for my $name ($l->list) {
$state->say("remove dependency on $name")
if $state->verbose >= 3;
local $@;
@@ -135,6 +136,7 @@ sub unregister_dependencies
$state->errsay($_);
};
}
+ $l->erase;
}
sub delete_plist
@@ -146,15 +148,16 @@ sub delete_plist
my $pkgname = $plist->pkgname;
$state->{pkgname} = $pkgname;
$ENV{'PKG_PREFIX'} = $plist->localbase;
- $plist->register_manpage($state);
- manpages_unindex($state);
- $state->progress->show(0, $totsize);
- $plist->delete_and_progress($state, \$donesize, $totsize);
- if ($plist->has(UNDISPLAY)) {
- $plist->get(UNDISPLAY)->prepare($state);
+ if (!$state->{size_only}) {
+ $plist->register_manpage($state);
+ manpages_unindex($state);
+ $state->progress->show(0, $totsize);
+ $plist->delete_and_progress($state, \$donesize, $totsize);
+ if ($plist->has(UNDISPLAY)) {
+ $plist->get(UNDISPLAY)->prepare($state);
+ }
}
-
unregister_dependencies($plist, $state);
return if $state->{not};
if ($state->{baddelete}) {