diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-01-13 00:29:38 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-01-13 00:29:38 +0000 |
commit | 72afe00a86d0a2659edaad15cdc1b5a8ad21ed2b (patch) | |
tree | cafa9fd19a2b8a954fa06c0905ba50e2d881ad04 | |
parent | ef2eebbd94aebfa91211c8dfea9d957d7d14e897 (diff) |
just mark it down when we can't install a package, instead of trying
later, so that we can erase some temp info.
Saves memory and time for -F kitchensink, mostly nop otherwise...
-rw-r--r-- | usr.sbin/pkg_add/pkg_add | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add index 57a34a7c719..b710792a580 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.165 2005/01/03 01:02:45 espie Exp $ +# $OpenBSD: pkg_add,v 1.166 2005/01/13 00:29:37 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -60,6 +60,7 @@ sub can_install($$$) } } else { print "Can't install $pkgname because it's already installed\n"; + $state->{installed}->{$handle->{pkgname}} = 1; $errors++; return undef; } @@ -139,6 +140,9 @@ sub pre_add($$) } return undef; } + if ($handle->{finished}) { + return undef; + } my $dir = $handle->info(); my $plist = $handle->{plist} = OpenBSD::PackingList->fromfile($dir.CONTENTS); @@ -170,6 +174,9 @@ sub pre_add($$) return $handle; } else { $handle->close(); + rmtree($handle->info()); + delete $handle->{plist}; + $handle->{finished} = 1; if ($state->{forced}->{kitchensink}) { $errors = 0; } |