From 39b3222deb114c1aa0b82e61ee8d09af78a5afd6 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sat, 28 Nov 2009 10:05:59 +0000 Subject: still not right, so revert to original algorithm, and compute @todo in a more expensive way... --- usr.sbin/pkg_add/pkg_delete | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'usr.sbin/pkg_add') diff --git a/usr.sbin/pkg_add/pkg_delete b/usr.sbin/pkg_add/pkg_delete index 4617916d0d1..8c53c8613d2 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.127 2009/11/28 10:01:50 espie Exp $ +# $OpenBSD: pkg_delete,v 1.128 2009/11/28 10:05:58 espie Exp $ # # Copyright (c) 2003-2007 Marc Espie # @@ -122,8 +122,8 @@ sub { # and finally, handle the removal do { $removed = 0; - DELETE: while (my $pkgname = shift @todo) { - $state->{todo} = scalar @todo; + DELETE: for my $pkgname (@todo) { + $state->{todo} = scalar @todo - scalar keys %done; next if $done{$pkgname}; unless (is_installed($pkgname)) { $state->say("$pkgname was not installed"); @@ -133,7 +133,6 @@ sub { } my $r = OpenBSD::RequiredBy->new($pkgname); if ($r->list > 0) { - push(@todo, $pkgname); if ($defines{baddepend}) { for my $p ($r->list) { if ($done{$p}) { -- cgit v1.2.3