summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
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
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')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm18
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Vstat.pm4
2 files changed, 17 insertions, 5 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++;
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Vstat.pm b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
index e06558115dc..76f90d5c835 100644
--- a/usr.sbin/pkg_add/OpenBSD/Vstat.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Vstat.pm,v 1.11 2005/08/22 11:11:39 espie Exp $
+# $OpenBSD: Vstat.pm,v 1.12 2005/08/22 11:25:59 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -37,7 +37,7 @@ sub create_device($)
my $dev = shift;
my $n = $devinfo->{$dev};
if (!defined $n) {
- $n = { dev => $dev, used => 0 };
+ $n = { dev => $dev, used => 0, problems => 0 };
bless $n, "OpenBSD::Vstat::MountPoint";
$devinfo->{$dev} = $n;
}