summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD/Add.pm
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-11 12:32:04 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-11 12:32:04 +0000
commitdac9950a04ceb5cf20ea409d31c27659111aebb2 (patch)
treed983be8d3b6ef694f64856b4641376d0aad00dc1 /usr.sbin/pkg_add/OpenBSD/Add.pm
parent63ddfd51ddaedc7390c3a7435bf25b80b16701d5 (diff)
don't use Warn if we've got a $state, get through errprint/errsay.
Also: reset lastdisplay on clear, and don't clear twice.
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD/Add.pm')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index c541c20fbc9..6ee8ac27a45 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.94 2009/11/11 12:21:20 espie Exp $
+# $OpenBSD: Add.pm,v 1.95 2009/11/11 12:32:03 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -232,11 +232,11 @@ sub prepare_for_addition
my ($self, $state, $pkgname) = @_;
if ($state->{cdrom_only} && $self->{cdrom} ne 'yes') {
- Warn "Package $pkgname is not for cdrom.\n";
+ $state->errsay("Package $pkgname is not for cdrom.");
$state->{problems}++;
}
if ($state->{ftp_only} && $self->{ftp} ne 'yes') {
- Warn "Package $pkgname is not for ftp.\n";
+ $state->errsay("Package $pkgname is not for ftp.");
$state->{problems}++;
}
}
@@ -266,8 +266,8 @@ sub prepare_for_addition
my $ok = $self->check;
if (defined $ok) {
if ($ok == 0) {
- Warn $self->type, " ", $self->name,
- " does not match\n";
+ $state->errsay($self->type, " ", $self->name,
+ " does not match");
$state->{problems}++;
}
}
@@ -524,7 +524,7 @@ sub install
$state->say("The file $filename would be installed from $origname");
} else {
if (!copy($origname, $filename)) {
- Warn "File $filename could not be installed:\n\t$!\n";
+ $state->errsay("File $filename could not be installed:\n\t$!");
}
$self->set_modes($filename);
if ($state->{verbose}) {