diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-12-17 11:26:23 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-12-17 11:26:23 +0000 |
commit | 1287806bfb8c768032253488deaada417b30fb7b (patch) | |
tree | 88e768619443f82f3dd20e3e9d4d4dc702062fc2 /usr.sbin/pkg_add/OpenBSD/Add.pm | |
parent | 5465df75affa6e96def5df641090f1833bf3c1eb (diff) |
better collision reports.
- in validate_plist, don't re-add a file that exists.
- allows the virtual file system to put marks on existing files
- use a \$pkgname the first time a file is added (space constraints: don't
duplicate the pkgname).
- in CollisionReport, first check the vfs, so that we don't look
at installed packages when the collision only concerns newly added pkgs.
Makes pkg_add -n report collision reports correctly.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Add.pm')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index c16e3f6a3d6..2db732a77d6 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.25 2004/12/16 11:07:33 espie Exp $ +# $OpenBSD: Add.pm,v 1.26 2004/12/17 11:26:21 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -81,9 +81,10 @@ sub validate_plist($$) if (OpenBSD::Vstat::vexists($fname)) { push(@$colliding, $item); $problems++; + next; } $totsize += $item->{size} if defined $item->{size}; - my $s = OpenBSD::Vstat::add($fname, $item->{size}); + my $s = OpenBSD::Vstat::add($fname, $item->{size}, \$pkgname); next unless defined $s; if ($s->{ro}) { Warn "Error: ", $s->{dev}, " is read-only ($fname)\n"; |