summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2011-12-03 16:15:06 +0000
committerMarc Espie <espie@cvs.openbsd.org>2011-12-03 16:15:06 +0000
commitbba335689980b5b93df5b0aebc94968c8cb4cc94 (patch)
treeae6324442e4b3e1070d632548c32aa2bef88c911 /usr.sbin
parent5eb8aa22c6f93ddd9e7244db815763d310a3f578 (diff)
In a collision, retrofit storage for 2nd pkgname.
(in large updatesets, it may not be obvious where the 2nd copy comes from, as exemplified by ajacoutot@).
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm3
-rw-r--r--usr.sbin/pkg_add/OpenBSD/CollisionReport.pm10
2 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 0a9315bd53d..03116760dd2 100644
--- a/usr.sbin/pkg_add/OpenBSD/Add.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Add.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Add.pm,v 1.126 2011/09/17 15:33:56 schwarze Exp $
+# $OpenBSD: Add.pm,v 1.127 2011/12/03 16:15:05 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -356,6 +356,7 @@ sub prepare_for_addition
# check for collisions with existing stuff
if ($state->vstat->exists($fname)) {
push(@{$state->{colliding}}, $self);
+ $self->{newly_found} = $pkgname;
$state->{problems}++;
return;
}
diff --git a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
index 7ed65c52792..3144225d7a8 100644
--- a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
+++ b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: CollisionReport.pm,v 1.41 2011/01/02 14:26:17 espie Exp $
+# $OpenBSD: CollisionReport.pm,v 1.42 2011/12/03 16:15:05 espie Exp $
#
# Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org>
#
@@ -79,6 +79,7 @@ sub collision_report
return;
}
my %todo = map {($_->fullname, $_->{d})} @$list;
+ my %extra = map {($_->fullname, $_->{newly_found})} @$list;
my $clueless_bat;
my $clueless_bat2;
my $found = 0;
@@ -90,7 +91,12 @@ sub collision_report
for my $pkg (sort keys %$bypkg) {
for my $item (sort @{$bypkg->{$pkg}}) {
$found++;
- $state->errsay("\t#1 (#2)", $item, $pkg);
+ if ($extra{$item}) {
+ $state->errsay("\t#1 (#2 and #3)", $item,
+ $pkg, $extra{$item});
+ } else {
+ $state->errsay("\t#1 (#2)", $item, $pkg);
+ }
}
if ($pkg =~ m/^(?:partial\-|borked\.\d+$)/o) {
$clueless_bat = $pkg;