From 38e4108497b4b5487447c1c6a644a8a74ef16629 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Sun, 17 Jan 2010 12:01:01 +0000 Subject: even better messages --- usr.sbin/pkg_add/OpenBSD/RequiredBy.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.sbin/pkg_add/OpenBSD') diff --git a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm index e758eb155f7..337cd34d8ce 100644 --- a/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm +++ b/usr.sbin/pkg_add/OpenBSD/RequiredBy.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: RequiredBy.pm,v 1.19 2010/01/17 11:56:46 espie Exp $ +# $OpenBSD: RequiredBy.pm,v 1.20 2010/01/17 12:01:00 espie Exp $ # # Copyright (c) 2003-2005 Marc Espie # @@ -30,8 +30,8 @@ sub fill_entries if (-f $self->{filename}) { open(my $fh, '<', $self->{filename}) or - croak "Problem opening required list: ", - $self->{filename}, ": $!"; + croak ref($self), + ": reading $self->{filename}: $!"; my $_; while(<$fh>) { s/\s+$//o; @@ -54,17 +54,17 @@ sub synch if (!unlink $self->{filename}) { if ($self->{nonempty}) { - croak "Can't erase $self->{filename}: $!"; + croak ref($self), ": erasing $self->{filename}: $!"; } } if (%{$self->{entries}}) { open(my $fh, '>', $self->{filename}) or - croak "Can't write $self->{filename}: $!"; + croak ref($self), ": writing $self->{filename}: $!"; while (my ($k, $v) = each %{$self->{entries}}) { print $fh "$k\n"; } close($fh) or - croak "Write to $self->{filename} didn't work: $!"; + croak ref($self), ": closing $self->{filename}: $!"; $self->{nonempty} = 1; } else { $self->{nonempty} = 0; -- cgit v1.2.3