diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2009-11-14 21:04:03 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2009-11-14 21:04:03 +0000 |
commit | d574a3fc142390eede2797215337f556a8e98b50 (patch) | |
tree | c94da5e346f9f08296f719e5a052efb9c8682b18 /usr.sbin | |
parent | e9bb9d142d72a9803ea040724b4a0b0998c6a568 (diff) |
ouch, collision handling must take destdir into account
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/CollisionReport.pm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm b/usr.sbin/pkg_add/OpenBSD/CollisionReport.pm index 5ac67a32ca3..948f9a42147 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.24 2009/11/14 10:56:19 espie Exp $ +# $OpenBSD: CollisionReport.pm,v 1.25 2009/11/14 21:04:02 espie Exp $ # # Copyright (c) 2003-2006 Marc Espie <espie@openbsd.org> # @@ -62,10 +62,12 @@ sub collision_report($$) { my ($list, $state) = @_; + my $destdir = $state->{destdir}; + if ($state->{defines}->{removecollisions}) { require OpenBSD::Error; for my $f (@$list) { - $state->unlink(1, $f->fullname); + $state->unlink(1, $destdir.$f->fullname); } return; } @@ -91,7 +93,6 @@ sub collision_report($$) } } if (%todo) { - my $destdir = $state->{destdir}; for my $item (sort keys %todo) { if (defined $todo{$item}) { @@ -135,7 +136,7 @@ sub collision_report($$) for my $f (@$list) { if ($state->unlink($state->{verbose}, - $f->fullname)) { + $destdir.$f->fullname)) { $state->{problems}--; } else { return; |