summaryrefslogtreecommitdiff
path: root/usr.sbin/pkg_add
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2009-11-11 11:01:56 +0000
committerMarc Espie <espie@cvs.openbsd.org>2009-11-11 11:01:56 +0000
commitf18f15fad5f8c520648c53de85793be58f0021b7 (patch)
treea32a742d53c0af19e495e535d6d50ee82a07b306 /usr.sbin/pkg_add
parent46546e1fae517929fa8da281ffb9f61eebcf16bf (diff)
bad idea to inherit from Error, compose object instead
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/UpdateSet.pm59
1 files changed, 57 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm b/usr.sbin/pkg_add/OpenBSD/UpdateSet.pm
index 6e19b6a08f0..e204a0f7cfb 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.15 2009/11/10 11:36:56 espie Exp $
+# $OpenBSD: UpdateSet.pm,v 1.16 2009/11/11 11:01:55 espie Exp $
#
# Copyright (c) 2007 Marc Espie <espie@openbsd.org>
#
@@ -47,7 +47,62 @@ sub cleanup
package OpenBSD::pkg_foo::State;
use OpenBSD::Error;
-our @ISA=(qw(OpenBSD::Error));
+
+sub new
+{
+ my $class = shift;
+ my $o = bless {}, $class;
+ $o->init(@_);
+ return $o;
+}
+
+sub init
+{
+ my $self = shift;
+ $self->{l} = OpenBSD::Error->new;
+}
+
+sub log
+{
+ my $self = shift;
+ return $self->{l};
+}
+
+sub set_pkgname
+{
+ my $self = shift;
+ $self->log->set_pkgname(@_);
+}
+
+sub print
+{
+ my $self = shift;
+ $self->log->print(@_);
+}
+
+sub warn
+{
+ my $self = shift;
+ $self->log->warn(@_);
+}
+
+sub fatal
+{
+ my $self = shift;
+ $self->log->fatal(@_);
+}
+
+sub delayed_output
+{
+ my $self = shift;
+ $self->log->delayed_output(@_);
+}
+
+sub system
+{
+ my $self = shift;
+ $self->log->system(@_);
+}
sub progress
{