summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Add.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-08-22 11:26:00 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-08-22 11:26:00 +0000
commitf852fb898ffcd373ace58494eef8f25f7efa226a (patch)
tree5baf450708aa95ad7788449e2c70a313ee6226d2 /usr.sbin/pkg_add/OpenBSD/Add.pm
parentf2fbecb6a3aeb65af9ea07aca6f774bca2681c93 (diff)
maintain a counter of problems encountered per-filesystem.
Do not report more than 3 problems per filesystem unless -v -v.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Add.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm18
1 files changed, 15 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 483ee9c6abf..f65d581d6ad 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.38 2005/08/16 16:24:24 espie Exp $
+# $OpenBSD: Add.pm,v 1.39 2005/08/22 11:25:59 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -88,14 +88,26 @@ sub validate_plist($$)
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";
+ if ($state->{very_verbose} or ++($s->{problems}) < 4) {
+ Warn "Error: ", $s->{dev},
+ " is read-only ($fname)\n";
+ } elsif ($s->{problems} == 4) {
+ Warn "Error: ... more files can't be written to ",
+ $s->{dev}, "\n";
+ }
$problems++;
}
if ($state->{forced}->{kitchensink} && $state->{not}) {
next;
}
if ($s->avail() < 0) {
- Warn "Error: ", $s->{dev}, " is not large enough ($fname)\n";
+ if ($state->{very_verbose} or ++($s->{problems}) < 4) {
+ Warn "Error: ", $s->{dev},
+ " is not large enough ($fname)\n";
+ } elsif ($s->{problems} == 4) {
+ Warn "Error: ... more files do not fit on ",
+ $s->{dev}, "\n";
+ }
$problems++;
}
}