diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-02-07 00:52:36 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-02-07 00:52:36 +0000 |
commit | 44b9b09a0ebc7efd092d8c5cb27ca52a02e16be3 (patch) | |
tree | 9400c266eb227d2e1dddde37de93991e3ccb88b6 /usr.sbin | |
parent | f80065534e8235776dc051498b81e1c76fec263a (diff) |
take size of metainfo into account when checking if the file system is
large enough before installing a package.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/Add.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm index d93e1eb7768..c398179d06f 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.30 2005/01/13 00:27:39 espie Exp $ +# $OpenBSD: Add.pm,v 1.31 2005/02/07 00:52:35 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -98,6 +98,27 @@ sub validate_plist($$) $problems++; } } + my $dest = installed_info($pkgname); + my $dir = $plist->{dir}; + for my $i (info_names()) { + if (-e "$dir/$i") { + my $size = (stat _)[7]; + my $fname = "$dest/$i"; + my $s = OpenBSD::Vstat::add($fname, $size, \$pkgname); + next unless defined $s; + if ($s->{ro}) { + Warn "Error: ", $s->{dev}, " is read-only ($fname)\n"; + $problems++; + } + if ($state->{forced}->{kitchensink} && $state->{not}) { + next; + } + if ($s->avail() < 0) { + Warn "Error: ", $s->{dev}, " is not large enough ($fname)\n"; + $problems++; + } + } + } if (@$colliding > 0) { require OpenBSD::CollisionReport; |