summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add/OpenBSD
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-11 12:21:21 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-11 12:21:21 +0000
commit63ddfd51ddaedc7390c3a7435bf25b80b16701d5 (patch)
tree6e18f7b52ecd0172b89090bce998b6c47252f2de /usr.sbin/pkg_add/OpenBSD
parent1c829fb0f939d9417b3b16b2637885a826516516 (diff)
also get most STDERR messages through the same way
Diffstat (limited to 'usr.sbin/pkg_add/OpenBSD')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Add.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Delete.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Dependencies.pm4
-rw-r--r--usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm8
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm20
-rw-r--r--usr.sbin/pkg_add/OpenBSD/Vstat.pm18
6 files changed, 43 insertions, 19 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/Add.pm b/usr.sbin/pkg_add/OpenBSD/Add.pm
index 3f2af49af53..c541c20fbc9 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.93 2009/11/11 12:04:19 espie Exp $
+# $OpenBSD: Add.pm,v 1.94 2009/11/11 12:21:20 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -40,7 +40,7 @@ sub manpages_index
try {
OpenBSD::Makewhatis::merge($destdir.$k, \@l);
} catchall {
- print STDERR "Error in makewhatis: $_\n";
+ $state->errsay("Error in makewhatis: $_");
};
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Delete.pm b/usr.sbin/pkg_add/OpenBSD/Delete.pm
index bd66c3b2e18..bd3fe82e65a 100644
--- a/usr.sbin/pkg_add/OpenBSD/Delete.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Delete.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Delete.pm,v 1.85 2009/11/11 12:04:19 espie Exp $
+# $OpenBSD: Delete.pm,v 1.86 2009/11/11 12:21:20 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -54,7 +54,7 @@ sub manpages_unindex
} else {
eval { OpenBSD::Makewhatis::remove($destdir.$k, \@l); };
if ($@) {
- print STDERR "Error in makewhatis: $@\n";
+ $state->errsay("Error in makewhatis: $@");
}
}
}
@@ -67,7 +67,7 @@ sub validate_plist
if ($plist->has('system-package')) {
$state->{problems}++;
- print STDERR "Error: can't delete system packages\n";
+ $state->errsay("Error: can't delete system packages");
return;
}
$plist->prepare_for_deletion($state, $plist->pkgname);
@@ -132,7 +132,7 @@ sub unregister_dependencies
try {
OpenBSD::RequiredBy->new($name)->delete($pkgname);
} catchall {
- print STDERR "$_\n";
+ $state->errsay($_);
};
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
index 56d52dfbb8e..98bf70dd56a 100644
--- a/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
+++ b/usr.sbin/pkg_add/OpenBSD/Dependencies.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: Dependencies.pm,v 1.82 2009/11/11 12:04:19 espie Exp $
+# $OpenBSD: Dependencies.pm,v 1.83 2009/11/11 12:21:20 espie Exp $
#
# Copyright (c) 2005-2007 Marc Espie <espie@openbsd.org>
#
@@ -177,7 +177,7 @@ sub find_in_new_source
my $plist = OpenBSD::PackingList->from_installation($dep,
\&OpenBSD::PackingList::DependOnly);
if (!defined $plist) {
- print STDERR "Can't read plist for $dep\n";
+ $state->errsay("Can't read plist for $dep");
}
$self->find_in_plist($plist, $dep);
return $self->find_in_already_done($solver, $state, $obj);
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
index e70984071c4..1cfdd285027 100644
--- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
+++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: ProgressMeter.pm,v 1.14 2009/11/11 12:04:19 espie Exp $
+# $OpenBSD: ProgressMeter.pm,v 1.15 2009/11/11 12:21:20 espie Exp $
#
# Copyright (c) 2004-2007 Marc Espie <espie@openbsd.org>
#
@@ -140,6 +140,12 @@ sub print
print @_;
}
+sub errprint
+{
+ shift->clear;
+ print STDERR @_;
+}
+
sub next
{
my $self = shift;
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index 8c3012b52d7..6502274f7d1 100644
--- a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
+++ b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: UpdateSet.pm,v 1.19 2009/11/11 12:04:19 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.20 2009/11/11 12:21:20 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -100,6 +100,18 @@ sub say
$self->progress->print(@_, "\n");
}
+sub errprint
+{
+ my $self = shift;
+ $self->progress->errprint(@_);
+}
+
+sub errsay
+{
+ my $self = shift;
+ $self->progress->errprint(@_, "\n");
+}
+
sub system
{
my $self = shift;
@@ -176,6 +188,12 @@ sub print
print @_;
}
+sub errprint
+{
+ shift;
+ print STDERR @_;
+}
+
# an UpdateSet is a list of packages to remove/install.
# it contains three things:
# -> a list of older packages to remove (installed locations)
diff --git a/usr.sbin/pkg_add/OpenBSD/Vstat.pm b/usr.sbin/pkg_add/OpenBSD/Vstat.pm
index 8774492ff97..0411ce0f3cb 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.43 2007/06/30 11:38:38 espie Exp $
+# $OpenBSD: Vstat.pm,v 1.44 2009/11/11 12:21:20 espie Exp $
#
# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
#
@@ -205,10 +205,10 @@ sub report_ro
my ($s, $state, $fname) = @_;
if ($state->{very_verbose} or ++($s->{problems}) < 4) {
- print STDERR "Error: ", $s->{dev},
- " is read-only ($fname)\n";
+ $state->errsay("Error: ", $s->{dev},
+ " is read-only ($fname)");
} elsif ($s->{problems} == 4) {
- print STDERR "Error: ... more files on ", $s->{dev}, "\n";
+ $state->errsay("Error: ... more files on ", $s->{dev});
}
$state->{problems}++;
}
@@ -218,11 +218,11 @@ sub report_overflow
my ($s, $state, $fname) = @_;
if ($state->{very_verbose} or ++($s->{problems}) < 4) {
- print STDERR "Error: ", $s->{dev},
- " is not large enough ($fname)\n";
+ $state->errsay("Error: ", $s->{dev},
+ " is not large enough ($fname)");
} elsif ($s->{problems} == 4) {
- print STDERR "Error: ... more files do not fit on ",
- $s->{dev}, "\n";
+ $state->errsay("Error: ... more files do not fit on ",
+ $s->{dev});
}
$state->{problems}++;
$state->{overflow} = 1;
@@ -231,7 +231,7 @@ sub report_overflow
sub report_noexec
{
my ($s, $state, $fname) = @_;
- print STDERR "Error: ", $s->{dev}, " is noexec ($fname)\n";
+ $state->errsay("Error: ", $s->{dev}, " is noexec ($fname)");
$state->{problems}++;
}