From b156989e58922ae4b0f378b5ba621aaf48dbad13 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Thu, 11 Jul 2019 07:14:24 +0000 Subject: move the display of cmd into fatal, and don't say it's a fatal error, it's already obvious --- usr.sbin/pkg_add/OpenBSD/AddDelete.pm | 4 ++-- usr.sbin/pkg_add/OpenBSD/PkgCreate.pm | 4 ++-- usr.sbin/pkg_add/OpenBSD/State.pm | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm index c5247bebeae..e1a43e04809 100644 --- a/usr.sbin/pkg_add/OpenBSD/AddDelete.pm +++ b/usr.sbin/pkg_add/OpenBSD/AddDelete.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: AddDelete.pm,v 1.86 2019/07/11 07:03:45 espie Exp $ +# $OpenBSD: AddDelete.pm,v 1.87 2019/07/11 07:14:23 espie Exp $ # # Copyright (c) 2007-2010 Marc Espie # @@ -136,7 +136,7 @@ sub framework try { &$do; } catch { - $state->errsay("#1: #2", $state->{cmd}, $_); + $state->errsay("#1", $_); OpenBSD::Handler->reset; if ($_ =~ m/^Caught SIG(\w+)/o) { kill $1, $$; diff --git a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm index ae1ea255084..4f94b9e4b31 100644 --- a/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm +++ b/usr.sbin/pkg_add/OpenBSD/PkgCreate.pm @@ -1,6 +1,6 @@ #! /usr/bin/perl # ex:ts=8 sw=4: -# $OpenBSD: PkgCreate.pm,v 1.159 2019/07/11 07:03:45 espie Exp $ +# $OpenBSD: PkgCreate.pm,v 1.160 2019/07/11 07:14:23 espie Exp $ # # Copyright (c) 2003-2014 Marc Espie # @@ -1702,7 +1702,7 @@ sub parse_and_run $self->finish_manpages($state, $plist); } } catch { - $state->errsay("#1: #2", $state->{cmd}, $_); + $state->errsay("#1", $_); $rc = 1; }; return $rc; diff --git a/usr.sbin/pkg_add/OpenBSD/State.pm b/usr.sbin/pkg_add/OpenBSD/State.pm index c06b492ebea..6f4172add23 100644 --- a/usr.sbin/pkg_add/OpenBSD/State.pm +++ b/usr.sbin/pkg_add/OpenBSD/State.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: State.pm,v 1.57 2019/07/09 11:24:09 espie Exp $ +# $OpenBSD: State.pm,v 1.58 2019/07/11 07:14:23 espie Exp $ # # Copyright (c) 2007-2014 Marc Espie # @@ -214,7 +214,7 @@ sub _fatal # the way is to eval { croak @_}; and decide what to do with $@. delete $SIG{__DIE__}; $self->sync_display; - croak "Fatal error: ", @_, "\n"; + croak $self->{cmd}, ": ", @_, "\n"; } sub fatal -- cgit v1.2.3