summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2004-12-17 11:30:29 +0000
committerMarc Espie <espie@cvs.openbsd.org>2004-12-17 11:30:29 +0000
commit1afa694fe2e13a55e4147da9754976a56e7332c4 (patch)
tree383bf33364a7be7af845801a8044642ec3f9d701
parent1287806bfb8c768032253488deaada417b30fb7b (diff)
can postpone grabbing conflict keys.
-rw-r--r--usr.sbin/pkg_add/pkg_add5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 33d6df58559..72fdc502ed6 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.145 2004/12/16 11:38:27 espie Exp $
+# $OpenBSD: pkg_add,v 1.146 2004/12/17 11:30:28 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -81,7 +81,6 @@ sub can_install($$$)
return 1 if @conflicts == 0;
my %conflicts = map {($_,1)} @conflicts;
- @conflicts = keys %conflicts;
if (defined $conflicts{$pkgname}) {
if ($state->{forced}->{installed}) {
@@ -95,6 +94,8 @@ sub can_install($$$)
return undef;
}
}
+
+ @conflicts = keys %conflicts;
if (!$state->{replace} || @conflicts >= 2) {
print "Can't install $pkgname because of conflicts (",join(',', @conflicts), ")\n";
$errors++;