summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2010-01-02 16:51:52 +0000
committerMarc Espie <espie@cvs.openbsd.org>2010-01-02 16:51:52 +0000
commit97e4fc0946cacc7dc1190cfd0a8079d7f1fe603c (patch)
treeb4d380fbb558023a115ae05928d4c6acc4515062 /usr.sbin/pkg_add
parentd61cce11e6d1a6bcba9a8f30eb2056d1b737b82b (diff)
keep going after collisions
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm10
-rw-r--r--usr.sbin/pkg_add/pkg_add19
2 files changed, 18 insertions, 11 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index 7184e37cca2..87fc3cbd9d9 100644
--- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
+++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: UpdateSet.pm,v 1.49 2010/01/01 13:00:05 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.50 2010/01/02 16:51:51 espie Exp $
#
# Copyright (c) 2007-2010 Marc Espie <espie@openbsd.org>
#
@@ -305,10 +305,12 @@ sub validate_plists
$state->vstat->tally;
}
if ($state->{problems}) {
- require OpenBSD::Error;
- OpenBSD::Error::Fatal "fatal issues in ", $self->short_print;
+ $state->vstat->drop_changes;
+ return 0;
+ } else {
+ $state->vstat->synchronize;
+ return 1;
}
- $state->vstat->synchronize;
}
sub compute_size
diff --git a/usr.sbin/pkg_add/pkg_add b/usr.sbin/pkg_add/pkg_add
index 897577b2c05..58ac65a3800 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.458 2010/01/02 12:52:18 espie Exp $
+# $OpenBSD: pkg_add,v 1.459 2010/01/02 16:51:51 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -522,12 +522,6 @@ sub really_add
{
my ($set, $state) = @_;
- for my $h ($set->newer) {
- $h->plist->set_infodir($h->location->info);
- }
-
- $set->validate_plists($state);
-
my $errors = 0;
check_x509_signature($set, $state);
@@ -792,6 +786,17 @@ sub install_set
}
}
if ($set->newer > 0 || $set->older_to_do > 0) {
+ for my $h ($set->newer) {
+ $h->plist->set_infodir($h->location->info);
+ }
+
+ if (!$set->validate_plists($state)) {
+ $set->cleanup(OpenBSD::Handle::CANT_INSTALL,
+ "file issues");
+ $state->tracker->cant($set);
+ return ();
+ }
+
really_add($set, $state);
}
$set->cleanup;