summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-12-12 16:42:05 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-12-12 16:42:05 +0000
commit2a82312ee8b30ae2f2bdcd0f40587194dee6ee0d (patch)
tree0dcffe265ed9f088f72d2fcd2d785413919f942e /usr.sbin
parent609927164fbb7aabebf25f8edf1ee76ec657b8fa (diff)
have pkg_add recheck there are no internal conflicts in an updateset.
provides a different failure for the fam/gamin update (better one actually, since we go further...)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/pkg_add23
1 files changed, 22 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 662b8ffdaeb..ea72d0ae5f4 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.421 2009/12/12 07:06:09 espie Exp $
+# $OpenBSD: pkg_add,v 1.422 2009/12/12 16:42:04 espie Exp $
#
# Copyright (c) 2003-2009 Marc Espie <espie@openbsd.org>
#
@@ -292,6 +292,22 @@ sub can_install
return 1;
}
+sub recheck_conflicts
+{
+ my ($set, $state) = @_;
+
+ for my $h ($set->newer) {
+ for my $h2 ($set->newer) {
+ next if $h2 == $h;
+ if ($h->plist->conflict_list->conflicts_with($h2->pkgname)) {
+ $state->errsay($set->short_print, ": internal conflict between ", $h->pkgname, " and ", $h2->pkgname);
+ return 0;
+ }
+ }
+ }
+ return 1;
+}
+
package OpenBSD::AddDelete;
sub failed_message
@@ -642,6 +658,11 @@ sub install_set
# return ();
# }
# }
+ if (!$set->recheck_conflicts($state)) {
+ $set->cleanup(OpenBSD::Handle::CANT_INSTALL);
+ $state->tracker->cant($set);
+ return ();
+ }
really_add($set, $state);
$set->cleanup;
$state->tracker->done($set);