summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Add.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-02-24 18:45:12 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-02-24 18:45:12 +0000
commitf253be8e096d25b45b7215abb2fe352085c439d1 (patch)
treec7b99bcc9f8ddcfbb6f399fd371eec09575cab84 /usr.sbin/pkg_add/OpenBSD/Add.pm
parentf9fbfbf829223da29f9bceee5878ac57f54d43ad (diff)
UI improvement: in case the disk overflows, let tally give information
about the extra size needed. In validate, mark the overflow and call tally later. .e.g., Error: /dev/wd0f is not large enough (/usr/local/lib/libkparts.so.4.0.0) Error: /dev/wd0f is not large enough (/usr/local/lib/libkrosscore.so.4.0.0) Error: /dev/wd0f is not large enough (/usr/local/lib/libktexteditor.so.4.0.0) Error: ... more files do not fit on /dev/wd0f /dev/wd0h: 97 bytes /dev/wd0f: 337090852 bytes (missing 78473 blocks)
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Add.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 431736cbb8f..21597ccffaf 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.49 2006/12/05 14:04:19 steven Exp $
+# $OpenBSD: Add.pm,v 1.50 2007/02/24 18:45:11 espie Exp $
#
# Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org>
#
@@ -71,6 +71,9 @@ sub validate_plist($$)
OpenBSD::CollisionReport::collision_report($colliding, $state);
}
+ if (defined $state->{overflow}) {
+ OpenBSD::Vstat::tally();
+ }
Fatal "fatal issues in installing $pkgname" if $problems;
$totsize = 1 if $totsize == 0;
return $totsize;
@@ -319,6 +322,7 @@ sub validate
Warn "Error: ... more files do not fit on ",
$s->{dev}, "\n";
}
+ $state->{overflow} = 1;
$$problems++;
}
}
@@ -451,6 +455,7 @@ sub validate
Warn "Error: ... more files do not fit on ",
$s->{dev}, "\n";
}
+ $state->{overflow} = 1;
$$problems++;
}
}
@@ -623,6 +628,7 @@ sub validate
}
if ($s->avail() < 0) {
Warn "Error: ", $s->{dev}, " is not large enough ($fname)\n";
+ $state->{overflow} = 1;
$$problems++;
}
}